sagemaker-core 1.0.4__py3-none-any.whl → 1.0.5__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.

@@ -21,6 +21,381 @@ class Base(BaseModel):
21
21
  model_config = ConfigDict(protected_namespaces=(), validate_assignment=True, extra="forbid")
22
22
 
23
23
 
24
+ class InternalDependencyException(Base):
25
+ """
26
+ InternalDependencyException
27
+ Your request caused an exception with an internal dependency. Contact customer support.
28
+
29
+ Attributes
30
+ ----------------------
31
+ message
32
+ """
33
+
34
+ message: Optional[str] = Unassigned()
35
+
36
+
37
+ class InternalFailure(Base):
38
+ """
39
+ InternalFailure
40
+ An internal failure occurred. Try your request again. If the problem persists, contact Amazon Web Services customer support.
41
+
42
+ Attributes
43
+ ----------------------
44
+ message
45
+ """
46
+
47
+ message: Optional[str] = Unassigned()
48
+
49
+
50
+ class InternalStreamFailure(Base):
51
+ """
52
+ InternalStreamFailure
53
+ The stream processing failed because of an unknown error, exception or failure. Try your request again.
54
+
55
+ Attributes
56
+ ----------------------
57
+ message
58
+ """
59
+
60
+ message: Optional[str] = Unassigned()
61
+
62
+
63
+ class InvokeEndpointAsyncOutput(Base):
64
+ """
65
+ InvokeEndpointAsyncOutput
66
+
67
+ Attributes
68
+ ----------------------
69
+ inference_id: Identifier for an inference request. This will be the same as the InferenceId specified in the input. Amazon SageMaker will generate an identifier for you if you do not specify one.
70
+ output_location: The Amazon S3 URI where the inference response payload is stored.
71
+ failure_location: The Amazon S3 URI where the inference failure response payload is stored.
72
+ """
73
+
74
+ inference_id: Optional[str] = Unassigned()
75
+ output_location: Optional[str] = Unassigned()
76
+ failure_location: Optional[str] = Unassigned()
77
+
78
+
79
+ class InvokeEndpointOutput(Base):
80
+ """
81
+ InvokeEndpointOutput
82
+
83
+ Attributes
84
+ ----------------------
85
+ body: Includes the inference provided by the model. For information about the format of the response body, see Common Data Formats-Inference. If the explainer is activated, the body includes the explanations provided by the model. For more information, see the Response section under Invoke the Endpoint in the Developer Guide.
86
+ content_type: The MIME type of the inference returned from the model container.
87
+ invoked_production_variant: Identifies the production variant that was invoked.
88
+ custom_attributes: Provides additional information in the response about the inference returned by a model hosted at an Amazon SageMaker endpoint. The information is an opaque value that is forwarded verbatim. You could use this value, for example, to return an ID received in the CustomAttributes header of a request or other metadata that a service endpoint was programmed to produce. The value must consist of no more than 1024 visible US-ASCII characters as specified in Section 3.3.6. Field Value Components of the Hypertext Transfer Protocol (HTTP/1.1). If the customer wants the custom attribute returned, the model must set the custom attribute to be included on the way back. The code in your model is responsible for setting or updating any custom attributes in the response. If your code does not set this value in the response, an empty value is returned. For example, if a custom attribute represents the trace ID, your model can prepend the custom attribute with Trace ID: in your post-processing function. This feature is currently supported in the Amazon Web Services SDKs but not in the Amazon SageMaker Python SDK.
89
+ new_session_id: If you created a stateful session with your request, the ID and expiration time that the model assigns to that session.
90
+ closed_session_id: If you closed a stateful session with your request, the ID of that session.
91
+ """
92
+
93
+ body: Any
94
+ content_type: Optional[str] = Unassigned()
95
+ invoked_production_variant: Optional[str] = Unassigned()
96
+ custom_attributes: Optional[str] = Unassigned()
97
+ new_session_id: Optional[str] = Unassigned()
98
+ closed_session_id: Optional[str] = Unassigned()
99
+
100
+
101
+ class PayloadPart(Base):
102
+ """
103
+ PayloadPart
104
+ A wrapper for pieces of the payload that's returned in response to a streaming inference request. A streaming inference response consists of one or more payload parts.
105
+
106
+ Attributes
107
+ ----------------------
108
+ bytes: A blob that contains part of the response for your streaming inference request.
109
+ """
110
+
111
+ bytes: Optional[Any] = Unassigned()
112
+
113
+
114
+ class ModelStreamError(Base):
115
+ """
116
+ ModelStreamError
117
+ An error occurred while streaming the response body. This error can have the following error codes: ModelInvocationTimeExceeded The model failed to finish sending the response within the timeout period allowed by Amazon SageMaker. StreamBroken The Transmission Control Protocol (TCP) connection between the client and the model was reset or closed.
118
+
119
+ Attributes
120
+ ----------------------
121
+ message
122
+ error_code: This error can have the following error codes: ModelInvocationTimeExceeded The model failed to finish sending the response within the timeout period allowed by Amazon SageMaker. StreamBroken The Transmission Control Protocol (TCP) connection between the client and the model was reset or closed.
123
+ """
124
+
125
+ message: Optional[str] = Unassigned()
126
+ error_code: Optional[str] = Unassigned()
127
+
128
+
129
+ class ResponseStream(Base):
130
+ """
131
+ ResponseStream
132
+ A stream of payload parts. Each part contains a portion of the response for a streaming inference request.
133
+
134
+ Attributes
135
+ ----------------------
136
+ payload_part: A wrapper for pieces of the payload that's returned in response to a streaming inference request. A streaming inference response consists of one or more payload parts.
137
+ model_stream_error: An error occurred while streaming the response body. This error can have the following error codes: ModelInvocationTimeExceeded The model failed to finish sending the response within the timeout period allowed by Amazon SageMaker. StreamBroken The Transmission Control Protocol (TCP) connection between the client and the model was reset or closed.
138
+ internal_stream_failure: The stream processing failed because of an unknown error, exception or failure. Try your request again.
139
+ """
140
+
141
+ payload_part: Optional[PayloadPart] = Unassigned()
142
+ model_stream_error: Optional[ModelStreamError] = Unassigned()
143
+ internal_stream_failure: Optional[InternalStreamFailure] = Unassigned()
144
+
145
+
146
+ class InvokeEndpointWithResponseStreamOutput(Base):
147
+ """
148
+ InvokeEndpointWithResponseStreamOutput
149
+
150
+ Attributes
151
+ ----------------------
152
+ body
153
+ content_type: The MIME type of the inference returned from the model container.
154
+ invoked_production_variant: Identifies the production variant that was invoked.
155
+ custom_attributes: Provides additional information in the response about the inference returned by a model hosted at an Amazon SageMaker endpoint. The information is an opaque value that is forwarded verbatim. You could use this value, for example, to return an ID received in the CustomAttributes header of a request or other metadata that a service endpoint was programmed to produce. The value must consist of no more than 1024 visible US-ASCII characters as specified in Section 3.3.6. Field Value Components of the Hypertext Transfer Protocol (HTTP/1.1). If the customer wants the custom attribute returned, the model must set the custom attribute to be included on the way back. The code in your model is responsible for setting or updating any custom attributes in the response. If your code does not set this value in the response, an empty value is returned. For example, if a custom attribute represents the trace ID, your model can prepend the custom attribute with Trace ID: in your post-processing function. This feature is currently supported in the Amazon Web Services SDKs but not in the Amazon SageMaker Python SDK.
156
+ """
157
+
158
+ body: ResponseStream
159
+ content_type: Optional[str] = Unassigned()
160
+ invoked_production_variant: Optional[str] = Unassigned()
161
+ custom_attributes: Optional[str] = Unassigned()
162
+
163
+
164
+ class ModelError(Base):
165
+ """
166
+ ModelError
167
+ Model (owned by the customer in the container) returned 4xx or 5xx error code.
168
+
169
+ Attributes
170
+ ----------------------
171
+ message
172
+ original_status_code: Original status code.
173
+ original_message: Original message.
174
+ log_stream_arn: The Amazon Resource Name (ARN) of the log stream.
175
+ """
176
+
177
+ message: Optional[str] = Unassigned()
178
+ original_status_code: Optional[int] = Unassigned()
179
+ original_message: Optional[str] = Unassigned()
180
+ log_stream_arn: Optional[str] = Unassigned()
181
+
182
+
183
+ class ModelNotReadyException(Base):
184
+ """
185
+ ModelNotReadyException
186
+ Either a serverless endpoint variant's resources are still being provisioned, or a multi-model endpoint is still downloading or loading the target model. Wait and try your request again.
187
+
188
+ Attributes
189
+ ----------------------
190
+ message
191
+ """
192
+
193
+ message: Optional[str] = Unassigned()
194
+
195
+
196
+ class ServiceUnavailable(Base):
197
+ """
198
+ ServiceUnavailable
199
+ The service is currently unavailable.
200
+
201
+ Attributes
202
+ ----------------------
203
+ message
204
+ """
205
+
206
+ message: Optional[str] = Unassigned()
207
+
208
+
209
+ class ValidationError(Base):
210
+ """
211
+ ValidationError
212
+ There was an error validating your request.
213
+
214
+ Attributes
215
+ ----------------------
216
+ message
217
+ """
218
+
219
+ message: Optional[str] = Unassigned()
220
+
221
+
222
+ class AccessForbidden(Base):
223
+ """
224
+ AccessForbidden
225
+ You do not have permission to perform an action.
226
+
227
+ Attributes
228
+ ----------------------
229
+ message
230
+ """
231
+
232
+ message: Optional[str] = Unassigned()
233
+
234
+
235
+ class BatchGetRecordError(Base):
236
+ """
237
+ BatchGetRecordError
238
+ The error that has occurred when attempting to retrieve a batch of Records.
239
+
240
+ Attributes
241
+ ----------------------
242
+ feature_group_name: The name of the feature group that the record belongs to.
243
+ record_identifier_value_as_string: The value for the RecordIdentifier in string format of a Record from a FeatureGroup that is causing an error when attempting to be retrieved.
244
+ error_code: The error code of an error that has occurred when attempting to retrieve a batch of Records. For more information on errors, see Errors.
245
+ error_message: The error message of an error that has occurred when attempting to retrieve a record in the batch.
246
+ """
247
+
248
+ feature_group_name: Union[str, object]
249
+ record_identifier_value_as_string: str
250
+ error_code: str
251
+ error_message: str
252
+
253
+
254
+ class BatchGetRecordIdentifier(Base):
255
+ """
256
+ BatchGetRecordIdentifier
257
+ The identifier that identifies the batch of Records you are retrieving in a batch.
258
+
259
+ Attributes
260
+ ----------------------
261
+ feature_group_name: The name or Amazon Resource Name (ARN) of the FeatureGroup containing the records you are retrieving in a batch.
262
+ record_identifiers_value_as_string: The value for a list of record identifiers in string format.
263
+ feature_names: List of names of Features to be retrieved. If not specified, the latest value for all the Features are returned.
264
+ """
265
+
266
+ feature_group_name: Union[str, object]
267
+ record_identifiers_value_as_string: List[str]
268
+ feature_names: Optional[List[str]] = Unassigned()
269
+
270
+
271
+ class FeatureValue(Base):
272
+ """
273
+ FeatureValue
274
+ The value associated with a feature.
275
+
276
+ Attributes
277
+ ----------------------
278
+ feature_name: The name of a feature that a feature value corresponds to.
279
+ value_as_string: The value in string format associated with a feature. Used when your CollectionType is None. Note that features types can be String, Integral, or Fractional. This value represents all three types as a string.
280
+ value_as_string_list: The list of values in string format associated with a feature. Used when your CollectionType is a List, Set, or Vector. Note that features types can be String, Integral, or Fractional. These values represents all three types as a string.
281
+ """
282
+
283
+ feature_name: str
284
+ value_as_string: Optional[str] = Unassigned()
285
+ value_as_string_list: Optional[List[str]] = Unassigned()
286
+
287
+
288
+ class BatchGetRecordResultDetail(Base):
289
+ """
290
+ BatchGetRecordResultDetail
291
+ The output of records that have been retrieved in a batch.
292
+
293
+ Attributes
294
+ ----------------------
295
+ feature_group_name: The FeatureGroupName containing Records you retrieved in a batch.
296
+ record_identifier_value_as_string: The value of the record identifier in string format.
297
+ record: The Record retrieved.
298
+ expires_at: The ExpiresAt ISO string of the requested record.
299
+ """
300
+
301
+ feature_group_name: Union[str, object]
302
+ record_identifier_value_as_string: str
303
+ record: List[FeatureValue]
304
+ expires_at: Optional[str] = Unassigned()
305
+
306
+
307
+ class BatchGetRecordResponse(Base):
308
+ """
309
+ BatchGetRecordResponse
310
+
311
+ Attributes
312
+ ----------------------
313
+ records: A list of Records you requested to be retrieved in batch.
314
+ errors: A list of errors that have occurred when retrieving a batch of Records.
315
+ unprocessed_identifiers: A unprocessed list of FeatureGroup names, with their corresponding RecordIdentifier value, and Feature name.
316
+ """
317
+
318
+ records: List[BatchGetRecordResultDetail]
319
+ errors: List[BatchGetRecordError]
320
+ unprocessed_identifiers: List[BatchGetRecordIdentifier]
321
+
322
+
323
+ class GetRecordResponse(Base):
324
+ """
325
+ GetRecordResponse
326
+
327
+ Attributes
328
+ ----------------------
329
+ record: The record you requested. A list of FeatureValues.
330
+ expires_at: The ExpiresAt ISO string of the requested record.
331
+ """
332
+
333
+ record: Optional[List[FeatureValue]] = Unassigned()
334
+ expires_at: Optional[str] = Unassigned()
335
+
336
+
337
+ class TtlDuration(Base):
338
+ """
339
+ TtlDuration
340
+ Time to live duration, where the record is hard deleted after the expiration time is reached; ExpiresAt = EventTime + TtlDuration. For information on HardDelete, see the DeleteRecord API in the Amazon SageMaker API Reference guide.
341
+
342
+ Attributes
343
+ ----------------------
344
+ unit: TtlDuration time unit.
345
+ value: TtlDuration time value.
346
+ """
347
+
348
+ unit: Optional[str] = Unassigned()
349
+ value: Optional[int] = Unassigned()
350
+
351
+
352
+ class ResourceNotFound(Base):
353
+ """
354
+ ResourceNotFound
355
+ Resource being access is not found.
356
+
357
+ Attributes
358
+ ----------------------
359
+ message
360
+ """
361
+
362
+ message: Optional[str] = Unassigned()
363
+
364
+
365
+ class BatchPutMetricsError(Base):
366
+ """
367
+ BatchPutMetricsError
368
+ An error that occured when putting the metric data.
369
+
370
+ Attributes
371
+ ----------------------
372
+ code: The error code of an error that occured when attempting to put metrics. METRIC_LIMIT_EXCEEDED: The maximum amount of metrics per resource is exceeded. INTERNAL_ERROR: An internal error occured. VALIDATION_ERROR: The metric data failed validation. CONFLICT_ERROR: Multiple requests attempted to modify the same data simultaneously.
373
+ metric_index: An index that corresponds to the metric in the request.
374
+ """
375
+
376
+ code: Optional[str] = Unassigned()
377
+ metric_index: Optional[int] = Unassigned()
378
+
379
+
380
+ class RawMetricData(Base):
381
+ """
382
+ RawMetricData
383
+ The raw metric data to associate with the resource.
384
+
385
+ Attributes
386
+ ----------------------
387
+ metric_name: The name of the metric.
388
+ timestamp: The time that the metric was recorded.
389
+ step: The metric step (epoch).
390
+ value: The metric value.
391
+ """
392
+
393
+ metric_name: str
394
+ timestamp: datetime.datetime
395
+ value: float
396
+ step: Optional[int] = Unassigned()
397
+
398
+
24
399
  class ActionSource(Base):
