def is_sitewise_asset_model_exist()

in src/libs/deploy_utils/VideoUtils.py [0:0]


    def is_sitewise_asset_model_exist(self, model_name):
        next_token = ""
        while True:
            if not next_token:
                response = self.iotsitewise.list_asset_models(maxResults=50)
            else:
                response = self.iotsitewise.list_asset_models(maxResults=50, nextToken=next_token)
            for asset_model in response.get("assetModelSummaries"):
                if model_name in asset_model.get("name"):
                    if "Hub" in model_name:
                        self.sitewise_asset_model_id_hub = asset_model.get("id")
                    else:
                        self.sitewise_asset_model_id_camera = asset_model.get("id")
                    return True
            next_token = response.get("nextToken")
            if not next_token:
                break
        return False