sagemaker-core 1.0.31__py3-none-any.whl → 1.0.33__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of sagemaker-core might be problematic. Click here for more details.

@@ -6182,6 +6182,11 @@ SHAPE_DAG = {
6182
6182
  },
6183
6183
  {"name": "DockerSettings", "shape": "DockerSettings", "type": "structure"},
6184
6184
  {"name": "AmazonQSettings", "shape": "AmazonQSettings", "type": "structure"},
6185
+ {
6186
+ "name": "UnifiedStudioSettings",
6187
+ "shape": "UnifiedStudioSettings",
6188
+ "type": "structure",
6189
+ },
6185
6190
  ],
6186
6191
  "type": "structure",
6187
6192
  },
@@ -6200,6 +6205,11 @@ SHAPE_DAG = {
6200
6205
  {"name": "SecurityGroupIds", "shape": "DomainSecurityGroupIds", "type": "list"},
6201
6206
  {"name": "DockerSettings", "shape": "DockerSettings", "type": "structure"},
6202
6207
  {"name": "AmazonQSettings", "shape": "AmazonQSettings", "type": "structure"},
6208
+ {
6209
+ "name": "UnifiedStudioSettings",
6210
+ "shape": "UnifiedStudioSettings",
6211
+ "type": "structure",
6212
+ },
6203
6213
  ],
6204
6214
  "type": "structure",
6205
6215
  },
@@ -13689,6 +13699,7 @@ SHAPE_DAG = {
13689
13699
  },
13690
13700
  {"name": "AppType", "shape": "AppType", "type": "string"},
13691
13701
  {"name": "SpaceStorageSettings", "shape": "SpaceStorageSettings", "type": "structure"},
13702
+ {"name": "SpaceManagedResources", "shape": "FeatureStatus", "type": "string"},
13692
13703
  {"name": "CustomFileSystems", "shape": "CustomFileSystems", "type": "list"},
13693
13704
  ],
13694
13705
  "type": "structure",
@@ -14808,6 +14819,18 @@ SHAPE_DAG = {
14808
14819
  ],
14809
14820
  "type": "structure",
14810
14821
  },
14822
+ "UnifiedStudioSettings": {
14823
+ "members": [
14824
+ {"name": "StudioWebPortalAccess", "shape": "FeatureStatus", "type": "string"},
14825
+ {"name": "DomainAccountId", "shape": "AccountId", "type": "string"},
14826
+ {"name": "DomainRegion", "shape": "RegionName", "type": "string"},
14827
+ {"name": "DomainId", "shape": "UnifiedStudioDomainId", "type": "string"},
14828
+ {"name": "ProjectId", "shape": "UnifiedStudioProjectId", "type": "string"},
14829
+ {"name": "EnvironmentId", "shape": "UnifiedStudioEnvironmentId", "type": "string"},
14830
+ {"name": "ProjectS3Path", "shape": "S3Uri", "type": "string"},
14831
+ ],
14832
+ "type": "structure",
14833
+ },
14811
14834
  "UnprocessedIdentifiers": {
14812
14835
  "member_shape": "BatchGetRecordIdentifier",
14813
14836
  "member_type": "structure",
@@ -243,6 +243,9 @@ SAGEMAKER_PYTHON_SDK_CONFIG_SCHEMA = {
243
243
  "domain_execution_role_arn": {"type": "string"}
244
244
  },
245
245
  "execution_role_identity_config": {"type": "string"},
246
+ "unified_studio_settings": {
247
+ "project_s3_path": {"type": "string"}
248
+ },
246
249
  },
247
250
  "home_efs_file_system_kms_key_id": {"type": "string"},
248
251
  "subnet_ids": {
@@ -6471,10 +6471,12 @@ class DataQualityJobDefinition(Base):
6471
6471
  "CreationTimeBefore": creation_time_before,
6472
6472
  "CreationTimeAfter": creation_time_after,
6473
6473
  }
6474
+
6474
6475
  custom_key_mapping = {
6475
6476
  "monitoring_job_definition_name": "job_definition_name",
6476
6477
  "monitoring_job_definition_arn": "job_definition_arn",
6477
6478
  }
6479
+
6478
6480
  # serialize the input request
6479
6481
  operation_input_args = serialize(operation_input_args)
6480
6482
  logger.debug(f"Serialized input request: {operation_input_args}")
@@ -12613,6 +12615,84 @@ class HubContent(Base):
12613
12615
  region=region,
12614
12616
  )
12615
12617
 
