in source/aws_lambda/shared/personalize_service.py [0:0]
def _validate_solutions(self, path="solutions[]"):
solutions = jmespath.search(path, self.config_dict) or {}
for idx, _solution in enumerate(solutions):
campaigns = _solution.get("campaigns", [])
if self._validate_type(
campaigns, list, f"solutions[{idx}].campaigns must be a list"
):
self._validate_campaigns(f"solutions[{idx}].campaigns", campaigns)
batch_inference_jobs = _solution.get("batchInferenceJobs", [])
if batch_inference_jobs and self._validate_type(
batch_inference_jobs,
list,
f"solutions[{idx}].batchInferenceJobs must be a list",
):
self._validate_batch_inference_jobs(
path=f"solutions[{idx}].batchInferenceJobs",
solution_name=_solution.get("serviceConfig", {}).get("name", ""),
batch_inference_jobs=batch_inference_jobs,
)
batch_segment_jobs = _solution.get("batchSegmentJobs", [])
if batch_segment_jobs and self._validate_type(
batch_segment_jobs,
list,
f"solutions[{idx}].batchSegmentJobs must be a list",
):
self._validate_batch_segment_jobs(
path=f"solutions[{idx}].batchSegmentJobs",
solution_name=_solution.get("serviceConfig", {}).get("name", ""),
batch_segment_jobs=batch_segment_jobs,
)
_solution = _solution.get("serviceConfig")
if not self._validate_type(
_solution, dict, f"solutions[{idx}].serviceConfig must be an object"
):
continue
_solution["datasetGroupArn"] = DatasetGroup().arn("validation")
self._validate_resource(Solution(), _solution)