aws-sdk-sagemakerinferencerouterruntime 1.0.0

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.
@@ -0,0 +1,189 @@
1
+ # frozen_string_literal: true
2
+
3
+ # WARNING ABOUT GENERATED CODE
4
+ #
5
+ # This file is generated. See the contributing guide for more information:
6
+ # https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
7
+ #
8
+ # WARNING ABOUT GENERATED CODE
9
+
10
+
11
+ module Aws::SageMakerInferenceRouterRuntime
12
+ # @api private
13
+ module ClientApi
14
+
15
+ include Seahorse::Model
16
+
17
+ AccessDeniedException = Shapes::StructureShape.new(name: 'AccessDeniedException')
18
+ AccessDeniedExceptionMessageString = Shapes::StringShape.new(name: 'AccessDeniedExceptionMessageString')
19
+ CustomAttributesHeader = Shapes::StringShape.new(name: 'CustomAttributesHeader')
20
+ InferenceRouterBodyBlob = Shapes::BlobShape.new(name: 'InferenceRouterBodyBlob')
21
+ Integer = Shapes::IntegerShape.new(name: 'Integer')
22
+ InternalDependencyException = Shapes::StructureShape.new(name: 'InternalDependencyException')
23
+ InternalDependencyExceptionMessageString = Shapes::StringShape.new(name: 'InternalDependencyExceptionMessageString')
24
+ InternalFailure = Shapes::StructureShape.new(name: 'InternalFailure')
25
+ InternalFailureMessageString = Shapes::StringShape.new(name: 'InternalFailureMessageString')
26
+ InvokeInferenceRouterAsyncInput = Shapes::StructureShape.new(name: 'InvokeInferenceRouterAsyncInput')
27
+ InvokeInferenceRouterAsyncInputAcceptString = Shapes::StringShape.new(name: 'InvokeInferenceRouterAsyncInputAcceptString')
28
+ InvokeInferenceRouterAsyncInputContentTypeString = Shapes::StringShape.new(name: 'InvokeInferenceRouterAsyncInputContentTypeString')
29
+ InvokeInferenceRouterAsyncInputFilenameString = Shapes::StringShape.new(name: 'InvokeInferenceRouterAsyncInputFilenameString')
30
+ InvokeInferenceRouterAsyncInputInferenceIdString = Shapes::StringShape.new(name: 'InvokeInferenceRouterAsyncInputInferenceIdString')
31
+ InvokeInferenceRouterAsyncInputInferenceRouterNameString = Shapes::StringShape.new(name: 'InvokeInferenceRouterAsyncInputInferenceRouterNameString')
32
+ InvokeInferenceRouterAsyncInputInputLocationString = Shapes::StringShape.new(name: 'InvokeInferenceRouterAsyncInputInputLocationString')
33
+ InvokeInferenceRouterAsyncInputInvocationTimeoutSecondsInteger = Shapes::IntegerShape.new(name: 'InvokeInferenceRouterAsyncInputInvocationTimeoutSecondsInteger')
34
+ InvokeInferenceRouterAsyncInputRequestTTLSecondsInteger = Shapes::IntegerShape.new(name: 'InvokeInferenceRouterAsyncInputRequestTTLSecondsInteger')
35
+ InvokeInferenceRouterAsyncInputRoutingTargetNameString = Shapes::StringShape.new(name: 'InvokeInferenceRouterAsyncInputRoutingTargetNameString')
36
+ InvokeInferenceRouterAsyncInputS3OutputPathExtensionString = Shapes::StringShape.new(name: 'InvokeInferenceRouterAsyncInputS3OutputPathExtensionString')
37
+ InvokeInferenceRouterAsyncOutput = Shapes::StructureShape.new(name: 'InvokeInferenceRouterAsyncOutput')
38
+ InvokeInferenceRouterAsyncOutputFailureLocationString = Shapes::StringShape.new(name: 'InvokeInferenceRouterAsyncOutputFailureLocationString')
39
+ InvokeInferenceRouterAsyncOutputInferenceIdString = Shapes::StringShape.new(name: 'InvokeInferenceRouterAsyncOutputInferenceIdString')
40
+ InvokeInferenceRouterAsyncOutputOutputLocationString = Shapes::StringShape.new(name: 'InvokeInferenceRouterAsyncOutputOutputLocationString')
41
+ InvokeInferenceRouterInput = Shapes::StructureShape.new(name: 'InvokeInferenceRouterInput')
42
+ InvokeInferenceRouterInputAcceptString = Shapes::StringShape.new(name: 'InvokeInferenceRouterInputAcceptString')
43
+ InvokeInferenceRouterInputContentTypeString = Shapes::StringShape.new(name: 'InvokeInferenceRouterInputContentTypeString')
44
+ InvokeInferenceRouterInputInferenceIdString = Shapes::StringShape.new(name: 'InvokeInferenceRouterInputInferenceIdString')
45
+ InvokeInferenceRouterInputInferenceRouterNameString = Shapes::StringShape.new(name: 'InvokeInferenceRouterInputInferenceRouterNameString')
46
+ InvokeInferenceRouterInputPrefixAwareIdString = Shapes::StringShape.new(name: 'InvokeInferenceRouterInputPrefixAwareIdString')
47
+ InvokeInferenceRouterInputRoutingTargetNameString = Shapes::StringShape.new(name: 'InvokeInferenceRouterInputRoutingTargetNameString')
48
+ InvokeInferenceRouterOutput = Shapes::StructureShape.new(name: 'InvokeInferenceRouterOutput')
49
+ InvokeInferenceRouterOutputContentTypeString = Shapes::StringShape.new(name: 'InvokeInferenceRouterOutputContentTypeString')
50
+ InvokeInferenceRouterOutputInvokedProductionVariantString = Shapes::StringShape.new(name: 'InvokeInferenceRouterOutputInvokedProductionVariantString')
51
+ InvokeInferenceRouterOutputInvokedRoutedResourceArnString = Shapes::StringShape.new(name: 'InvokeInferenceRouterOutputInvokedRoutedResourceArnString')
52
+ InvokeInferenceRouterOutputRoutingReasonString = Shapes::StringShape.new(name: 'InvokeInferenceRouterOutputRoutingReasonString')
53
+ ModelError = Shapes::StructureShape.new(name: 'ModelError')
54
+ ModelErrorMessageString = Shapes::StringShape.new(name: 'ModelErrorMessageString')
55
+ ModelNotReadyException = Shapes::StructureShape.new(name: 'ModelNotReadyException')
56
+ ModelNotReadyExceptionMessageString = Shapes::StringShape.new(name: 'ModelNotReadyExceptionMessageString')
57
+ RequestTimeoutException = Shapes::StructureShape.new(name: 'RequestTimeoutException')
58
+ RequestTimeoutExceptionMessageString = Shapes::StringShape.new(name: 'RequestTimeoutExceptionMessageString')
59
+ ServiceUnavailableException = Shapes::StructureShape.new(name: 'ServiceUnavailableException')
60
+ ServiceUnavailableExceptionMessageString = Shapes::StringShape.new(name: 'ServiceUnavailableExceptionMessageString')
61
+ String = Shapes::StringShape.new(name: 'String')
62
+ ThrottlingException = Shapes::StructureShape.new(name: 'ThrottlingException')
63
+ ThrottlingExceptionMessageString = Shapes::StringShape.new(name: 'ThrottlingExceptionMessageString')
64
+ ValidationException = Shapes::StructureShape.new(name: 'ValidationException')
65
+ ValidationExceptionMessageString = Shapes::StringShape.new(name: 'ValidationExceptionMessageString')
66
+
67
+ AccessDeniedException.add_member(:message, Shapes::ShapeRef.new(shape: AccessDeniedExceptionMessageString, location_name: "Message"))
68
+ AccessDeniedException.struct_class = Types::AccessDeniedException
69
+
70
+ InternalDependencyException.add_member(:message, Shapes::ShapeRef.new(shape: InternalDependencyExceptionMessageString, location_name: "Message"))
71
+ InternalDependencyException.struct_class = Types::InternalDependencyException
72
+
73
+ InternalFailure.add_member(:message, Shapes::ShapeRef.new(shape: InternalFailureMessageString, location_name: "Message"))
74
+ InternalFailure.struct_class = Types::InternalFailure
75
+
76
+ InvokeInferenceRouterAsyncInput.add_member(:inference_router_name, Shapes::ShapeRef.new(shape: InvokeInferenceRouterAsyncInputInferenceRouterNameString, required: true, location: "uri", location_name: "InferenceRouterName"))
77
+ InvokeInferenceRouterAsyncInput.add_member(:routing_target_name, Shapes::ShapeRef.new(shape: InvokeInferenceRouterAsyncInputRoutingTargetNameString, required: true, location: "header", location_name: "X-Amzn-SageMaker-Routing-Target-Name"))
78
+ InvokeInferenceRouterAsyncInput.add_member(:content_type, Shapes::ShapeRef.new(shape: InvokeInferenceRouterAsyncInputContentTypeString, location: "header", location_name: "X-Amzn-SageMaker-Content-Type"))
79
+ InvokeInferenceRouterAsyncInput.add_member(:accept, Shapes::ShapeRef.new(shape: InvokeInferenceRouterAsyncInputAcceptString, location: "header", location_name: "X-Amzn-SageMaker-Accept"))
80
+ InvokeInferenceRouterAsyncInput.add_member(:custom_attributes, Shapes::ShapeRef.new(shape: CustomAttributesHeader, location: "header", location_name: "X-Amzn-SageMaker-Custom-Attributes"))
81
+ InvokeInferenceRouterAsyncInput.add_member(:inference_id, Shapes::ShapeRef.new(shape: InvokeInferenceRouterAsyncInputInferenceIdString, location: "header", location_name: "X-Amzn-SageMaker-Inference-Id"))
82
+ InvokeInferenceRouterAsyncInput.add_member(:input_location, Shapes::ShapeRef.new(shape: InvokeInferenceRouterAsyncInputInputLocationString, required: true, location: "header", location_name: "X-Amzn-SageMaker-InputLocation"))
83
+ InvokeInferenceRouterAsyncInput.add_member(:s3_output_path_extension, Shapes::ShapeRef.new(shape: InvokeInferenceRouterAsyncInputS3OutputPathExtensionString, location: "header", location_name: "X-Amzn-SageMaker-S3OutputPathExtension"))
84
+ InvokeInferenceRouterAsyncInput.add_member(:filename, Shapes::ShapeRef.new(shape: InvokeInferenceRouterAsyncInputFilenameString, location: "header", location_name: "X-Amzn-SageMaker-Filename"))
85
+ InvokeInferenceRouterAsyncInput.add_member(:request_ttl_seconds, Shapes::ShapeRef.new(shape: InvokeInferenceRouterAsyncInputRequestTTLSecondsInteger, location: "header", location_name: "X-Amzn-SageMaker-RequestTTLSeconds"))
86
+ InvokeInferenceRouterAsyncInput.add_member(:invocation_timeout_seconds, Shapes::ShapeRef.new(shape: InvokeInferenceRouterAsyncInputInvocationTimeoutSecondsInteger, location: "header", location_name: "X-Amzn-SageMaker-InvocationTimeoutSeconds"))
87
+ InvokeInferenceRouterAsyncInput.struct_class = Types::InvokeInferenceRouterAsyncInput
88
+
89
+ InvokeInferenceRouterAsyncOutput.add_member(:inference_id, Shapes::ShapeRef.new(shape: InvokeInferenceRouterAsyncOutputInferenceIdString, location_name: "InferenceId"))
90
+ InvokeInferenceRouterAsyncOutput.add_member(:output_location, Shapes::ShapeRef.new(shape: InvokeInferenceRouterAsyncOutputOutputLocationString, location: "header", location_name: "X-Amzn-SageMaker-OutputLocation"))
91
+ InvokeInferenceRouterAsyncOutput.add_member(:failure_location, Shapes::ShapeRef.new(shape: InvokeInferenceRouterAsyncOutputFailureLocationString, location: "header", location_name: "X-Amzn-SageMaker-FailureLocation"))
92
+ InvokeInferenceRouterAsyncOutput.struct_class = Types::InvokeInferenceRouterAsyncOutput
93
+
94
+ InvokeInferenceRouterInput.add_member(:inference_router_name, Shapes::ShapeRef.new(shape: InvokeInferenceRouterInputInferenceRouterNameString, required: true, location: "uri", location_name: "InferenceRouterName"))
95
+ InvokeInferenceRouterInput.add_member(:routing_target_name, Shapes::ShapeRef.new(shape: InvokeInferenceRouterInputRoutingTargetNameString, required: true, location: "header", location_name: "X-Amzn-SageMaker-Routing-Target-Name"))
96
+ InvokeInferenceRouterInput.add_member(:content_type, Shapes::ShapeRef.new(shape: InvokeInferenceRouterInputContentTypeString, location: "header", location_name: "Content-Type"))
97
+ InvokeInferenceRouterInput.add_member(:accept, Shapes::ShapeRef.new(shape: InvokeInferenceRouterInputAcceptString, location: "header", location_name: "Accept"))
98
+ InvokeInferenceRouterInput.add_member(:inference_id, Shapes::ShapeRef.new(shape: InvokeInferenceRouterInputInferenceIdString, location: "header", location_name: "X-Amzn-SageMaker-Inference-Id"))
99
+ InvokeInferenceRouterInput.add_member(:prefix_aware_id, Shapes::ShapeRef.new(shape: InvokeInferenceRouterInputPrefixAwareIdString, location: "header", location_name: "X-Amzn-SageMaker-Prefix-Aware-Id"))
100
+ InvokeInferenceRouterInput.add_member(:custom_attributes, Shapes::ShapeRef.new(shape: CustomAttributesHeader, location: "header", location_name: "X-Amzn-SageMaker-Custom-Attributes"))
101
+ InvokeInferenceRouterInput.add_member(:body, Shapes::ShapeRef.new(shape: InferenceRouterBodyBlob, required: true, location_name: "Body"))
102
+ InvokeInferenceRouterInput.struct_class = Types::InvokeInferenceRouterInput
103
+ InvokeInferenceRouterInput[:payload] = :body
104
+ InvokeInferenceRouterInput[:payload_member] = InvokeInferenceRouterInput.member(:body)
105
+
106
+ InvokeInferenceRouterOutput.add_member(:body, Shapes::ShapeRef.new(shape: InferenceRouterBodyBlob, location_name: "Body"))
107
+ InvokeInferenceRouterOutput.add_member(:content_type, Shapes::ShapeRef.new(shape: InvokeInferenceRouterOutputContentTypeString, location: "header", location_name: "Content-Type"))
108
+ InvokeInferenceRouterOutput.add_member(:invoked_routed_resource_arn, Shapes::ShapeRef.new(shape: InvokeInferenceRouterOutputInvokedRoutedResourceArnString, location: "header", location_name: "X-Amzn-SageMaker-Invoked-Routed-Resource-Arn"))
109
+ InvokeInferenceRouterOutput.add_member(:routing_reason, Shapes::ShapeRef.new(shape: InvokeInferenceRouterOutputRoutingReasonString, location: "header", location_name: "X-Amzn-SageMaker-Invoked-Routing-Reason"))
110
+ InvokeInferenceRouterOutput.add_member(:invoked_production_variant, Shapes::ShapeRef.new(shape: InvokeInferenceRouterOutputInvokedProductionVariantString, location: "header", location_name: "X-Amzn-Invoked-Production-Variant"))
111
+ InvokeInferenceRouterOutput.add_member(:custom_attributes, Shapes::ShapeRef.new(shape: CustomAttributesHeader, location: "header", location_name: "X-Amzn-SageMaker-Custom-Attributes"))
112
+ InvokeInferenceRouterOutput.struct_class = Types::InvokeInferenceRouterOutput
113
+ InvokeInferenceRouterOutput[:payload] = :body
114
+ InvokeInferenceRouterOutput[:payload_member] = InvokeInferenceRouterOutput.member(:body)
115
+
116
+ ModelError.add_member(:message, Shapes::ShapeRef.new(shape: ModelErrorMessageString, location_name: "Message"))
117
+ ModelError.add_member(:original_status_code, Shapes::ShapeRef.new(shape: Integer, location_name: "OriginalStatusCode"))
118
+ ModelError.add_member(:original_message, Shapes::ShapeRef.new(shape: String, location_name: "OriginalMessage"))
119
+ ModelError.add_member(:log_stream_arn, Shapes::ShapeRef.new(shape: String, location_name: "LogStreamArn"))
120
+ ModelError.struct_class = Types::ModelError
121
+
122
+ ModelNotReadyException.add_member(:message, Shapes::ShapeRef.new(shape: ModelNotReadyExceptionMessageString, location_name: "Message"))
123
+ ModelNotReadyException.struct_class = Types::ModelNotReadyException
124
+
125
+ RequestTimeoutException.add_member(:message, Shapes::ShapeRef.new(shape: RequestTimeoutExceptionMessageString, location_name: "Message"))
126
+ RequestTimeoutException.struct_class = Types::RequestTimeoutException
127
+
128
+ ServiceUnavailableException.add_member(:message, Shapes::ShapeRef.new(shape: ServiceUnavailableExceptionMessageString, location_name: "Message"))
129
+ ServiceUnavailableException.struct_class = Types::ServiceUnavailableException
130
+
131
+ ThrottlingException.add_member(:message, Shapes::ShapeRef.new(shape: ThrottlingExceptionMessageString, location_name: "Message"))
132
+ ThrottlingException.struct_class = Types::ThrottlingException
133
+
134
+ ValidationException.add_member(:message, Shapes::ShapeRef.new(shape: ValidationExceptionMessageString, location_name: "Message"))
135
+ ValidationException.struct_class = Types::ValidationException
136
+
137
+
138
+ # @api private
139
+ API = Seahorse::Model::Api.new.tap do |api|
140
+
141
+ api.version = "2026-01-01"
142
+
143
+ api.metadata = {
144
+ "apiVersion" => "2026-01-01",
145
+ "auth" => ["aws.auth#sigv4"],
146
+ "endpointPrefix" => "inferencerouter-runtime.sagemaker",
147
+ "protocol" => "rest-json",
148
+ "protocols" => ["rest-json"],
149
+ "serviceFullName" => "Amazon SageMaker Inference Router Runtime",
150
+ "serviceId" => "SageMaker Inference Router Runtime",
151
+ "signatureVersion" => "v4",
152
+ "signingName" => "sagemaker",
153
+ "uid" => "sagemaker-inference-router-runtime-2026-01-01",
154
+ }
155
+
156
+ api.add_operation(:invoke_inference_router, Seahorse::Model::Operation.new.tap do |o|
157
+ o.name = "InvokeInferenceRouter"
158
+ o.http_method = "POST"
159
+ o.http_request_uri = "/inference-routers/{InferenceRouterName}/invocations"
160
+ o.input = Shapes::ShapeRef.new(shape: InvokeInferenceRouterInput)
161
+ o.output = Shapes::ShapeRef.new(shape: InvokeInferenceRouterOutput)
162
+ o.errors << Shapes::ShapeRef.new(shape: ValidationException)
163
+ o.errors << Shapes::ShapeRef.new(shape: AccessDeniedException)
164
+ o.errors << Shapes::ShapeRef.new(shape: ServiceUnavailableException)
165
+ o.errors << Shapes::ShapeRef.new(shape: ModelError)
166
+ o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
167
+ o.errors << Shapes::ShapeRef.new(shape: RequestTimeoutException)
168
+ o.errors << Shapes::ShapeRef.new(shape: InternalDependencyException)
169
+ o.errors << Shapes::ShapeRef.new(shape: InternalFailure)
170
+ o.errors << Shapes::ShapeRef.new(shape: ModelNotReadyException)
171
+ end)
172
+
173
+ api.add_operation(:invoke_inference_router_async, Seahorse::Model::Operation.new.tap do |o|
174
+ o.name = "InvokeInferenceRouterAsync"
175
+ o.http_method = "POST"
176
+ o.http_request_uri = "/inference-routers/{InferenceRouterName}/async-invocations"
177
+ o.input = Shapes::ShapeRef.new(shape: InvokeInferenceRouterAsyncInput)
178
+ o.output = Shapes::ShapeRef.new(shape: InvokeInferenceRouterAsyncOutput)
179
+ o.errors << Shapes::ShapeRef.new(shape: ValidationException)
180
+ o.errors << Shapes::ShapeRef.new(shape: AccessDeniedException)
181
+ o.errors << Shapes::ShapeRef.new(shape: ServiceUnavailableException)
182
+ o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
183
+ o.errors << Shapes::ShapeRef.new(shape: RequestTimeoutException)
184
+ o.errors << Shapes::ShapeRef.new(shape: InternalFailure)
185
+ end)
186
+ end
187
+
188
+ end
189
+ end
@@ -0,0 +1,69 @@
1
+ # frozen_string_literal: true
2
+
3
+ # WARNING ABOUT GENERATED CODE
4
+ #
5
+ # This file is generated. See the contributing guide for more information:
6
+ # https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
7
+ #
8
+ # WARNING ABOUT GENERATED CODE
9
+
10
+ module Aws::SageMakerInferenceRouterRuntime
11
+ # Endpoint parameters used to influence endpoints per request.
12
+ #
13
+ # @!attribute use_dual_stack
14
+ # When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.
15
+ #
16
+ # @return [boolean]
17
+ #
18
+ # @!attribute use_fips
19
+ # When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.
20
+ #
21
+ # @return [boolean]
22
+ #
23
+ # @!attribute endpoint
24
+ # Override the endpoint used to send this request
25
+ #
26
+ # @return [string]
27
+ #
28
+ # @!attribute region
29
+ # The AWS region used to dispatch the request.
30
+ #
31
+ # @return [string]
32
+ #
33
+ EndpointParameters = Struct.new(
34
+ :use_dual_stack,
35
+ :use_fips,
36
+ :endpoint,
37
+ :region,
38
+ ) do
39
+ include Aws::Structure
40
+
41
+ # @api private
42
+ class << self
43
+ PARAM_MAP = {
44
+ 'UseDualStack' => :use_dual_stack,
45
+ 'UseFIPS' => :use_fips,
46
+ 'Endpoint' => :endpoint,
47
+ 'Region' => :region,
48
+ }.freeze
49
+ end
50
+
51
+ def initialize(options = {})
52
+ self[:use_dual_stack] = options[:use_dual_stack]
53
+ self[:use_dual_stack] = false if self[:use_dual_stack].nil?
54
+ self[:use_fips] = options[:use_fips]
55
+ self[:use_fips] = false if self[:use_fips].nil?
56
+ self[:endpoint] = options[:endpoint]
57
+ self[:region] = options[:region]
58
+ end
59
+
60
+ def self.create(config, options={})
61
+ new({
62
+ use_dual_stack: config.use_dualstack_endpoint,
63
+ use_fips: config.use_fips_endpoint,
64
+ endpoint: (config.endpoint.to_s unless config.regional_endpoint),
65
+ region: config.region,
66
+ }.merge(options))
67
+ end
68
+ end
69
+ end
@@ -0,0 +1,56 @@
1
+ # frozen_string_literal: true
2
+
3
+ # WARNING ABOUT GENERATED CODE
4
+ #
5
+ # This file is generated. See the contributing guide for more information:
6
+ # https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
7
+ #
8
+ # WARNING ABOUT GENERATED CODE
9
+
10
+ module Aws::SageMakerInferenceRouterRuntime
11
+ class EndpointProvider
12
+ def resolve_endpoint(parameters)
13
+ if Aws::Endpoints::Matchers.set?(parameters.endpoint)
14
+ if Aws::Endpoints::Matchers.boolean_equals?(parameters.use_fips, true)
15
+ raise ArgumentError, "Invalid Configuration: FIPS and custom endpoint are not supported"
16
+ end
17
+ if Aws::Endpoints::Matchers.boolean_equals?(parameters.use_dual_stack, true)
18
+ raise ArgumentError, "Invalid Configuration: Dualstack and custom endpoint are not supported"
19
+ end
20
+ return Aws::Endpoints::Endpoint.new(url: parameters.endpoint, headers: {}, properties: {})
21
+ end
22
+ if Aws::Endpoints::Matchers.set?(parameters.region)
23
+ if (partition_result = Aws::Endpoints::Matchers.aws_partition(parameters.region))
24
+ if Aws::Endpoints::Matchers.string_equals?(Aws::Endpoints::Matchers.attr(partition_result, "name"), "aws") && Aws::Endpoints::Matchers.boolean_equals?(parameters.use_fips, false) && Aws::Endpoints::Matchers.boolean_equals?(parameters.use_dual_stack, false)
25
+ return Aws::Endpoints::Endpoint.new(url: "https://inferencerouter-runtime.sagemaker.#{parameters.region}.#{partition_result['dnsSuffix']}", headers: {}, properties: {})
26
+ end
27
+ if Aws::Endpoints::Matchers.string_equals?(Aws::Endpoints::Matchers.attr(partition_result, "name"), "aws") && Aws::Endpoints::Matchers.boolean_equals?(parameters.use_fips, false) && Aws::Endpoints::Matchers.boolean_equals?(parameters.use_dual_stack, true)
28
+ return Aws::Endpoints::Endpoint.new(url: "https://inferencerouter-runtime.sagemaker.#{parameters.region}.#{partition_result['dualStackDnsSuffix']}", headers: {}, properties: {})
29
+ end
30
+ if Aws::Endpoints::Matchers.boolean_equals?(parameters.use_fips, true) && Aws::Endpoints::Matchers.boolean_equals?(parameters.use_dual_stack, true)
31
+ if Aws::Endpoints::Matchers.boolean_equals?(true, Aws::Endpoints::Matchers.attr(partition_result, "supportsFIPS")) && Aws::Endpoints::Matchers.boolean_equals?(true, Aws::Endpoints::Matchers.attr(partition_result, "supportsDualStack"))
32
+ return Aws::Endpoints::Endpoint.new(url: "https://inferencerouter-runtime.sagemaker-fips.#{parameters.region}.#{partition_result['dualStackDnsSuffix']}", headers: {}, properties: {})
33
+ end
34
+ raise ArgumentError, "FIPS and DualStack are enabled, but this partition does not support one or both"
35
+ end
36
+ if Aws::Endpoints::Matchers.boolean_equals?(parameters.use_fips, true) && Aws::Endpoints::Matchers.boolean_equals?(parameters.use_dual_stack, false)
37
+ if Aws::Endpoints::Matchers.boolean_equals?(Aws::Endpoints::Matchers.attr(partition_result, "supportsFIPS"), true)
38
+ return Aws::Endpoints::Endpoint.new(url: "https://inferencerouter-runtime.sagemaker-fips.#{parameters.region}.#{partition_result['dnsSuffix']}", headers: {}, properties: {})
39
+ end
40
+ raise ArgumentError, "FIPS is enabled but this partition does not support FIPS"
41
+ end
42
+ if Aws::Endpoints::Matchers.boolean_equals?(parameters.use_fips, false) && Aws::Endpoints::Matchers.boolean_equals?(parameters.use_dual_stack, true)
43
+ if Aws::Endpoints::Matchers.boolean_equals?(true, Aws::Endpoints::Matchers.attr(partition_result, "supportsDualStack"))
44
+ return Aws::Endpoints::Endpoint.new(url: "https://inferencerouter-runtime.sagemaker.#{parameters.region}.#{partition_result['dualStackDnsSuffix']}", headers: {}, properties: {})
45
+ end
46
+ raise ArgumentError, "DualStack is enabled but this partition does not support DualStack"
47
+ end
48
+ return Aws::Endpoints::Endpoint.new(url: "https://inferencerouter-runtime.sagemaker.#{parameters.region}.#{partition_result['dnsSuffix']}", headers: {}, properties: {})
49
+ end
50
+ end
51
+ raise ArgumentError, "Invalid Configuration: Missing Region"
52
+ raise ArgumentError, 'No endpoint could be resolved'
53
+
54
+ end
55
+ end
56
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ # WARNING ABOUT GENERATED CODE
4
+ #
5
+ # This file is generated. See the contributing guide for more information:
6
+ # https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
7
+ #
8
+ # WARNING ABOUT GENERATED CODE
9
+
10
+
11
+ module Aws::SageMakerInferenceRouterRuntime
12
+ # @api private
13
+ module Endpoints
14
+
15
+
16
+ def self.parameters_for_operation(context)
17
+ Aws::SageMakerInferenceRouterRuntime::EndpointParameters.create(context.config)
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,217 @@
1
+ # frozen_string_literal: true
2
+
3
+ # WARNING ABOUT GENERATED CODE
4
+ #
5
+ # This file is generated. See the contributing guide for more information:
6
+ # https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
7
+ #
8
+ # WARNING ABOUT GENERATED CODE
9
+
10
+ module Aws::SageMakerInferenceRouterRuntime
11
+
12
+ # When SageMakerInferenceRouterRuntime returns an error response, the Ruby SDK constructs and raises an error.
13
+ # These errors all extend Aws::SageMakerInferenceRouterRuntime::Errors::ServiceError < {Aws::Errors::ServiceError}
14
+ #
15
+ # You can rescue all SageMakerInferenceRouterRuntime errors using ServiceError:
16
+ #
17
+ # begin
18
+ # # do stuff
19
+ # rescue Aws::SageMakerInferenceRouterRuntime::Errors::ServiceError
20
+ # # rescues all SageMakerInferenceRouterRuntime API errors
21
+ # end
22
+ #
23
+ #
24
+ # ## Request Context
25
+ # ServiceError objects have a {Aws::Errors::ServiceError#context #context} method that returns
26
+ # information about the request that generated the error.
27
+ # See {Seahorse::Client::RequestContext} for more information.
28
+ #
29
+ # ## Error Classes
30
+ # * {AccessDeniedException}
31
+ # * {InternalDependencyException}
32
+ # * {InternalFailure}
33
+ # * {ModelError}
34
+ # * {ModelNotReadyException}
35
+ # * {RequestTimeoutException}
36
+ # * {ServiceUnavailableException}
37
+ # * {ThrottlingException}
38
+ # * {ValidationException}
39
+ #
40
+ # Additionally, error classes are dynamically generated for service errors based on the error code
41
+ # if they are not defined above.
42
+ module Errors
43
+
44
+ extend Aws::Errors::DynamicErrors
45
+
46
+ class AccessDeniedException < ServiceError
47
+
48
+ # @param [Seahorse::Client::RequestContext] context
49
+ # @param [String] message
50
+ # @param [Aws::SageMakerInferenceRouterRuntime::Types::AccessDeniedException] data
51
+ def initialize(context, message, data = Aws::EmptyStructure.new)
52
+ super(context, message, data)
53
+ end
54
+
55
+ # @return [String]
56
+ def message
57
+ @message || @data[:message]
58
+ end
59
+ end
60
+
61
+ class InternalDependencyException < ServiceError
62
+
63
+ # @param [Seahorse::Client::RequestContext] context
64
+ # @param [String] message
65
+ # @param [Aws::SageMakerInferenceRouterRuntime::Types::InternalDependencyException] data
66
+ def initialize(context, message, data = Aws::EmptyStructure.new)
67
+ super(context, message, data)
68
+ end
69
+
70
+ # @return [String]
71
+ def message
72
+ @message || @data[:message]
73
+ end
74
+ end
75
+
76
+ class InternalFailure < ServiceError
77
+
78
+ # @param [Seahorse::Client::RequestContext] context
79
+ # @param [String] message
80
+ # @param [Aws::SageMakerInferenceRouterRuntime::Types::InternalFailure] data
81
+ def initialize(context, message, data = Aws::EmptyStructure.new)
82
+ super(context, message, data)
83
+ end
84
+
85
+ # @return [String]
86
+ def message
87
+ @message || @data[:message]
88
+ end
89
+ end
90
+
91
+ class ModelError < ServiceError
92
+
93
+ # @param [Seahorse::Client::RequestContext] context
94
+ # @param [String] message
95
+ # @param [Aws::SageMakerInferenceRouterRuntime::Types::ModelError] data
96
+ def initialize(context, message, data = Aws::EmptyStructure.new)
97
+ super(context, message, data)
98
+ end
99
+
100
+ # @return [String]
101
+ def message
102
+ @message || @data[:message]
103
+ end
104
+
105
+ # @return [String]
106
+ def original_status_code
107
+ @data[:original_status_code]
108
+ end
109
+
110
+ # @return [String]
111
+ def original_message
112
+ @data[:original_message]
113
+ end
114
+
115
+ # @return [String]
116
+ def log_stream_arn
117
+ @data[:log_stream_arn]
118
+ end
119
+ end
120
+
121
+ class ModelNotReadyException < ServiceError
122
+
123
+ # @param [Seahorse::Client::RequestContext] context
124
+ # @param [String] message
125
+ # @param [Aws::SageMakerInferenceRouterRuntime::Types::ModelNotReadyException] data
126
+ def initialize(context, message, data = Aws::EmptyStructure.new)
127
+ super(context, message, data)
128
+ end
129
+
130
+ # @return [String]
131
+ def message
132
+ @message || @data[:message]
133
+ end
134
+
135
+ def retryable?
136
+ true
137
+ end
138
+
139
+ def throttling?
140
+ true
141
+ end
142
+ end
143
+
144
+ class RequestTimeoutException < ServiceError
145
+
146
+ # @param [Seahorse::Client::RequestContext] context
147
+ # @param [String] message
148
+ # @param [Aws::SageMakerInferenceRouterRuntime::Types::RequestTimeoutException] data
149
+ def initialize(context, message, data = Aws::EmptyStructure.new)
150
+ super(context, message, data)
151
+ end
152
+
153
+ # @return [String]
154
+ def message
155
+ @message || @data[:message]
156
+ end
157
+
158
+ def retryable?
159
+ true
160
+ end
161
+ end
162
+
163
+ class ServiceUnavailableException < ServiceError
164
+
165
+ # @param [Seahorse::Client::RequestContext] context
166
+ # @param [String] message
167
+ # @param [Aws::SageMakerInferenceRouterRuntime::Types::ServiceUnavailableException] data
168
+ def initialize(context, message, data = Aws::EmptyStructure.new)
169
+ super(context, message, data)
170
+ end
171
+
172
+ # @return [String]
173
+ def message
174
+ @message || @data[:message]
175
+ end
176
+ end
177
+
178
+ class ThrottlingException < ServiceError
179
+
180
+ # @param [Seahorse::Client::RequestContext] context
181
+ # @param [String] message
182
+ # @param [Aws::SageMakerInferenceRouterRuntime::Types::ThrottlingException] data
183
+ def initialize(context, message, data = Aws::EmptyStructure.new)
184
+ super(context, message, data)
185
+ end
186
+
187
+ # @return [String]
188
+ def message
189
+ @message || @data[:message]
190
+ end
191
+
192
+ def retryable?
193
+ true
194
+ end
195
+
196
+ def throttling?
197
+ true
198
+ end
199
+ end
200
+
201
+ class ValidationException < ServiceError
202
+
203
+ # @param [Seahorse::Client::RequestContext] context
204
+ # @param [String] message
205
+ # @param [Aws::SageMakerInferenceRouterRuntime::Types::ValidationException] data
206
+ def initialize(context, message, data = Aws::EmptyStructure.new)
207
+ super(context, message, data)
208
+ end
209
+
210
+ # @return [String]
211
+ def message
212
+ @message || @data[:message]
213
+ end
214
+ end
215
+
216
+ end
217
+ end
@@ -0,0 +1,77 @@
1
+ # frozen_string_literal: true
2
+
3
+ # WARNING ABOUT GENERATED CODE
4
+ #
5
+ # This file is generated. See the contributing guide for more information:
6
+ # https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
7
+ #
8
+ # WARNING ABOUT GENERATED CODE
9
+
10
+
11
+ module Aws::SageMakerInferenceRouterRuntime
12
+ module Plugins
13
+ class Endpoints < Seahorse::Client::Plugin
14
+ option(
15
+ :endpoint_provider,
16
+ doc_type: 'Aws::SageMakerInferenceRouterRuntime::EndpointProvider',
17
+ rbs_type: 'untyped',
18
+ docstring: <<~DOCS) do |_cfg|
19
+ The endpoint provider used to resolve endpoints. Any object that responds to
20
+ `#resolve_endpoint(parameters)` where `parameters` is a Struct similar to
21
+ `Aws::SageMakerInferenceRouterRuntime::EndpointParameters`.
22
+ DOCS
23
+ Aws::SageMakerInferenceRouterRuntime::EndpointProvider.new
24
+ end
25
+
26
+ # @api private
27
+ class Handler < Seahorse::Client::Handler
28
+ def call(context)
29
+ unless context[:discovered_endpoint]
30
+ params = Aws::SageMakerInferenceRouterRuntime::Endpoints.parameters_for_operation(context)
31
+ endpoint = context.config.endpoint_provider.resolve_endpoint(params)
32
+
33
+ context.http_request.endpoint = endpoint.url
34
+ apply_endpoint_headers(context, endpoint.headers)
35
+
36
+ context[:endpoint_params] = params
37
+ context[:endpoint_properties] = endpoint.properties
38
+ end
39
+
40
+ context[:auth_scheme] =
41
+ Aws::Endpoints.resolve_auth_scheme(context, endpoint)
42
+
43
+ with_metrics(context) { @handler.call(context) }
44
+ end
45
+
46
+ private
47
+
48
+ def with_metrics(context, &block)
49
+ metrics = []
50
+ metrics << 'ENDPOINT_OVERRIDE' unless context.config.regional_endpoint
51
+ if context[:auth_scheme] && context[:auth_scheme]['name'] == 'sigv4a'
52
+ metrics << 'SIGV4A_SIGNING'
53
+ end
54
+ if context.config.credentials&.credentials&.account_id
55
+ metrics << 'RESOLVED_ACCOUNT_ID'
56
+ end
57
+ Aws::Plugins::UserAgent.metric(*metrics, &block)
58
+ end
59
+
60
+ def apply_endpoint_headers(context, headers)
61
+ headers.each do |key, values|
62
+ value = values
63
+ .compact
64
+ .map { |s| Seahorse::Util.escape_header_list_string(s.to_s) }
65
+ .join(',')
66
+
67
+ context.http_request.headers[key] = value
68
+ end
69
+ end
70
+ end
71
+
72
+ def add_handlers(handlers, _config)
73
+ handlers.add(Handler, step: :build, priority: 75)
74
+ end
75
+ end
76
+ end
77
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ # WARNING ABOUT GENERATED CODE
4
+ #
5
+ # This file is generated. See the contributing guide for more information:
6
+ # https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
7
+ #
8
+ # WARNING ABOUT GENERATED CODE
9
+
10
+ module Aws::SageMakerInferenceRouterRuntime
11
+
12
+ class Resource
13
+
14
+ # @param options ({})
15
+ # @option options [Client] :client
16
+ def initialize(options = {})
17
+ @client = options[:client] || Client.new(options)
18
+ end
19
+
20
+ # @return [Client]
21
+ def client
22
+ @client
23
+ end
24
+
25
+ end
26
+ end