12618
+ @classmethod
12619
+ @Base.add_validate_call
12620
+ def get_all(
12621
+ cls,
12622
+ hub_name: str,
12623
+ hub_content_type: str,
12624
+ name_contains: Optional[str] = Unassigned(),
12625
+ max_schema_version: Optional[str] = Unassigned(),
12626
+ creation_time_before: Optional[datetime.datetime] = Unassigned(),
12627
+ creation_time_after: Optional[datetime.datetime] = Unassigned(),
12628
+ sort_by: Optional[str] = Unassigned(),
12629
+ sort_order: Optional[str] = Unassigned(),
12630
+ session: Optional[Session] = None,
12631
+ region: Optional[str] = None,
12632
+ ) -> ResourceIterator["HubContent"]:
12633
+ """
12634
+ Get all HubContent resources
12635
+
12636
+ Parameters:
12637
+ hub_name: The name of the hub to list the contents of.
12638
+ hub_content_type: The type of hub content to list.
12639
+ name_contains: Only list hub content if the name contains the specified string.
12640
+ max_schema_version: The upper bound of the hub content schema verion.
12641
+ creation_time_before: Only list hub content that was created before the time specified.
12642
+ creation_time_after: Only list hub content that was created after the time specified.
12643
+ sort_by: Sort hub content versions by either name or creation time.
12644
+ sort_order: Sort hubs by ascending or descending order.
12645
+ max_results: The maximum amount of hub content to list.
12646
+ next_token: If the response to a previous ListHubContents request was truncated, the response includes a NextToken. To retrieve the next set of hub content, use the token in the next request.
12647
+ session: Boto3 session.
12648
+ region: Region name.
12649
+
12650
+ Returns:
12651
+ Iterator for listed HubContent resources.
12652
+
12653
+ Raises:
12654
+ botocore.exceptions.ClientError: This exception is raised for AWS service related errors.
12655
+ The error message and error code can be parsed from the exception as follows:
12656
+ ```
12657
+ try:
12658
+ # AWS service call here
12659
+ except botocore.exceptions.ClientError as e:
12660
+ error_message = e.response['Error']['Message']
12661
+ error_code = e.response['Error']['Code']
12662
+ ```
12663
+ ResourceNotFound: Resource being access is not found.
12664
+ """
12665
+
12666
+ client = Base.get_sagemaker_client(
12667
+ session=session, region_name=region, service_name="sagemaker"
12668
+ )
12669
+
12670
+ operation_input_args = {
12671
+ "HubName": hub_name,
12672
+ "HubContentType": hub_content_type,
12673
+ "NameContains": name_contains,
12674
+ "MaxSchemaVersion": max_schema_version,
12675
+ "CreationTimeBefore": creation_time_before,
12676
+ "CreationTimeAfter": creation_time_after,
12677
+ "SortBy": sort_by,
12678
+ "SortOrder": sort_order,
12679
+ }
12680
+ extract_name_mapping = {"hub_content_arn": ["hub-content/", "hub_name"]}
12681
+
12682
+ # serialize the input request
12683
+ operation_input_args = serialize(operation_input_args)
12684
+ logger.debug(f"Serialized input request: {operation_input_args}")
12685
+
12686
+ return ResourceIterator(
12687
+ client=client,
12688
+ list_method="list_hub_contents",
12689
+ summaries_key="HubContentSummaries",
12690
+ summary_name="HubContentInfo",
12691
+ resource_cls=HubContent,
12692
+ extract_name_mapping=extract_name_mapping,
12693
+ list_method_kwargs=operation_input_args,
12694
+ )
12695
+
12616
12696
  @Base.add_validate_call