25
400
  """
26
401
  ActionSource
@@ -4298,21 +4673,6 @@ class OnlineStoreSecurityConfig(Base):
4298
4673
  kms_key_id: Optional[str] = Unassigned()
4299
4674
 
4300
4675
 
4301
- class TtlDuration(Base):
4302
- """
4303
- TtlDuration
4304
- Time to live duration, where the record is hard deleted after the expiration time is reached; ExpiresAt = EventTime + TtlDuration. For information on HardDelete, see the DeleteRecord API in the Amazon SageMaker API Reference guide.
4305
-
4306
- Attributes
4307
- ----------------------
4308
- unit: TtlDuration time unit.
4309
- value: TtlDuration time value.
4310
- """
4311
-
4312
- unit: Optional[str] = Unassigned()
4313
- value: Optional[int] = Unassigned()
4314
-
4315
-
4316
4676
  class OnlineStoreConfig(Base):
4317
4677
  """
4318
4678
  OnlineStoreConfig
@@ -11258,19 +11618,6 @@ class ResourceLimitExceeded(Base):
11258
11618
  message: Optional[str] = Unassigned()
11259
11619
 
11260
11620
 
11261
- class ResourceNotFound(Base):
11262
- """
11263
- ResourceNotFound
11264
- Resource being access is not found.
11265
-
11266
- Attributes
11267
- ----------------------
11268
- message
11269
- """
11270
-
11271
- message: Optional[str] = Unassigned()
11272
-
11273
-
11274
11621
  class SearchExpression(Base):
