aws-sdk-ssmguiconnect 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,158 @@
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::SSMGuiConnect
12
+ # @api private
13
+ module ClientApi
14
+
15
+ include Seahorse::Model
16
+
17
+ AccessDeniedException = Shapes::StructureShape.new(name: 'AccessDeniedException')
18
+ AccountId = Shapes::StringShape.new(name: 'AccountId')
19
+ BucketName = Shapes::StringShape.new(name: 'BucketName')
20
+ ClientToken = Shapes::StringShape.new(name: 'ClientToken')
21
+ ConflictException = Shapes::StructureShape.new(name: 'ConflictException')
22
+ ConnectionRecordingPreferences = Shapes::StructureShape.new(name: 'ConnectionRecordingPreferences')
23
+ ConnectionRecordingPreferencesKMSKeyArnString = Shapes::StringShape.new(name: 'ConnectionRecordingPreferencesKMSKeyArnString')
24
+ DeleteConnectionRecordingPreferencesRequest = Shapes::StructureShape.new(name: 'DeleteConnectionRecordingPreferencesRequest')
25
+ DeleteConnectionRecordingPreferencesResponse = Shapes::StructureShape.new(name: 'DeleteConnectionRecordingPreferencesResponse')
26
+ ErrorMessage = Shapes::StringShape.new(name: 'ErrorMessage')
27
+ GetConnectionRecordingPreferencesResponse = Shapes::StructureShape.new(name: 'GetConnectionRecordingPreferencesResponse')
28
+ InternalServerException = Shapes::StructureShape.new(name: 'InternalServerException')
29
+ RecordingDestinations = Shapes::StructureShape.new(name: 'RecordingDestinations')
30
+ ResourceNotFoundException = Shapes::StructureShape.new(name: 'ResourceNotFoundException')
31
+ S3Bucket = Shapes::StructureShape.new(name: 'S3Bucket')
32
+ S3Buckets = Shapes::ListShape.new(name: 'S3Buckets')
33
+ ServiceQuotaExceededException = Shapes::StructureShape.new(name: 'ServiceQuotaExceededException')
34
+ ThrottlingException = Shapes::StructureShape.new(name: 'ThrottlingException')
35
+ UpdateConnectionRecordingPreferencesRequest = Shapes::StructureShape.new(name: 'UpdateConnectionRecordingPreferencesRequest')
36
+ UpdateConnectionRecordingPreferencesResponse = Shapes::StructureShape.new(name: 'UpdateConnectionRecordingPreferencesResponse')
37
+ ValidationException = Shapes::StructureShape.new(name: 'ValidationException')
38
+
39
+ AccessDeniedException.add_member(:message, Shapes::ShapeRef.new(shape: ErrorMessage, required: true, location_name: "message"))
40
+ AccessDeniedException.struct_class = Types::AccessDeniedException
41
+
42
+ ConflictException.add_member(:message, Shapes::ShapeRef.new(shape: ErrorMessage, required: true, location_name: "message"))
43
+ ConflictException.struct_class = Types::ConflictException
44
+
45
+ ConnectionRecordingPreferences.add_member(:kms_key_arn, Shapes::ShapeRef.new(shape: ConnectionRecordingPreferencesKMSKeyArnString, required: true, location_name: "KMSKeyArn"))
46
+ ConnectionRecordingPreferences.add_member(:recording_destinations, Shapes::ShapeRef.new(shape: RecordingDestinations, required: true, location_name: "RecordingDestinations"))
47
+ ConnectionRecordingPreferences.struct_class = Types::ConnectionRecordingPreferences
48
+
49
+ DeleteConnectionRecordingPreferencesRequest.add_member(:client_token, Shapes::ShapeRef.new(shape: ClientToken, location_name: "ClientToken", metadata: {"idempotencyToken"=>true}))
50
+ DeleteConnectionRecordingPreferencesRequest.struct_class = Types::DeleteConnectionRecordingPreferencesRequest
51
+
52
+ DeleteConnectionRecordingPreferencesResponse.add_member(:client_token, Shapes::ShapeRef.new(shape: ClientToken, location_name: "ClientToken"))
53
+ DeleteConnectionRecordingPreferencesResponse.struct_class = Types::DeleteConnectionRecordingPreferencesResponse
54
+
55
+ GetConnectionRecordingPreferencesResponse.add_member(:client_token, Shapes::ShapeRef.new(shape: ClientToken, location_name: "ClientToken"))
56
+ GetConnectionRecordingPreferencesResponse.add_member(:connection_recording_preferences, Shapes::ShapeRef.new(shape: ConnectionRecordingPreferences, location_name: "ConnectionRecordingPreferences"))
57
+ GetConnectionRecordingPreferencesResponse.struct_class = Types::GetConnectionRecordingPreferencesResponse
58
+
59
+ InternalServerException.add_member(:message, Shapes::ShapeRef.new(shape: ErrorMessage, required: true, location_name: "message"))
60
+ InternalServerException.struct_class = Types::InternalServerException
61
+
62
+ RecordingDestinations.add_member(:s3_buckets, Shapes::ShapeRef.new(shape: S3Buckets, required: true, location_name: "S3Buckets"))
63
+ RecordingDestinations.struct_class = Types::RecordingDestinations
64
+
65
+ ResourceNotFoundException.add_member(:message, Shapes::ShapeRef.new(shape: ErrorMessage, required: true, location_name: "message"))
66
+ ResourceNotFoundException.struct_class = Types::ResourceNotFoundException
67
+
68
+ S3Bucket.add_member(:bucket_name, Shapes::ShapeRef.new(shape: BucketName, required: true, location_name: "BucketName"))
69
+ S3Bucket.add_member(:bucket_owner, Shapes::ShapeRef.new(shape: AccountId, required: true, location_name: "BucketOwner"))
70
+ S3Bucket.struct_class = Types::S3Bucket
71
+
72
+ S3Buckets.member = Shapes::ShapeRef.new(shape: S3Bucket)
73
+
74
+ ServiceQuotaExceededException.add_member(:message, Shapes::ShapeRef.new(shape: ErrorMessage, required: true, location_name: "message"))
75
+ ServiceQuotaExceededException.struct_class = Types::ServiceQuotaExceededException
76
+
77
+ ThrottlingException.add_member(:message, Shapes::ShapeRef.new(shape: ErrorMessage, required: true, location_name: "message"))
78
+ ThrottlingException.struct_class = Types::ThrottlingException
79
+
80
+ UpdateConnectionRecordingPreferencesRequest.add_member(:client_token, Shapes::ShapeRef.new(shape: ClientToken, location_name: "ClientToken", metadata: {"idempotencyToken"=>true}))
81
+ UpdateConnectionRecordingPreferencesRequest.add_member(:connection_recording_preferences, Shapes::ShapeRef.new(shape: ConnectionRecordingPreferences, required: true, location_name: "ConnectionRecordingPreferences"))
82
+ UpdateConnectionRecordingPreferencesRequest.struct_class = Types::UpdateConnectionRecordingPreferencesRequest
83
+
84
+ UpdateConnectionRecordingPreferencesResponse.add_member(:client_token, Shapes::ShapeRef.new(shape: ClientToken, location_name: "ClientToken"))
85
+ UpdateConnectionRecordingPreferencesResponse.add_member(:connection_recording_preferences, Shapes::ShapeRef.new(shape: ConnectionRecordingPreferences, location_name: "ConnectionRecordingPreferences"))
86
+ UpdateConnectionRecordingPreferencesResponse.struct_class = Types::UpdateConnectionRecordingPreferencesResponse
87
+
88
+ ValidationException.add_member(:message, Shapes::ShapeRef.new(shape: ErrorMessage, required: true, location_name: "message"))
89
+ ValidationException.struct_class = Types::ValidationException
90
+
91
+
92
+ # @api private
93
+ API = Seahorse::Model::Api.new.tap do |api|
94
+
95
+ api.version = "2021-05-01"
96
+
97
+ api.metadata = {
98
+ "apiVersion" => "2021-05-01",
99
+ "auth" => ["aws.auth#sigv4"],
100
+ "endpointPrefix" => "ssm-guiconnect",
101
+ "jsonVersion" => "1.1",
102
+ "protocol" => "rest-json",
103
+ "protocols" => ["rest-json"],
104
+ "serviceFullName" => "AWS SSM-GUIConnect",
105
+ "serviceId" => "SSM GuiConnect",
106
+ "signatureVersion" => "v4",
107
+ "signingName" => "ssm-guiconnect",
108
+ "uid" => "ssm-guiconnect-2021-05-01",
109
+ }
110
+
111
+ api.add_operation(:delete_connection_recording_preferences, Seahorse::Model::Operation.new.tap do |o|
112
+ o.name = "DeleteConnectionRecordingPreferences"
113
+ o.http_method = "POST"
114
+ o.http_request_uri = "/DeleteConnectionRecordingPreferences"
115
+ o.input = Shapes::ShapeRef.new(shape: DeleteConnectionRecordingPreferencesRequest)
116
+ o.output = Shapes::ShapeRef.new(shape: DeleteConnectionRecordingPreferencesResponse)
117
+ o.errors << Shapes::ShapeRef.new(shape: ServiceQuotaExceededException)
118
+ o.errors << Shapes::ShapeRef.new(shape: ValidationException)
119
+ o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
120
+ o.errors << Shapes::ShapeRef.new(shape: ConflictException)
121
+ o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
122
+ o.errors << Shapes::ShapeRef.new(shape: InternalServerException)
123
+ o.errors << Shapes::ShapeRef.new(shape: AccessDeniedException)
124
+ end)
125
+
126
+ api.add_operation(:get_connection_recording_preferences, Seahorse::Model::Operation.new.tap do |o|
127
+ o.name = "GetConnectionRecordingPreferences"
128
+ o.http_method = "POST"
129
+ o.http_request_uri = "/GetConnectionRecordingPreferences"
130
+ o.input = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
131
+ o.output = Shapes::ShapeRef.new(shape: GetConnectionRecordingPreferencesResponse)
132
+ o.errors << Shapes::ShapeRef.new(shape: ServiceQuotaExceededException)
133
+ o.errors << Shapes::ShapeRef.new(shape: ValidationException)
134
+ o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
135
+ o.errors << Shapes::ShapeRef.new(shape: ConflictException)
136
+ o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
137
+ o.errors << Shapes::ShapeRef.new(shape: InternalServerException)
138
+ o.errors << Shapes::ShapeRef.new(shape: AccessDeniedException)
139
+ end)
140
+
141
+ api.add_operation(:update_connection_recording_preferences, Seahorse::Model::Operation.new.tap do |o|
142
+ o.name = "UpdateConnectionRecordingPreferences"
143
+ o.http_method = "POST"
144
+ o.http_request_uri = "/UpdateConnectionRecordingPreferences"
145
+ o.input = Shapes::ShapeRef.new(shape: UpdateConnectionRecordingPreferencesRequest)
146
+ o.output = Shapes::ShapeRef.new(shape: UpdateConnectionRecordingPreferencesResponse)
147
+ o.errors << Shapes::ShapeRef.new(shape: ServiceQuotaExceededException)
148
+ o.errors << Shapes::ShapeRef.new(shape: ValidationException)
149
+ o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
150
+ o.errors << Shapes::ShapeRef.new(shape: ConflictException)
151
+ o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
152
+ o.errors << Shapes::ShapeRef.new(shape: InternalServerException)
153
+ o.errors << Shapes::ShapeRef.new(shape: AccessDeniedException)
154
+ end)
155
+ end
156
+
157
+ end
158
+ end
File without changes
@@ -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::SSMGuiConnect
11
+ # Endpoint parameters used to influence endpoints per request.
12
+ #
13
+ # @!attribute region
14
+ # The AWS region used to dispatch the request.
15
+ #
16
+ # @return [String]
17
+ #
18
+ # @!attribute use_dual_stack
19
+ # When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.
20
+ #
21
+ # @return [Boolean]
22
+ #
23
+ # @!attribute use_fips
24
+ # 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.
25
+ #
26
+ # @return [Boolean]
27
+ #
28
+ # @!attribute endpoint
29
+ # Override the endpoint used to send this request
30
+ #
31
+ # @return [String]
32
+ #
33
+ EndpointParameters = Struct.new(
34
+ :region,
35
+ :use_dual_stack,
36
+ :use_fips,
37
+ :endpoint,
38
+ ) do
39
+ include Aws::Structure
40
+
41
+ # @api private
42
+ class << self
43
+ PARAM_MAP = {
44
+ 'Region' => :region,
45
+ 'UseDualStack' => :use_dual_stack,
46
+ 'UseFIPS' => :use_fips,
47
+ 'Endpoint' => :endpoint,
48
+ }.freeze
49
+ end
50
+
51
+ def initialize(options = {})
52
+ self[:region] = options[:region]
53
+ self[:use_dual_stack] = options[:use_dual_stack]
54
+ self[:use_dual_stack] = false if self[:use_dual_stack].nil?
55
+ self[:use_fips] = options[:use_fips]
56
+ self[:use_fips] = false if self[:use_fips].nil?
57
+ self[:endpoint] = options[:endpoint]
58
+ end
59
+
60
+ def self.create(config, options={})
61
+ new({
62
+ region: config.region,
63
+ use_dual_stack: config.use_dualstack_endpoint,
64
+ use_fips: config.use_fips_endpoint,
65
+ endpoint: (config.endpoint.to_s unless config.regional_endpoint),
66
+ }.merge(options))
67
+ end
68
+ end
69
+ end
@@ -0,0 +1,50 @@
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::SSMGuiConnect
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.boolean_equals?(parameters.use_fips, true) && Aws::Endpoints::Matchers.boolean_equals?(parameters.use_dual_stack, true)
25
+ 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"))
26
+ return Aws::Endpoints::Endpoint.new(url: "https://ssm-guiconnect-fips.#{parameters.region}.#{partition_result['dualStackDnsSuffix']}", headers: {}, properties: {})
27
+ end
28
+ raise ArgumentError, "FIPS and DualStack are enabled, but this partition does not support one or both"
29
+ end
30
+ if Aws::Endpoints::Matchers.boolean_equals?(parameters.use_fips, true)
31
+ if Aws::Endpoints::Matchers.boolean_equals?(Aws::Endpoints::Matchers.attr(partition_result, "supportsFIPS"), true)
32
+ return Aws::Endpoints::Endpoint.new(url: "https://ssm-guiconnect-fips.#{parameters.region}.#{partition_result['dnsSuffix']}", headers: {}, properties: {})
33
+ end
34
+ raise ArgumentError, "FIPS is enabled but this partition does not support FIPS"
35
+ end
36
+ if Aws::Endpoints::Matchers.boolean_equals?(parameters.use_dual_stack, true)
37
+ if Aws::Endpoints::Matchers.boolean_equals?(true, Aws::Endpoints::Matchers.attr(partition_result, "supportsDualStack"))
38
+ return Aws::Endpoints::Endpoint.new(url: "https://ssm-guiconnect.#{parameters.region}.#{partition_result['dualStackDnsSuffix']}", headers: {}, properties: {})
39
+ end
40
+ raise ArgumentError, "DualStack is enabled but this partition does not support DualStack"
41
+ end
42
+ return Aws::Endpoints::Endpoint.new(url: "https://ssm-guiconnect.#{parameters.region}.#{partition_result['dnsSuffix']}", headers: {}, properties: {})
43
+ end
44
+ end
45
+ raise ArgumentError, "Invalid Configuration: Missing Region"
46
+ raise ArgumentError, 'No endpoint could be resolved'
47
+
48
+ end
49
+ end
50
+ 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::SSMGuiConnect
12
+ # @api private
13
+ module Endpoints
14
+
15
+
16
+ def self.parameters_for_operation(context)
17
+ Aws::SSMGuiConnect::EndpointParameters.create(context.config)
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,150 @@
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::SSMGuiConnect
11
+
12
+ # When SSMGuiConnect returns an error response, the Ruby SDK constructs and raises an error.
13
+ # These errors all extend Aws::SSMGuiConnect::Errors::ServiceError < {Aws::Errors::ServiceError}
14
+ #
15
+ # You can rescue all SSMGuiConnect errors using ServiceError:
16
+ #
17
+ # begin
18
+ # # do stuff
19
+ # rescue Aws::SSMGuiConnect::Errors::ServiceError
20
+ # # rescues all SSMGuiConnect 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
+ # * {ConflictException}
32
+ # * {InternalServerException}
33
+ # * {ResourceNotFoundException}
34
+ # * {ServiceQuotaExceededException}
35
+ # * {ThrottlingException}
36
+ # * {ValidationException}
37
+ #
38
+ # Additionally, error classes are dynamically generated for service errors based on the error code
39
+ # if they are not defined above.
40
+ module Errors
41
+
42
+ extend Aws::Errors::DynamicErrors
43
+
44
+ class AccessDeniedException < ServiceError
45
+
46
+ # @param [Seahorse::Client::RequestContext] context
47
+ # @param [String] message
48
+ # @param [Aws::SSMGuiConnect::Types::AccessDeniedException] data
49
+ def initialize(context, message, data = Aws::EmptyStructure.new)
50
+ super(context, message, data)
51
+ end
52
+
53
+ # @return [String]
54
+ def message
55
+ @message || @data[:message]
56
+ end
57
+ end
58
+
59
+ class ConflictException < ServiceError
60
+
61
+ # @param [Seahorse::Client::RequestContext] context
62
+ # @param [String] message
63
+ # @param [Aws::SSMGuiConnect::Types::ConflictException] data
64
+ def initialize(context, message, data = Aws::EmptyStructure.new)
65
+ super(context, message, data)
66
+ end
67
+
68
+ # @return [String]
69
+ def message
70
+ @message || @data[:message]
71
+ end
72
+ end
73
+
74
+ class InternalServerException < ServiceError
75
+
76
+ # @param [Seahorse::Client::RequestContext] context
77
+ # @param [String] message
78
+ # @param [Aws::SSMGuiConnect::Types::InternalServerException] data
79
+ def initialize(context, message, data = Aws::EmptyStructure.new)
80
+ super(context, message, data)
81
+ end
82
+
83
+ # @return [String]
84
+ def message
85
+ @message || @data[:message]
86
+ end
87
+ end
88
+
89
+ class ResourceNotFoundException < ServiceError
90
+
91
+ # @param [Seahorse::Client::RequestContext] context
92
+ # @param [String] message
93
+ # @param [Aws::SSMGuiConnect::Types::ResourceNotFoundException] data
94
+ def initialize(context, message, data = Aws::EmptyStructure.new)
95
+ super(context, message, data)
96
+ end
97
+
98
+ # @return [String]
99
+ def message
100
+ @message || @data[:message]
101
+ end
102
+ end
103
+
104
+ class ServiceQuotaExceededException < ServiceError
105
+
106
+ # @param [Seahorse::Client::RequestContext] context
107
+ # @param [String] message
108
+ # @param [Aws::SSMGuiConnect::Types::ServiceQuotaExceededException] data
109
+ def initialize(context, message, data = Aws::EmptyStructure.new)
110
+ super(context, message, data)
111
+ end
112
+
113
+ # @return [String]
114
+ def message
115
+ @message || @data[:message]
116
+ end
117
+ end
118
+
119
+ class ThrottlingException < ServiceError
120
+
121
+ # @param [Seahorse::Client::RequestContext] context
122
+ # @param [String] message
123
+ # @param [Aws::SSMGuiConnect::Types::ThrottlingException] data
124
+ def initialize(context, message, data = Aws::EmptyStructure.new)
125
+ super(context, message, data)
126
+ end
127
+
128
+ # @return [String]
129
+ def message
130
+ @message || @data[:message]
131
+ end
132
+ end
133
+
134
+ class ValidationException < ServiceError
135
+
136
+ # @param [Seahorse::Client::RequestContext] context
137
+ # @param [String] message
138
+ # @param [Aws::SSMGuiConnect::Types::ValidationException] data
139
+ def initialize(context, message, data = Aws::EmptyStructure.new)
140
+ super(context, message, data)
141
+ end
142
+
143
+ # @return [String]
144
+ def message
145
+ @message || @data[:message]
146
+ end
147
+ end
148
+
149
+ end
150
+ 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::SSMGuiConnect
12
+ module Plugins
13
+ class Endpoints < Seahorse::Client::Plugin
14
+ option(
15
+ :endpoint_provider,
16
+ doc_type: 'Aws::SSMGuiConnect::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::SSMGuiConnect::EndpointParameters`.
22
+ DOCS
23
+ Aws::SSMGuiConnect::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::SSMGuiConnect::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::SSMGuiConnect
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