12617
12697
  def get_all_versions(
12618
12698
  self,
@@ -14915,6 +14995,81 @@ class ImageVersion(Base):
14915
14995
  raise e
14916
14996
  time.sleep(poll)
14917
14997
 
14998
+ @classmethod
14999
+ @Base.add_validate_call
15000
+ def get_all(
15001
+ cls,
15002
+ image_name: str,
15003
+ creation_time_after: Optional[datetime.datetime] = Unassigned(),
15004
+ creation_time_before: Optional[datetime.datetime] = Unassigned(),
15005
+ last_modified_time_after: Optional[datetime.datetime] = Unassigned(),
15006
+ last_modified_time_before: Optional[datetime.datetime] = Unassigned(),
15007
+ sort_by: Optional[str] = Unassigned(),
15008
+ sort_order: Optional[str] = Unassigned(),
15009
+ session: Optional[Session] = None,
15010
+ region: Optional[str] = None,
15011
+ ) -> ResourceIterator["ImageVersion"]:
15012
+ """
15013
+ Get all ImageVersion resources
15014
+
15015
+ Parameters:
15016
+ image_name: The name of the image to list the versions of.
15017
+ creation_time_after: A filter that returns only versions created on or after the specified time.
15018
+ creation_time_before: A filter that returns only versions created on or before the specified time.
15019
+ last_modified_time_after: A filter that returns only versions modified on or after the specified time.
15020
+ last_modified_time_before: A filter that returns only versions modified on or before the specified time.
15021
+ max_results: The maximum number of versions to return in the response. The default value is 10.
15022
+ next_token: If the previous call to ListImageVersions didn't return the full set of versions, the call returns a token for getting the next set of versions.
15023
+ sort_by: The property used to sort results. The default value is CREATION_TIME.
15024
+ sort_order: The sort order. The default value is DESCENDING.
15025
+ session: Boto3 session.
15026
+ region: Region name.
15027
+
15028
+ Returns:
15029
+ Iterator for listed ImageVersion resources.
15030
+
15031
+ Raises:
15032
+ botocore.exceptions.ClientError: This exception is raised for AWS service related errors.
15033
+ The error message and error code can be parsed from the exception as follows:
15034
+ ```
15035
+ try:
15036
+ # AWS service call here
15037
+ except botocore.exceptions.ClientError as e:
15038
+ error_message = e.response['Error']['Message']
15039
+ error_code = e.response['Error']['Code']
15040
+ ```
15041
+ ResourceNotFound: Resource being access is not found.
15042
+ """
15043
+
15044
+ client = Base.get_sagemaker_client(
15045
+ session=session, region_name=region, service_name="sagemaker"
15046
+ )
15047
+
15048
+ operation_input_args = {
15049
+ "CreationTimeAfter": creation_time_after,
15050
+ "CreationTimeBefore": creation_time_before,
15051
+ "ImageName": image_name,
15052
+ "LastModifiedTimeAfter": last_modified_time_after,
15053
+ "LastModifiedTimeBefore": last_modified_time_before,
15054
+ "SortBy": sort_by,
15055
+ "SortOrder": sort_order,
15056
+ }
15057
+ extract_name_mapping = {"image_version_arn": ["image-version/", "image_name"]}
15058
+
15059
+ # serialize the input request
15060
+ operation_input_args = serialize(operation_input_args)
15061
+ logger.debug(f"Serialized input request: {operation_input_args}")
15062
+
15063
+ return ResourceIterator(
15064
+ client=client,
15065
+ list_method="list_image_versions",
15066
+ summaries_key="ImageVersions",
15067
+ summary_name="ImageVersion",
15068
+ resource_cls=ImageVersion,
15069
+ extract_name_mapping=extract_name_mapping,
15070
+ list_method_kwargs=operation_input_args,
15071
+ )
15072
+
14918
15073
 
14919
15074
  class InferenceComponent(Base):
14920
15075
  """
@@ -18504,10 +18659,12 @@ class ModelBiasJobDefinition(Base):
18504
18659
  "CreationTimeBefore": creation_time_before,
18505
18660
  "CreationTimeAfter": creation_time_after,
18506
18661
  }
18662
+
18507
18663
  custom_key_mapping = {
18508
18664
  "monitoring_job_definition_name": "job_definition_name",
18509
18665
  "monitoring_job_definition_arn": "job_definition_arn",
18510
18666
  }
18667
+
18511
18668
  # serialize the input request
18512
18669
  operation_input_args = serialize(operation_input_args)
18513
18670
  logger.debug(f"Serialized input request: {operation_input_args}")
@@ -19733,10 +19890,12 @@ class ModelExplainabilityJobDefinition(Base):
19733
19890
  "CreationTimeBefore": creation_time_before,
19734
19891
  "CreationTimeAfter": creation_time_after,
19735
19892
  }
19893
+
19736
19894
  custom_key_mapping = {
19737
19895
  "monitoring_job_definition_name": "job_definition_name",
19738
19896
  "monitoring_job_definition_arn": "job_definition_arn",
19739
19897
  }
19898
+
19740
19899
  # serialize the input request
19741
19900
  operation_input_args = serialize(operation_input_args)
19742
19901
  logger.debug(f"Serialized input request: {operation_input_args}")
@@ -21350,10 +21509,12 @@ class ModelQualityJobDefinition(Base):
21350
21509
  "CreationTimeBefore": creation_time_before,
21351
21510
  "CreationTimeAfter": creation_time_after,
21352
21511
  }
21512
+
21353
21513
  custom_key_mapping = {
21354
21514
  "monitoring_job_definition_name": "job_definition_name",
21355
21515
  "monitoring_job_definition_arn": "job_definition_arn",
21356
21516
  }
21517
+
21357
21518
  # serialize the input request
21358
21519
  operation_input_args = serialize(operation_input_args)
21359
21520
  logger.debug(f"Serialized input request: {operation_input_args}")
@@ -3342,7 +3342,7 @@ class ClusterNodeDetails(Base):
3342
3342
  instance_status: The status of the instance.
3343
3343
  instance_type: The type of the instance.
3344
3344
  launch_time: The time when the instance is launched.
3345
- last_software_update_time: The time of when the cluster was last updated.
3345
+ last_software_update_time: The time when the cluster was last updated.
3346
3346
  life_cycle_config: The LifeCycle configuration applied to the instance.
3347
3347
  override_vpc_config: The customized Amazon VPC configuration at the instance group level that overrides the default Amazon VPC configuration of the SageMaker HyperPod cluster.
3348
3348
  threads_per_core: The number of threads per CPU core you specified under CreateCluster.
@@ -3380,7 +3380,7 @@ class ClusterNodeSummary(Base):
3380
3380
  instance_id: The ID of the instance.
3381
3381
  instance_type: The type of the instance.
3382
3382
  launch_time: The time when the instance is launched.
3383
- last_software_update_time: The time of when SageMaker last updated the software of the instances in the cluster.
3383
+ last_software_update_time: The time when SageMaker last updated the software of the instances in the cluster.
3384
3384
  instance_status: The status of the instance.
3385
3385
  """
3386
3386
 
@@ -4765,6 +4765,31 @@ class DockerSettings(Base):
4765
4765
  vpc_only_trusted_accounts: Optional[List[str]] = Unassigned()
4766
4766
 
4767
4767
 
4768
+ class UnifiedStudioSettings(Base):
4769
+ """
4770
+ UnifiedStudioSettings
4771
+ The settings that apply to an Amazon SageMaker AI domain when you use it in Amazon SageMaker Unified Studio.
4772
+
4773
+ Attributes
4774
+ ----------------------
4775
+ studio_web_portal_access: Sets whether you can access the domain in Amazon SageMaker Studio: ENABLED You can access the domain in Amazon SageMaker Studio. If you migrate the domain to Amazon SageMaker Unified Studio, you can access it in both studio interfaces. DISABLED You can't access the domain in Amazon SageMaker Studio. If you migrate the domain to Amazon SageMaker Unified Studio, you can access it only in that studio interface. To migrate a domain to Amazon SageMaker Unified Studio, you specify the UnifiedStudioSettings data type when you use the UpdateDomain action.
4776
+ domain_account_id: The ID of the Amazon Web Services account that has the Amazon SageMaker Unified Studio domain. The default value, if you don't specify an ID, is the ID of the account that has the Amazon SageMaker AI domain.
4777
+ domain_region: The Amazon Web Services Region where the domain is located in Amazon SageMaker Unified Studio. The default value, if you don't specify a Region, is the Region where the Amazon SageMaker AI domain is located.
4778
+ domain_id: The ID of the Amazon SageMaker Unified Studio domain associated with this domain.
4779
+ project_id: The ID of the Amazon SageMaker Unified Studio project that corresponds to the domain.
4780
+ environment_id: The ID of the environment that Amazon SageMaker Unified Studio associates with the domain.
4781
+ project_s3_path: The location where Amazon S3 stores temporary execution data and other artifacts for the project that corresponds to the domain.
4782
+ """
4783
+
4784
+ studio_web_portal_access: Optional[str] = Unassigned()
4785
+ domain_account_id: Optional[str] = Unassigned()
4786
+ domain_region: Optional[str] = Unassigned()
4787
+ domain_id: Optional[str] = Unassigned()
4788
+ project_id: Optional[str] = Unassigned()
4789
+ environment_id: Optional[str] = Unassigned()
4790
+ project_s3_path: Optional[str] = Unassigned()
4791
+
4792
+
4768
4793
  class DomainSettings(Base):
4769
4794
  """
4770
4795
  DomainSettings
@@ -4777,6 +4802,7 @@ class DomainSettings(Base):
4777
4802
  execution_role_identity_config: The configuration for attaching a SageMaker AI user profile name to the execution role as a sts:SourceIdentity key.
4778
4803
  docker_settings: A collection of settings that configure the domain's Docker interaction.
4779
4804
  amazon_q_settings: A collection of settings that configure the Amazon Q experience within the domain. The AuthMode that you use to create the domain must be SSO.
4805
+ unified_studio_settings: The settings that apply to an SageMaker AI domain when you use it in Amazon SageMaker Unified Studio.
4780
4806
  """
4781
4807
 
4782
4808
  security_group_ids: Optional[List[str]] = Unassigned()
@@ -4784,6 +4810,7 @@ class DomainSettings(Base):
4784
4810
  execution_role_identity_config: Optional[str] = Unassigned()
4785
4811
  docker_settings: Optional[DockerSettings] = Unassigned()
4786
4812
  amazon_q_settings: Optional[AmazonQSettings] = Unassigned()
4813
+ unified_studio_settings: Optional[UnifiedStudioSettings] = Unassigned()
4787
4814
 
4788
4815
 
4789
4816
  class DefaultSpaceSettings(Base):
@@ -7446,6 +7473,7 @@ class SpaceSettings(Base):
7446
7473
  jupyter_lab_app_settings: The settings for the JupyterLab application.
7447
7474
  app_type: The type of app created within the space. If using the UpdateSpace API, you can't change the app type of your space by specifying a different value for this field.
7448
7475
  space_storage_settings: The storage settings for a space.
7476
+ space_managed_resources: If you enable this option, SageMaker AI creates the following resources on your behalf when you create the space: The user profile that possesses the space. The app that the space contains.
7449
7477
  custom_file_systems: A file system, created by you, that you assign to a space for an Amazon SageMaker AI Domain. Permitted users can access this file system in Amazon SageMaker AI Studio.
7450
7478
  """
7451
7479
 
@@ -7455,6 +7483,7 @@ class SpaceSettings(Base):
7455
7483
  jupyter_lab_app_settings: Optional[SpaceJupyterLabAppSettings] = Unassigned()
7456
7484
  app_type: Optional[str] = Unassigned()
7457
7485
  space_storage_settings: Optional[SpaceStorageSettings] = Unassigned()
7486
+ space_managed_resources: Optional[str] = Unassigned()
7458
7487
  custom_file_systems: Optional[List[CustomFileSystem]] = Unassigned()
7459
7488
 
7460
7489
 
@@ -9453,6 +9482,7 @@ class DomainSettingsForUpdate(Base):
9453
9482
  security_group_ids: The security groups for the Amazon Virtual Private Cloud that the Domain uses for communication between Domain-level apps and user apps.
9454
9483
  docker_settings: A collection of settings that configure the domain's Docker interaction.
9455
9484
  amazon_q_settings: A collection of settings that configure the Amazon Q experience within the domain.
9485
+ unified_studio_settings: The settings that apply to an SageMaker AI domain when you use it in Amazon SageMaker Unified Studio.
9456
9486
  """
9457
9487
 
9458
9488
  r_studio_server_pro_domain_settings_for_update: Optional[
@@ -9462,6 +9492,7 @@ class DomainSettingsForUpdate(Base):
9462
9492
  security_group_ids: Optional[List[str]] = Unassigned()
9463
9493
  docker_settings: Optional[DockerSettings] = Unassigned()
9464
9494
  amazon_q_settings: Optional[AmazonQSettings] = Unassigned()
9495
+ unified_studio_settings: Optional[UnifiedStudioSettings] = Unassigned()
9465
9496
 
9466
9497
 
9467
9498
  class PredefinedMetricSpecification(Base):
@@ -387,6 +387,7 @@ class ResourceIterator(Generic[T]):
387
387
  list_method: str,
388
388
  list_method_kwargs: dict = {},
389
389
  custom_key_mapping: dict = None,
390
+ extract_name_mapping: dict = None,
390
391
  ):
391
392
  """Initialize a ResourceIterator object
392
393
 
@@ -398,6 +399,7 @@ class ResourceIterator(Generic[T]):
398
399
  list_method (str): The list method string used to make list calls to the client.
399
400
  list_method_kwargs (dict, optional): The kwargs used to make list method calls. Defaults to {}.
400
401
  custom_key_mapping (dict, optional): The custom key mapping used to map keys from summary object to those expected from resource object during initialization. Defaults to None.
402
+ extract_name_mapping (dict, optional): The extract name mapping used to extract names from arn in summary object and map to those expected from resource object during initialization. Defaults to None.
401
403
  """
402
404
  self.summaries_key = summaries_key
403
405
  self.summary_name = summary_name
@@ -405,6 +407,7 @@ class ResourceIterator(Generic[T]):
405
407
  self.list_method = list_method
406
408
  self.list_method_kwargs = list_method_kwargs
407
409
  self.custom_key_mapping = custom_key_mapping
410
+ self.extract_name_mapping = extract_name_mapping
408
411
 
409
412
  self.resource_cls = resource_cls
410
413
  self.index = 0
@@ -433,6 +436,12 @@ class ResourceIterator(Generic[T]):
433
436
  if self.custom_key_mapping:
434
437
  init_data = {self.custom_key_mapping.get(k, k): v for k, v in init_data.items()}
435
438
 
439
+ # Extract name from arn. Currently implemented for HubContent and ImageVersion
440
+ if self.extract_name_mapping:
441
+ for arn, target in self.extract_name_mapping.items():
442
+ name = init_data[arn].split(target[0])[1].split("/")[0]
443
+ init_data.update({target[1]: name})
444
+
436
445
  # Filter out the fields that are not in the resource class
437
446
  fields = self.resource_cls.__annotations__
438
447
  init_data = {k: v for k, v in init_data.items() if k in fields}
@@ -1754,14 +1754,27 @@ class ResourcesCodeGen:
1754
1754
  get_operation_required_input = []
1755
1755
 
1756
1756
  custom_key_mapping_str = ""
1757
+ custom_key_mapping = {}
1758
+ extract_name_mapping_str = ""
1759
+ extract_name_mapping = {}
1757
1760
  if any(member not in summary_members for member in get_operation_required_input):
1758
- if "MonitoringJobDefinitionSummary" == summary_name:
1761
+ if summary_name == "MonitoringJobDefinitionSummary":
1759
1762
  custom_key_mapping = {
1760
1763
  "monitoring_job_definition_name": "job_definition_name",
1761
1764
  "monitoring_job_definition_arn": "job_definition_arn",
1762
1765
  }
1763
- custom_key_mapping_str = f"custom_key_mapping = {json.dumps(custom_key_mapping)}"
1764
- custom_key_mapping_str = add_indent(custom_key_mapping_str, 4)
1766
+ elif summary_name == "HubContentInfo":
1767
+ # HubContentArn -- arn:<partition>:sagemaker:<region>:<account-id>:hub-content/<hub-name>/<type>/<name>/<version>
1768
+ # {source key from input: (target label in arn, target key in output)}
1769
+ extract_name_mapping = {
1770
+ "hub_content_arn": ("hub-content/", "hub_name"),
1771
+ }
1772
+ elif summary_name == "ImageVersion":
1773
+ # ImageVersionArn -- arn:aws:sagemaker:<region>:<account>:image-version/<image-name>/<version-number>
1774
+ # {source key from input: (target label in arn, target key in output)}
1775
+ extract_name_mapping = {
1776
+ "image_version_arn": ("image-version/", "image_name"),
1777
+ }
1765
1778
  else:
1766
1779
  log.warning(
1767
1780
  f"Resource {resource_name} summaries do not have required members to create object instance. Resource may require custom key mapping for get_all().\n"
@@ -1769,6 +1782,15 @@ class ResourcesCodeGen:
1769
1782
  )
1770
1783
  return ""
1771
1784
 
1785
+ if custom_key_mapping:
1786
+ custom_key_mapping_str = add_indent(
1787
+ f"custom_key_mapping = {json.dumps(custom_key_mapping)}", 4
1788
+ )
1789
+ if extract_name_mapping:
1790
+ extract_name_mapping_str = add_indent(
1791
+ f"extract_name_mapping = {json.dumps(extract_name_mapping)}", 4
1792
+ )
1793
+
1772
1794
  resource_iterator_args_list = [
1773
1795
  "client=client",
1774
1796
  f"list_method='{operation}'",
@@ -1780,6 +1802,9 @@ class ResourcesCodeGen:
1780
1802
  if custom_key_mapping_str:
1781
1803
  resource_iterator_args_list.append(f"custom_key_mapping=custom_key_mapping")
1782
1804
 
1805
+ if extract_name_mapping_str:
1806
+ resource_iterator_args_list.append(f"extract_name_mapping=extract_name_mapping")
1807
+
1783
1808
  exclude_list = ["next_token", "max_results"]
1784
1809
  get_all_args = self._generate_method_args(operation_input_shape_name, exclude_list)
1785
1810
 
@@ -1792,6 +1817,7 @@ class ResourcesCodeGen:
1792
1817
  resource=resource_name,
1793
1818
  operation=operation,
1794
1819
  custom_key_mapping=custom_key_mapping_str,
1820
+ extract_name_mapping=extract_name_mapping_str,
1795
1821
  resource_iterator_args=resource_iterator_args,
1796
1822
  )
1797
1823
  return formatted_method
@@ -1822,6 +1848,7 @@ class ResourcesCodeGen:
1822
1848
  get_all_args=get_all_args,
1823
1849
  operation_input_args=operation_input_args,
1824
1850
  custom_key_mapping=custom_key_mapping_str,
1851
+ extract_name_mapping=extract_name_mapping_str,
1825
1852
  resource_iterator_args=resource_iterator_args,
1826
1853
  )