11275
11622
  """
11276
11623
  SearchExpression
@@ -11604,145 +11951,3 @@ class VariantProperty(Base):
11604
11951
  """
11605
11952
 
11606
11953
  variant_property_type: str
11607
-
11608
-
11609
- class InternalDependencyException(Base):
11610
- """
11611
- InternalDependencyException
11612
- Your request caused an exception with an internal dependency. Contact customer support.
11613
-
11614
- Attributes
11615
- ----------------------
11616
- message
11617
- """
11618
-
11619
- message: Optional[str] = Unassigned()
11620
-
11621
-
11622
- class InternalFailure(Base):
11623
- """
11624
- InternalFailure
11625
- An internal failure occurred.
11626
-
11627
- Attributes
11628
- ----------------------
11629
- message
11630
- """
11631
-
11632
- message: Optional[str] = Unassigned()
11633
-
11634
-
11635
- class InternalStreamFailure(Base):
11636
- """
11637
- InternalStreamFailure
11638
- The stream processing failed because of an unknown error, exception or failure. Try your request again.
11639
-
11640
- Attributes
11641
- ----------------------
11642
- message
11643
- """
11644
-
11645
- message: Optional[str] = Unassigned()
11646
-
11647
-
11648
- class PayloadPart(Base):
11649
- """
11650
- PayloadPart
11651
- A wrapper for pieces of the payload that's returned in response to a streaming inference request. A streaming inference response consists of one or more payload parts.
11652
-
11653
- Attributes
11654
- ----------------------
11655
- bytes: A blob that contains part of the response for your streaming inference request.
11656
- """
11657
-
11658
- bytes: Optional[Any] = Unassigned()
11659
-
11660
-
11661
- class ModelStreamError(Base):
11662
- """
11663
- ModelStreamError
11664
- An error occurred while streaming the response body. This error can have the following error codes: ModelInvocationTimeExceeded The model failed to finish sending the response within the timeout period allowed by Amazon SageMaker. StreamBroken The Transmission Control Protocol (TCP) connection between the client and the model was reset or closed.
11665
-
11666
- Attributes
11667
- ----------------------
11668
- message
11669
- error_code: This error can have the following error codes: ModelInvocationTimeExceeded The model failed to finish sending the response within the timeout period allowed by Amazon SageMaker. StreamBroken The Transmission Control Protocol (TCP) connection between the client and the model was reset or closed.
11670
- """
11671
-
11672
- message: Optional[str] = Unassigned()
11673
- error_code: Optional[str] = Unassigned()
11674
-
11675
-
11676
- class ResponseStream(Base):
11677
- """
11678
- ResponseStream
11679
- A stream of payload parts. Each part contains a portion of the response for a streaming inference request.
11680
-
11681
- Attributes
11682
- ----------------------
11683
- payload_part: A wrapper for pieces of the payload that's returned in response to a streaming inference request. A streaming inference response consists of one or more payload parts.
11684
- model_stream_error: An error occurred while streaming the response body. This error can have the following error codes: ModelInvocationTimeExceeded The model failed to finish sending the response within the timeout period allowed by Amazon SageMaker. StreamBroken The Transmission Control Protocol (TCP) connection between the client and the model was reset or closed.
11685
- internal_stream_failure: The stream processing failed because of an unknown error, exception or failure. Try your request again.
11686
- """
11687
-
11688
- payload_part: Optional[PayloadPart] = Unassigned()
11689
- model_stream_error: Optional[ModelStreamError] = Unassigned()
11690
- internal_stream_failure: Optional[InternalStreamFailure] = Unassigned()
11691
-
11692
-
11693
- class ModelError(Base):
11694
- """
11695
- ModelError
11696
- Model (owned by the customer in the container) returned 4xx or 5xx error code.
11697
-
11698
- Attributes
11699
- ----------------------
11700
- message
11701
- original_status_code: Original status code.
11702
- original_message: Original message.
11703
- log_stream_arn: The Amazon Resource Name (ARN) of the log stream.
11704
- """
11705
-
11706
- message: Optional[str] = Unassigned()
11707
- original_status_code: Optional[int] = Unassigned()
11708
- original_message: Optional[str] = Unassigned()
11709
- log_stream_arn: Optional[str] = Unassigned()
11710
-
11711
-
11712
- class ModelNotReadyException(Base):
11713
- """
11714
- ModelNotReadyException
11715
- Either a serverless endpoint variant's resources are still being provisioned, or a multi-model endpoint is still downloading or loading the target model. Wait and try your request again.
11716
-
11717
- Attributes
11718
- ----------------------
11719
- message
11720
- """
11721
-
11722
- message: Optional[str] = Unassigned()
11723
-
11724
-
11725
- class ServiceUnavailable(Base):
11726
- """
11727
- ServiceUnavailable
11728
- The service is unavailable. Try your call again.
11729
-
11730
- Attributes
11731
- ----------------------
11732
- message
11733
- """
11734
-
11735
- message: Optional[str] = Unassigned()
11736
-
11737
-
11738
- class ValidationError(Base):
11739
- """
11740
- ValidationError
11741
- Inspect your request and try again.
11742
-
11743
- Attributes
11744
- ----------------------
11745
- message
11746
- """
11747
-
11748
- message: Optional[str] = Unassigned()
@@ -320,7 +320,6 @@ class SageMakerClient(metaclass=SingletonMeta):
320
320
  self,
