aws-sdk-evs 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,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::Evs
12
+ # @api private
13
+ module Endpoints
14
+
15
+
16
+ def self.parameters_for_operation(context)
17
+ Aws::Evs::EndpointParameters.create(context.config)
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,147 @@
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::Evs
11
+
12
+ # When Evs returns an error response, the Ruby SDK constructs and raises an error.
13
+ # These errors all extend Aws::Evs::Errors::ServiceError < {Aws::Errors::ServiceError}
14
+ #
15
+ # You can rescue all Evs errors using ServiceError:
16
+ #
17
+ # begin
18
+ # # do stuff
19
+ # rescue Aws::Evs::Errors::ServiceError
20
+ # # rescues all Evs 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
+ # * {ResourceNotFoundException}
31
+ # * {TagPolicyException}
32
+ # * {ThrottlingException}
33
+ # * {TooManyTagsException}
34
+ # * {ValidationException}
35
+ #
36
+ # Additionally, error classes are dynamically generated for service errors based on the error code
37
+ # if they are not defined above.
38
+ module Errors
39
+
40
+ extend Aws::Errors::DynamicErrors
41
+
42
+ class ResourceNotFoundException < ServiceError
43
+
44
+ # @param [Seahorse::Client::RequestContext] context
45
+ # @param [String] message
46
+ # @param [Aws::Evs::Types::ResourceNotFoundException] data
47
+ def initialize(context, message, data = Aws::EmptyStructure.new)
48
+ super(context, message, data)
49
+ end
50
+
51
+ # @return [String]
52
+ def message
53
+ @message || @data[:message]
54
+ end
55
+
56
+ # @return [String]
57
+ def resource_id
58
+ @data[:resource_id]
59
+ end
60
+
61
+ # @return [String]
62
+ def resource_type
63
+ @data[:resource_type]
64
+ end
65
+ end
66
+
67
+ class TagPolicyException < ServiceError
68
+
69
+ # @param [Seahorse::Client::RequestContext] context
70
+ # @param [String] message
71
+ # @param [Aws::Evs::Types::TagPolicyException] data
72
+ def initialize(context, message, data = Aws::EmptyStructure.new)
73
+ super(context, message, data)
74
+ end
75
+
76
+ # @return [String]
77
+ def message
78
+ @message || @data[:message]
79
+ end
80
+ end
81
+
82
+ class ThrottlingException < ServiceError
83
+
84
+ # @param [Seahorse::Client::RequestContext] context
85
+ # @param [String] message
86
+ # @param [Aws::Evs::Types::ThrottlingException] data
87
+ def initialize(context, message, data = Aws::EmptyStructure.new)
88
+ super(context, message, data)
89
+ end
90
+
91
+ # @return [String]
92
+ def message
93
+ @message || @data[:message]
94
+ end
95
+
96
+ # @return [String]
97
+ def retry_after_seconds
98
+ @data[:retry_after_seconds]
99
+ end
100
+
101
+ def retryable?
102
+ true
103
+ end
104
+ end
105
+
106
+ class TooManyTagsException < ServiceError
107
+
108
+ # @param [Seahorse::Client::RequestContext] context
109
+ # @param [String] message
110
+ # @param [Aws::Evs::Types::TooManyTagsException] data
111
+ def initialize(context, message, data = Aws::EmptyStructure.new)
112
+ super(context, message, data)
113
+ end
114
+
115
+ # @return [String]
116
+ def message
117
+ @message || @data[:message]
118
+ end
119
+ end
120
+
121
+ class ValidationException < ServiceError
122
+
123
+ # @param [Seahorse::Client::RequestContext] context
124
+ # @param [String] message
125
+ # @param [Aws::Evs::Types::ValidationException] 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
+ # @return [String]
136
+ def reason
137
+ @data[:reason]
138
+ end
139
+
140
+ # @return [String]
141
+ def field_list
142
+ @data[:field_list]
143
+ end
144
+ end
145
+
146
+ end
147
+ 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::Evs
12
+ module Plugins
13
+ class Endpoints < Seahorse::Client::Plugin
14
+ option(
15
+ :endpoint_provider,
16
+ doc_type: 'Aws::Evs::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::Evs::EndpointParameters`.
22
+ DOCS
23
+ Aws::Evs::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::Evs::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::Evs
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