aws-sdk-arczonalshift 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,149 @@
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::ARCZonalShift
11
+
12
+ # When ARCZonalShift returns an error response, the Ruby SDK constructs and raises an error.
13
+ # These errors all extend Aws::ARCZonalShift::Errors::ServiceError < {Aws::Errors::ServiceError}
14
+ #
15
+ # You can rescue all ARCZonalShift errors using ServiceError:
16
+ #
17
+ # begin
18
+ # # do stuff
19
+ # rescue Aws::ARCZonalShift::Errors::ServiceError
20
+ # # rescues all ARCZonalShift 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
+ # * {ThrottlingException}
35
+ # * {ValidationException}
36
+ #
37
+ # Additionally, error classes are dynamically generated for service errors based on the error code
38
+ # if they are not defined above.
39
+ module Errors
40
+
41
+ extend Aws::Errors::DynamicErrors
42
+
43
+ class AccessDeniedException < ServiceError
44
+
45
+ # @param [Seahorse::Client::RequestContext] context
46
+ # @param [String] message
47
+ # @param [Aws::ARCZonalShift::Types::AccessDeniedException] data
48
+ def initialize(context, message, data = Aws::EmptyStructure.new)
49
+ super(context, message, data)
50
+ end
51
+
52
+ # @return [String]
53
+ def message
54
+ @message || @data[:message]
55
+ end
56
+ end
57
+
58
+ class ConflictException < ServiceError
59
+
60
+ # @param [Seahorse::Client::RequestContext] context
61
+ # @param [String] message
62
+ # @param [Aws::ARCZonalShift::Types::ConflictException] data
63
+ def initialize(context, message, data = Aws::EmptyStructure.new)
64
+ super(context, message, data)
65
+ end
66
+
67
+ # @return [String]
68
+ def message
69
+ @message || @data[:message]
70
+ end
71
+
72
+ # @return [String]
73
+ def reason
74
+ @data[:reason]
75
+ end
76
+
77
+ # @return [String]
78
+ def zonal_shift_id
79
+ @data[:zonal_shift_id]
80
+ end
81
+ end
82
+
83
+ class InternalServerException < ServiceError
84
+
85
+ # @param [Seahorse::Client::RequestContext] context
86
+ # @param [String] message
87
+ # @param [Aws::ARCZonalShift::Types::InternalServerException] data
88
+ def initialize(context, message, data = Aws::EmptyStructure.new)
89
+ super(context, message, data)
90
+ end
91
+
92
+ # @return [String]
93
+ def message
94
+ @message || @data[:message]
95
+ end
96
+ end
97
+
98
+ class ResourceNotFoundException < ServiceError
99
+
100
+ # @param [Seahorse::Client::RequestContext] context
101
+ # @param [String] message
102
+ # @param [Aws::ARCZonalShift::Types::ResourceNotFoundException] data
103
+ def initialize(context, message, data = Aws::EmptyStructure.new)
104
+ super(context, message, data)
105
+ end
106
+
107
+ # @return [String]
108
+ def message
109
+ @message || @data[:message]
110
+ end
111
+ end
112
+
113
+ class ThrottlingException < ServiceError
114
+
115
+ # @param [Seahorse::Client::RequestContext] context
116
+ # @param [String] message
117
+ # @param [Aws::ARCZonalShift::Types::ThrottlingException] data
118
+ def initialize(context, message, data = Aws::EmptyStructure.new)
119
+ super(context, message, data)
120
+ end
121
+
122
+ # @return [String]
123
+ def message
124
+ @message || @data[:message]
125
+ end
126
+ end
127
+
128
+ class ValidationException < ServiceError
129
+
130
+ # @param [Seahorse::Client::RequestContext] context
131
+ # @param [String] message
132
+ # @param [Aws::ARCZonalShift::Types::ValidationException] data
133
+ def initialize(context, message, data = Aws::EmptyStructure.new)
134
+ super(context, message, data)
135
+ end
136
+
137
+ # @return [String]
138
+ def message
139
+ @message || @data[:message]
140
+ end
141
+
142
+ # @return [String]
143
+ def reason
144
+ @data[:reason]
145
+ end
146
+ end
147
+
148
+ end
149
+ end
@@ -0,0 +1,80 @@
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::ARCZonalShift
12
+ module Plugins
13
+ class Endpoints < Seahorse::Client::Plugin
14
+ option(
15
+ :endpoint_provider,
16
+ doc_type: 'Aws::ARCZonalShift::EndpointProvider',
17
+ docstring: 'The endpoint provider used to resolve endpoints. Any '\
18
+ 'object that responds to `#resolve_endpoint(parameters)` '\
19
+ 'where `parameters` is a Struct similar to '\
20
+ '`Aws::ARCZonalShift::EndpointParameters`'
21
+ ) do |cfg|
22
+ Aws::ARCZonalShift::EndpointProvider.new
23
+ end
24
+
25
+ # @api private
26
+ class Handler < Seahorse::Client::Handler
27
+ def call(context)
28
+ # If endpoint was discovered, do not resolve or apply the endpoint.
29
+ unless context[:discovered_endpoint]
30
+ params = 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
+ end
36
+
37
+ context[:endpoint_params] = params
38
+ context[:auth_scheme] =
39
+ Aws::Endpoints.resolve_auth_scheme(context, endpoint)
40
+
41
+ @handler.call(context)
42
+ end
43
+
44
+ private
45
+
46
+ def apply_endpoint_headers(context, headers)
47
+ headers.each do |key, values|
48
+ value = values
49
+ .compact
50
+ .map { |s| Seahorse::Util.escape_header_list_string(s.to_s) }
51
+ .join(',')
52
+
53
+ context.http_request.headers[key] = value
54
+ end
55
+ end
56
+
57
+ def parameters_for_operation(context)
58
+ case context.operation_name
59
+ when :cancel_zonal_shift
60
+ Aws::ARCZonalShift::Endpoints::CancelZonalShift.build(context)
61
+ when :get_managed_resource
62
+ Aws::ARCZonalShift::Endpoints::GetManagedResource.build(context)
63
+ when :list_managed_resources
64
+ Aws::ARCZonalShift::Endpoints::ListManagedResources.build(context)
65
+ when :list_zonal_shifts
66
+ Aws::ARCZonalShift::Endpoints::ListZonalShifts.build(context)
67
+ when :start_zonal_shift
68
+ Aws::ARCZonalShift::Endpoints::StartZonalShift.build(context)
69
+ when :update_zonal_shift
70
+ Aws::ARCZonalShift::Endpoints::UpdateZonalShift.build(context)
71
+ end
72
+ end
73
+ end
74
+
75
+ def add_handlers(handlers, _config)
76
+ handlers.add(Handler, step: :build, priority: 75)
77
+ end
78
+ end
79
+ end
80
+ 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::ARCZonalShift
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