321
321
  session: Session = None,
322
322
  region_name: str = None,
323
- service_name="sagemaker",
324
323
  config: Config = None,
325
324
  ):
326
325
  """
@@ -329,7 +328,7 @@ class SageMakerClient(metaclass=SingletonMeta):
329
328
  """
330
329
  if session is None:
331
330
  logger.warning("No boto3 session provided. Creating a new session.")
332
- session = Session()
331
+ session = Session(region_name=region_name)
333
332
 
334
333
  if region_name is None:
335
334
  logger.warning("No region provided. Using default region.")
@@ -342,43 +341,29 @@ class SageMakerClient(metaclass=SingletonMeta):
342
341
  self.config = Config(user_agent_extra=get_user_agent_extra_suffix())
343
342
  self.session = session
344
343
  self.region_name = region_name
345
- self.service_name = service_name
346
- self.client = session.client(service_name, region_name, config=self.config)
347
-
348
-
349
- class SageMakerRuntimeClient(metaclass=SingletonMeta):
350
- """
351
- A singleton class for creating a SageMaker client.
352
- """
353
-
354
- def __init__(
355
- self,
356
- session: Session = None,
357
- region_name: str = None,
358
- service_name="sagemaker-runtime",
359
- config: Config = None,
360
- ):
361
- """
362
- Initializes the SageMakerClient with a boto3 session, region name, and service name.
363
- Creates a boto3 client using the provided session, region, and service.
344
+ self.sagemaker_client = session.client("sagemaker", region_name, config=self.config)
345
+ self.sagemaker_runtime_client = session.client(
346
+ "sagemaker-runtime", region_name, config=self.config
347
+ )
348
+ self.sagemaker_featurestore_runtime_client = session.client(
349
+ "sagemaker-featurestore-runtime", region_name, config=self.config
350
+ )
351
+ self.sagemaker_metrics_client = session.client(
352
+ "sagemaker-metrics", region_name, config=self.config
353
+ )
354
+
355
+ def get_client(self, service_name: str) -> Any:
364
356
  """
