aws-sdk-drs 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.
File without changes
@@ -0,0 +1,266 @@
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::Drs
11
+
12
+ # When Drs returns an error response, the Ruby SDK constructs and raises an error.
13
+ # These errors all extend Aws::Drs::Errors::ServiceError < {Aws::Errors::ServiceError}
14
+ #
15
+ # You can rescue all Drs errors using ServiceError:
16
+ #
17
+ # begin
18
+ # # do stuff
19
+ # rescue Aws::Drs::Errors::ServiceError
20
+ # # rescues all Drs 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
+ # * {UninitializedAccountException}
37
+ # * {ValidationException}
38
+ #
39
+ # Additionally, error classes are dynamically generated for service errors based on the error code
40
+ # if they are not defined above.
41
+ module Errors
42
+
43
+ extend Aws::Errors::DynamicErrors
44
+
45
+ class AccessDeniedException < ServiceError
46
+
47
+ # @param [Seahorse::Client::RequestContext] context
48
+ # @param [String] message
49
+ # @param [Aws::Drs::Types::AccessDeniedException] data
50
+ def initialize(context, message, data = Aws::EmptyStructure.new)
51
+ super(context, message, data)
52
+ end
53
+
54
+ # @return [String]
55
+ def code
56
+ @code || @data[:code]
57
+ end
58
+
59
+ # @return [String]
60
+ def message
61
+ @message || @data[:message]
62
+ end
63
+ end
64
+
65
+ class ConflictException < ServiceError
66
+
67
+ # @param [Seahorse::Client::RequestContext] context
68
+ # @param [String] message
69
+ # @param [Aws::Drs::Types::ConflictException] data
70
+ def initialize(context, message, data = Aws::EmptyStructure.new)
71
+ super(context, message, data)
72
+ end
73
+
74
+ # @return [String]
75
+ def code
76
+ @code || @data[:code]
77
+ end
78
+
79
+ # @return [String]
80
+ def message
81
+ @message || @data[:message]
82
+ end
83
+
84
+ # @return [String]
85
+ def resource_id
86
+ @data[:resource_id]
87
+ end
88
+
89
+ # @return [String]
90
+ def resource_type
91
+ @data[:resource_type]
92
+ end
93
+ end
94
+
95
+ class InternalServerException < ServiceError
96
+
97
+ # @param [Seahorse::Client::RequestContext] context
98
+ # @param [String] message
99
+ # @param [Aws::Drs::Types::InternalServerException] data
100
+ def initialize(context, message, data = Aws::EmptyStructure.new)
101
+ super(context, message, data)
102
+ end
103
+
104
+ # @return [String]
105
+ def message
106
+ @message || @data[:message]
107
+ end
108
+
109
+ # @return [String]
110
+ def retry_after_seconds
111
+ @data[:retry_after_seconds]
112
+ end
113
+ end
114
+
115
+ class ResourceNotFoundException < ServiceError
116
+
117
+ # @param [Seahorse::Client::RequestContext] context
118
+ # @param [String] message
119
+ # @param [Aws::Drs::Types::ResourceNotFoundException] data
120
+ def initialize(context, message, data = Aws::EmptyStructure.new)
121
+ super(context, message, data)
122
+ end
123
+
124
+ # @return [String]
125
+ def code
126
+ @code || @data[:code]
127
+ end
128
+
129
+ # @return [String]
130
+ def message
131
+ @message || @data[:message]
132
+ end
133
+
134
+ # @return [String]
135
+ def resource_id
136
+ @data[:resource_id]
137
+ end
138
+
139
+ # @return [String]
140
+ def resource_type
141
+ @data[:resource_type]
142
+ end
143
+ end
144
+
145
+ class ServiceQuotaExceededException < ServiceError
146
+
147
+ # @param [Seahorse::Client::RequestContext] context
148
+ # @param [String] message
149
+ # @param [Aws::Drs::Types::ServiceQuotaExceededException] data
150
+ def initialize(context, message, data = Aws::EmptyStructure.new)
151
+ super(context, message, data)
152
+ end
153
+
154
+ # @return [String]
155
+ def code
156
+ @code || @data[:code]
157
+ end
158
+
159
+ # @return [String]
160
+ def message
161
+ @message || @data[:message]
162
+ end
163
+
164
+ # @return [String]
165
+ def quota_code
166
+ @data[:quota_code]
167
+ end
168
+
169
+ # @return [String]
170
+ def resource_id
171
+ @data[:resource_id]
172
+ end
173
+
174
+ # @return [String]
175
+ def resource_type
176
+ @data[:resource_type]
177
+ end
178
+
179
+ # @return [String]
180
+ def service_code
181
+ @data[:service_code]
182
+ end
183
+ end
184
+
185
+ class ThrottlingException < ServiceError
186
+
187
+ # @param [Seahorse::Client::RequestContext] context
188
+ # @param [String] message
189
+ # @param [Aws::Drs::Types::ThrottlingException] data
190
+ def initialize(context, message, data = Aws::EmptyStructure.new)
191
+ super(context, message, data)
192
+ end
193
+
194
+ # @return [String]
195
+ def message
196
+ @message || @data[:message]
197
+ end
198
+
199
+ # @return [String]
200
+ def quota_code
201
+ @data[:quota_code]
202
+ end
203
+
204
+ # @return [String]
205
+ def retry_after_seconds
206
+ @data[:retry_after_seconds]
207
+ end
208
+
209
+ # @return [String]
210
+ def service_code
211
+ @data[:service_code]
212
+ end
213
+ end
214
+
215
+ class UninitializedAccountException < ServiceError
216
+
217
+ # @param [Seahorse::Client::RequestContext] context
218
+ # @param [String] message
219
+ # @param [Aws::Drs::Types::UninitializedAccountException] data
220
+ def initialize(context, message, data = Aws::EmptyStructure.new)
221
+ super(context, message, data)
222
+ end
223
+
224
+ # @return [String]
225
+ def code
226
+ @code || @data[:code]
227
+ end
228
+
229
+ # @return [String]
230
+ def message
231
+ @message || @data[:message]
232
+ end
233
+ end
234
+
235
+ class ValidationException < ServiceError
236
+
237
+ # @param [Seahorse::Client::RequestContext] context
238
+ # @param [String] message
239
+ # @param [Aws::Drs::Types::ValidationException] data
240
+ def initialize(context, message, data = Aws::EmptyStructure.new)
241
+ super(context, message, data)
242
+ end
243
+
244
+ # @return [String]
245
+ def code
246
+ @code || @data[:code]
247
+ end
248
+
249
+ # @return [String]
250
+ def field_list
251
+ @data[:field_list]
252
+ end
253
+
254
+ # @return [String]
255
+ def message
256
+ @message || @data[:message]
257
+ end
258
+
259
+ # @return [String]
260
+ def reason
261
+ @data[:reason]
262
+ end
263
+ end
264
+
265
+ end
266
+ 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::Drs
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