1827
1854
  return formatted_method
@@ -512,6 +512,7 @@ def get_all(
512
512
  operation_input_args = {{
513
513
  {operation_input_args}
514
514
  }}
515
+ {extract_name_mapping}
515
516
  {custom_key_mapping}
516
517
  # serialize the input request
517
518
  operation_input_args = serialize(operation_input_args)
@@ -542,6 +543,7 @@ def get_all(
542
543
 
543
544
  """
544
545
  client = Base.get_sagemaker_client(session=session, region_name=region, service_name="{service_name}")
546
+ {extract_name_mapping}
545
547
  {custom_key_mapping}
546
548
  return ResourceIterator(
547
549
  {resource_iterator_args}
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sagemaker-core
3
- Version: 1.0.31
3
+ Version: 1.0.33
4
4
  Summary: An python package for sagemaker core functionalities
5
5
  Author-email: AWS <sagemaker-interests@amazon.com>
6
6
  Project-URL: Repository, https://github.com/aws/sagemaker-core.git
@@ -20,7 +20,7 @@ Requires-Dist: pydantic<3.0.0,>=2.0.0
20
20
  Requires-Dist: PyYAML<7.0,>=6.0
21
21
  Requires-Dist: jsonschema<5.0.0
22
22
  Requires-Dist: platformdirs<5.0.0,>=4.0.0
23
- Requires-Dist: rich<14.0.0,>=13.0.0
23
+ Requires-Dist: rich<15.0.0,>=14.0.0
24
24
  Requires-Dist: mock<5.0,>4.0
25
25
  Requires-Dist: importlib-metadata<7.0,>=1.4.0
26
26
  Provides-Extra: codegen
@@ -3,19 +3,19 @@ sagemaker_core/_version.py,sha256=4UH5LevZBa3Kl1OiDbkaeIzXUQNSYVFrc-2su2TCco4,86
3
3
  sagemaker_core/helper/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  sagemaker_core/helper/session_helper.py,sha256=GO1UJgpN1L9a25nYlVb-KWk4KvmFzVkLqFMqw-VaI4c,33126
5
5
  sagemaker_core/main/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
- sagemaker_core/main/config_schema.py,sha256=lBwIm5CT_dSXeW5i6cgRzbiLDjs0qtH1FrM78F-ma2U,57382
6
+ sagemaker_core/main/config_schema.py,sha256=Wxe2gJash1rrxBomGhSYmII1LmJ3E70LIuSWklX4_7g,57588
7
7
  sagemaker_core/main/exceptions.py,sha256=87DUlrmHxaWoiYNlpNY9ixxFMPRk_dIGPsA2e_xdVwQ,5602
8
8
  sagemaker_core/main/intelligent_defaults_helper.py,sha256=5SDM6UavZtp-k5LhqRL7GRIDgzFB5UsC_p7YuiSPK9A,8334
9
9
  sagemaker_core/main/logs.py,sha256=yfEH7uP91nbE1lefymOlBr81ziBzsDSIOF2Qyd54FJE,6241
10
- sagemaker_core/main/resources.py,sha256=jNX5jp5tmwa0t8PYPxWrRRBAGIn0G-iq3C-7TvBxEPw,1420815
11
- sagemaker_core/main/shapes.py,sha256=r6a24wbWncTXBpDqmP_VPUtO0Uc7QYFdOs7EZ-bLz0A,736265
10
+ sagemaker_core/main/resources.py,sha256=jtD_9MUoyJkTDGAAnvEVpaconzPF6kRFBdio_mN_3zs,1427804
11
+ sagemaker_core/main/shapes.py,sha256=YfcsZIpYetJPZHNo-VfajMCaqT6eGYXI_1EvCLr0dGg,739047
12
12
  sagemaker_core/main/user_agent.py,sha256=BPYDAfDd70ObP-VAjl7aDHALHyGknkpRP21ktVr_LDw,2744
13
- sagemaker_core/main/utils.py,sha256=qTGJDcZwrAQSsdyg8A78x4PKU4Wu1rY6Cn3OIbIspaA,18546
13
+ sagemaker_core/main/utils.py,sha256=tJyHjHFwwmz8LHMlOLf5_Exu4h-kFVnAxvXkbChkuHQ,19215
14
14
  sagemaker_core/main/code_injection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
15
  sagemaker_core/main/code_injection/base.py,sha256=11_Jif0nOzfbLGlXaacKf-wcizzfS64U0OSZGoVffFU,1733
16
16
  sagemaker_core/main/code_injection/codec.py,sha256=nA51E9iNWHyKou1G23rKSRL4WitdkFRbMuFkyrGHzKU,8428
17
17
  sagemaker_core/main/code_injection/constants.py,sha256=2ICExGge8vAWx7lSTW0JGh-bH1korkvpOpDu5M63eI4,980
18
- sagemaker_core/main/code_injection/shape_dag.py,sha256=qUUqZfPh9q7lYjifbApH_t94xN03N1e6JgWOv7ttofw,703067
18
+ sagemaker_core/main/code_injection/shape_dag.py,sha256=v4admWbDBIaum364qkuvq76WM8eOC0wOOfH8KpuA3Gc,704183
19
19
  sagemaker_core/resources/__init__.py,sha256=EAYTFMN-nPjnPjjBbhIUeaL67FLKNPd7qbcbl9VIrws,31
20
20
  sagemaker_core/shapes/__init__.py,sha256=RnbIu9eTxKt-DNsOFJabrWIgrrtS9_SdAozP9JBl_ic,28
21
21
  sagemaker_core/tools/__init__.py,sha256=xX79JImxCVzrWMnjgntLCve2G5I-R4pRar5s20kT9Rs,56
@@ -23,13 +23,13 @@ sagemaker_core/tools/codegen.py,sha256=mKWVi2pWnPxyIoWUEPYjEc9Gw7D9bCOrHqa00yzIZ
23
23
  sagemaker_core/tools/constants.py,sha256=XEwsUJ4w952mpnk-K0TS7R2uJhZyVPjcR47nrzgVXtg,3483
24
24
  sagemaker_core/tools/data_extractor.py,sha256=pNfmTA0NUA96IgfLrla7a36Qjc1NljbwgZYaOhouKqQ,2113
25
25
  sagemaker_core/tools/method.py,sha256=Ud2YeH2SPkj7xtIxBuUdRfQwCmovMUzGGkcIvzhpQeQ,805
26
- sagemaker_core/tools/resources_codegen.py,sha256=wz9HU_crbHeZUp5ylMqgfWbHCCgVLfD31hFBGBSuW_A,85100
26
+ sagemaker_core/tools/resources_codegen.py,sha256=jYhbGQ0X5xuQGgIJp6UOHY_RU-PsLFe4JfpdjL1lPCk,86445
27
27
  sagemaker_core/tools/resources_extractor.py,sha256=hN61ehZbPnhFW-2FIVDi7NsEz4rLvGr-WoglHQGfrug,14523
28
28
  sagemaker_core/tools/shapes_codegen.py,sha256=4lsePZpjk7M6RpJs5yar_m4z5MzwGHFrvCkdS_-R12c,12172
29
29
  sagemaker_core/tools/shapes_extractor.py,sha256=vxVKjXD3lmjrkoKiexjUnOt8ITbFxQSeiDtx7P6Qtkw,14226
30
- sagemaker_core/tools/templates.py,sha256=vIgRWConRGAQ-Mri6LwfkArqWHlL3KXcvbbYa-t_MV4,23414
31
- sagemaker_core-1.0.31.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
32
- sagemaker_core-1.0.31.dist-info/METADATA,sha256=oPcMceosjqH8YzEQe2pcSyFkoyWbWbdt0IPptyEGwsg,4885
33
- sagemaker_core-1.0.31.dist-info/WHEEL,sha256=wXxTzcEDnjrTwFYjLPcsW_7_XihufBwmpiBeiXNBGEA,91
34
- sagemaker_core-1.0.31.dist-info/top_level.txt,sha256=R3GAZZ1zC5JxqdE_0x2Lu_WYi2Xfke7VsiP3L5zngfA,15
35
- sagemaker_core-1.0.31.dist-info/RECORD,,
30
+ sagemaker_core/tools/templates.py,sha256=0lOIH3Rq2CXWkQhK6VenN_TE_v5p852s2kQyb_BeQxA,23460
31
+ sagemaker_core-1.0.33.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
32
+ sagemaker_core-1.0.33.dist-info/METADATA,sha256=0AkeGwVa8WdSOps6dTQQZh0_KmS3uRLV_NWmH0PkuEM,4885
33
+ sagemaker_core-1.0.33.dist-info/WHEEL,sha256=0CuiUZ_p9E4cD6NyLD6UG80LBXYyiSYZOKDm5lp32xk,91
34
+ sagemaker_core-1.0.33.dist-info/top_level.txt,sha256=R3GAZZ1zC5JxqdE_0x2Lu_WYi2Xfke7VsiP3L5zngfA,15
35
+ sagemaker_core-1.0.33.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.1.0)
2
+ Generator: setuptools (80.3.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5