365
- if session is None:
366
- logger.warning("No boto3 session provided. Creating a new session.")
367
- session = Session()
357
+ Get the client of corresponding service
368
358
 
369
- if region_name is None:
370
- logger.warning("No region provided. Using default region.")
371
- region_name = session.region_name
372
-
373
- if config is None:
374
- logger.warning("No config provided. Using default config.")
375
- config = Config(retries={"max_attempts": 10, "mode": "standard"})
359
+ Args:
360
+ service_name (str): the service name
376
361
 
377
- self.config = Config(user_agent_extra=get_user_agent_extra_suffix())
378
- self.session = session
379
- self.region_name = region_name
380
- self.service_name = service_name
381
- self.client = session.client(service_name, region_name, config=self.config)
362
+ Returns:
363
+ Any: the client of that service
364
+ """
365
+ service_name = service_name.replace("-", "_")
366
+ return getattr(self, service_name + "_client")
382
367
 
383
368
 
384
369
  class ResourceIterator(Generic[T]):
@@ -488,7 +473,7 @@ def serialize(value: Any) -> Any:
488
473
  Returns:
489
474
  Any: The serialized object
490
475
  """
491
- if isinstance(value, Unassigned):
476
+ if value is None or isinstance(value, Unassigned):
492
477
  return None
493
478
  elif isinstance(value, Dict):
494
479
  # if the value is a dict, use _serialize_dict() to serialize it recursively
@@ -79,6 +79,10 @@ ADDITIONAL_OPERATION_FILE_PATH = (
79
79
  )
80
80
  SERVICE_JSON_FILE_PATH = os.getcwd() + "/sample/sagemaker/2017-07-24/service-2.json"
81
81
  RUNTIME_SERVICE_JSON_FILE_PATH = os.getcwd() + "/sample/sagemaker-runtime/2017-05-13/service-2.json"
82
+ FEATURE_STORE_SERVICE_JSON_FILE_PATH = (
83
+ os.getcwd() + "/sample/sagemaker-featurestore-runtime/2020-07-01/service-2.json"
84
+ )
85
+ METRICS_SERVICE_JSON_FILE_PATH = os.getcwd() + "/sample/sagemaker-metrics/2022-09-30/service-2.json"
82
86
 
83
87
  GENERATED_CLASSES_LOCATION = os.getcwd() + "/src/sagemaker_core/main"
84
88
  UTILS_CODEGEN_FILE_NAME = "utils.py"