aws-sdk-deadline 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,272 @@
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::Deadline
11
+
12
+ # When Deadline returns an error response, the Ruby SDK constructs and raises an error.
13
+ # These errors all extend Aws::Deadline::Errors::ServiceError < {Aws::Errors::ServiceError}
14
+ #
15
+ # You can rescue all Deadline errors using ServiceError:
16
+ #
17
+ # begin
18
+ # # do stuff
19
+ # rescue Aws::Deadline::Errors::ServiceError
20
+ # # rescues all Deadline 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
+ # * {InternalServerErrorException}
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::Deadline::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 context
55
+ @data[:context]
56
+ end
57
+
58
+ # @return [String]
59
+ def message
60
+ @message || @data[:message]
61
+ end
62
+ end
63
+
64
+ class ConflictException < ServiceError
65
+
66
+ # @param [Seahorse::Client::RequestContext] context
67
+ # @param [String] message
68
+ # @param [Aws::Deadline::Types::ConflictException] data
69
+ def initialize(context, message, data = Aws::EmptyStructure.new)
70
+ super(context, message, data)
71
+ end
72
+
73
+ # @return [String]
74
+ def context
75
+ @data[:context]
76
+ end
77
+
78
+ # @return [String]
79
+ def message
80
+ @message || @data[:message]
81
+ end
82
+
83
+ # @return [String]
84
+ def reason
85
+ @data[:reason]
86
+ end
87
+
88
+ # @return [String]
89
+ def resource_id
90
+ @data[:resource_id]
91
+ end
92
+
93
+ # @return [String]
94
+ def resource_type
95
+ @data[:resource_type]
96
+ end
97
+ end
98
+
99
+ class InternalServerErrorException < ServiceError
100
+
101
+ # @param [Seahorse::Client::RequestContext] context
102
+ # @param [String] message
103
+ # @param [Aws::Deadline::Types::InternalServerErrorException] data
104
+ def initialize(context, message, data = Aws::EmptyStructure.new)
105
+ super(context, message, data)
106
+ end
107
+
108
+ # @return [String]
109
+ def message
110
+ @message || @data[:message]
111
+ end
112
+
113
+ # @return [String]
114
+ def retry_after_seconds
115
+ @data[:retry_after_seconds]
116
+ end
117
+
118
+ def retryable?
119
+ true
120
+ end
121
+ end
122
+
123
+ class ResourceNotFoundException < ServiceError
124
+
125
+ # @param [Seahorse::Client::RequestContext] context
126
+ # @param [String] message
127
+ # @param [Aws::Deadline::Types::ResourceNotFoundException] data
128
+ def initialize(context, message, data = Aws::EmptyStructure.new)
129
+ super(context, message, data)
130
+ end
131
+
132
+ # @return [String]
133
+ def context
134
+ @data[:context]
135
+ end
136
+
137
+ # @return [String]
138
+ def message
139
+ @message || @data[:message]
140
+ end
141
+
142
+ # @return [String]
143
+ def resource_id
144
+ @data[:resource_id]
145
+ end
146
+
147
+ # @return [String]
148
+ def resource_type
149
+ @data[:resource_type]
150
+ end
151
+ end
152
+
153
+ class ServiceQuotaExceededException < ServiceError
154
+
155
+ # @param [Seahorse::Client::RequestContext] context
156
+ # @param [String] message
157
+ # @param [Aws::Deadline::Types::ServiceQuotaExceededException] data
158
+ def initialize(context, message, data = Aws::EmptyStructure.new)
159
+ super(context, message, data)
160
+ end
161
+
162
+ # @return [String]
163
+ def context
164
+ @data[:context]
165
+ end
166
+
167
+ # @return [String]
168
+ def message
169
+ @message || @data[:message]
170
+ end
171
+
172
+ # @return [String]
173
+ def quota_code
174
+ @data[:quota_code]
175
+ end
176
+
177
+ # @return [String]
178
+ def reason
179
+ @data[:reason]
180
+ end
181
+
182
+ # @return [String]
183
+ def resource_id
184
+ @data[:resource_id]
185
+ end
186
+
187
+ # @return [String]
188
+ def resource_type
189
+ @data[:resource_type]
190
+ end
191
+
192
+ # @return [String]
193
+ def service_code
194
+ @data[:service_code]
195
+ end
196
+ end
197
+
198
+ class ThrottlingException < ServiceError
199
+
200
+ # @param [Seahorse::Client::RequestContext] context
201
+ # @param [String] message
202
+ # @param [Aws::Deadline::Types::ThrottlingException] data
203
+ def initialize(context, message, data = Aws::EmptyStructure.new)
204
+ super(context, message, data)
205
+ end
206
+
207
+ # @return [String]
208
+ def context
209
+ @data[:context]
210
+ end
211
+
212
+ # @return [String]
213
+ def message
214
+ @message || @data[:message]
215
+ end
216
+
217
+ # @return [String]
218
+ def quota_code
219
+ @data[:quota_code]
220
+ end
221
+
222
+ # @return [String]
223
+ def retry_after_seconds
224
+ @data[:retry_after_seconds]
225
+ end
226
+
227
+ # @return [String]
228
+ def service_code
229
+ @data[:service_code]
230
+ end
231
+
232
+ def retryable?
233
+ true
234
+ end
235
+
236
+ def throttling?
237
+ true
238
+ end
239
+ end
240
+
241
+ class ValidationException < ServiceError
242
+
243
+ # @param [Seahorse::Client::RequestContext] context
244
+ # @param [String] message
245
+ # @param [Aws::Deadline::Types::ValidationException] data
246
+ def initialize(context, message, data = Aws::EmptyStructure.new)
247
+ super(context, message, data)
248
+ end
249
+
250
+ # @return [String]
251
+ def context
252
+ @data[:context]
253
+ end
254
+
255
+ # @return [String]
256
+ def field_list
257
+ @data[:field_list]
258
+ end
259
+
260
+ # @return [String]
261
+ def message
262
+ @message || @data[:message]
263
+ end
264
+
265
+ # @return [String]
266
+ def reason
267
+ @data[:reason]
268
+ end
269
+ end
270
+
271
+ end
272
+ end
@@ -0,0 +1,274 @@
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::Deadline
12
+ module Plugins
13
+ class Endpoints < Seahorse::Client::Plugin
14
+ option(
15
+ :endpoint_provider,
16
+ doc_type: 'Aws::Deadline::EndpointProvider',
17
+ rbs_type: 'untyped',
18
+ docstring: 'The endpoint provider used to resolve endpoints. Any '\
19
+ 'object that responds to `#resolve_endpoint(parameters)` '\
20
+ 'where `parameters` is a Struct similar to '\
21
+ '`Aws::Deadline::EndpointParameters`'
22
+ ) do |cfg|
23
+ Aws::Deadline::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 = 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
+ @handler.call(context)
44
+ end
45
+
46
+ private
47
+
48
+ def apply_endpoint_headers(context, headers)
49
+ headers.each do |key, values|
50
+ value = values
51
+ .compact
52
+ .map { |s| Seahorse::Util.escape_header_list_string(s.to_s) }
53
+ .join(',')
54
+
55
+ context.http_request.headers[key] = value
56
+ end
57
+ end
58
+
59
+ def parameters_for_operation(context)
60
+ case context.operation_name
61
+ when :associate_member_to_farm
62
+ Aws::Deadline::Endpoints::AssociateMemberToFarm.build(context)
63
+ when :associate_member_to_fleet
64
+ Aws::Deadline::Endpoints::AssociateMemberToFleet.build(context)
65
+ when :associate_member_to_job
66
+ Aws::Deadline::Endpoints::AssociateMemberToJob.build(context)
67
+ when :associate_member_to_queue
68
+ Aws::Deadline::Endpoints::AssociateMemberToQueue.build(context)
69
+ when :assume_fleet_role_for_read
70
+ Aws::Deadline::Endpoints::AssumeFleetRoleForRead.build(context)
71
+ when :assume_fleet_role_for_worker
72
+ Aws::Deadline::Endpoints::AssumeFleetRoleForWorker.build(context)
73
+ when :assume_queue_role_for_read
74
+ Aws::Deadline::Endpoints::AssumeQueueRoleForRead.build(context)
75
+ when :assume_queue_role_for_user
76
+ Aws::Deadline::Endpoints::AssumeQueueRoleForUser.build(context)
77
+ when :assume_queue_role_for_worker
78
+ Aws::Deadline::Endpoints::AssumeQueueRoleForWorker.build(context)
79
+ when :batch_get_job_entity
80
+ Aws::Deadline::Endpoints::BatchGetJobEntity.build(context)
81
+ when :copy_job_template
82
+ Aws::Deadline::Endpoints::CopyJobTemplate.build(context)
83
+ when :create_budget
84
+ Aws::Deadline::Endpoints::CreateBudget.build(context)
85
+ when :create_farm
86
+ Aws::Deadline::Endpoints::CreateFarm.build(context)
87
+ when :create_fleet
88
+ Aws::Deadline::Endpoints::CreateFleet.build(context)
89
+ when :create_job
90
+ Aws::Deadline::Endpoints::CreateJob.build(context)
91
+ when :create_license_endpoint
92
+ Aws::Deadline::Endpoints::CreateLicenseEndpoint.build(context)
93
+ when :create_monitor
94
+ Aws::Deadline::Endpoints::CreateMonitor.build(context)
95
+ when :create_queue
96
+ Aws::Deadline::Endpoints::CreateQueue.build(context)
97
+ when :create_queue_environment
98
+ Aws::Deadline::Endpoints::CreateQueueEnvironment.build(context)
99
+ when :create_queue_fleet_association
100
+ Aws::Deadline::Endpoints::CreateQueueFleetAssociation.build(context)
101
+ when :create_storage_profile
102
+ Aws::Deadline::Endpoints::CreateStorageProfile.build(context)
103
+ when :create_worker
104
+ Aws::Deadline::Endpoints::CreateWorker.build(context)
105
+ when :delete_budget
106
+ Aws::Deadline::Endpoints::DeleteBudget.build(context)
107
+ when :delete_farm
108
+ Aws::Deadline::Endpoints::DeleteFarm.build(context)
109
+ when :delete_fleet
110
+ Aws::Deadline::Endpoints::DeleteFleet.build(context)
111
+ when :delete_license_endpoint
112
+ Aws::Deadline::Endpoints::DeleteLicenseEndpoint.build(context)
113
+ when :delete_metered_product
114
+ Aws::Deadline::Endpoints::DeleteMeteredProduct.build(context)
115
+ when :delete_monitor
116
+ Aws::Deadline::Endpoints::DeleteMonitor.build(context)
117
+ when :delete_queue
118
+ Aws::Deadline::Endpoints::DeleteQueue.build(context)
119
+ when :delete_queue_environment
120
+ Aws::Deadline::Endpoints::DeleteQueueEnvironment.build(context)
121
+ when :delete_queue_fleet_association
122
+ Aws::Deadline::Endpoints::DeleteQueueFleetAssociation.build(context)
123
+ when :delete_storage_profile
124
+ Aws::Deadline::Endpoints::DeleteStorageProfile.build(context)
125
+ when :delete_worker
126
+ Aws::Deadline::Endpoints::DeleteWorker.build(context)
127
+ when :disassociate_member_from_farm
128
+ Aws::Deadline::Endpoints::DisassociateMemberFromFarm.build(context)
129
+ when :disassociate_member_from_fleet
130
+ Aws::Deadline::Endpoints::DisassociateMemberFromFleet.build(context)
131
+ when :disassociate_member_from_job
132
+ Aws::Deadline::Endpoints::DisassociateMemberFromJob.build(context)
133
+ when :disassociate_member_from_queue
134
+ Aws::Deadline::Endpoints::DisassociateMemberFromQueue.build(context)
135
+ when :get_budget
136
+ Aws::Deadline::Endpoints::GetBudget.build(context)
137
+ when :get_farm
138
+ Aws::Deadline::Endpoints::GetFarm.build(context)
139
+ when :get_fleet
140
+ Aws::Deadline::Endpoints::GetFleet.build(context)
141
+ when :get_job
142
+ Aws::Deadline::Endpoints::GetJob.build(context)
143
+ when :get_license_endpoint
144
+ Aws::Deadline::Endpoints::GetLicenseEndpoint.build(context)
145
+ when :get_monitor
146
+ Aws::Deadline::Endpoints::GetMonitor.build(context)
147
+ when :get_queue
148
+ Aws::Deadline::Endpoints::GetQueue.build(context)
149
+ when :get_queue_environment
150
+ Aws::Deadline::Endpoints::GetQueueEnvironment.build(context)
151
+ when :get_queue_fleet_association
152
+ Aws::Deadline::Endpoints::GetQueueFleetAssociation.build(context)
153
+ when :get_session
154
+ Aws::Deadline::Endpoints::GetSession.build(context)
155
+ when :get_session_action
156
+ Aws::Deadline::Endpoints::GetSessionAction.build(context)
157
+ when :get_sessions_statistics_aggregation
158
+ Aws::Deadline::Endpoints::GetSessionsStatisticsAggregation.build(context)
159
+ when :get_step
160
+ Aws::Deadline::Endpoints::GetStep.build(context)
161
+ when :get_storage_profile
162
+ Aws::Deadline::Endpoints::GetStorageProfile.build(context)
163
+ when :get_storage_profile_for_queue
164
+ Aws::Deadline::Endpoints::GetStorageProfileForQueue.build(context)
165
+ when :get_task
166
+ Aws::Deadline::Endpoints::GetTask.build(context)
167
+ when :get_worker
168
+ Aws::Deadline::Endpoints::GetWorker.build(context)
169
+ when :list_available_metered_products
170
+ Aws::Deadline::Endpoints::ListAvailableMeteredProducts.build(context)
171
+ when :list_budgets
172
+ Aws::Deadline::Endpoints::ListBudgets.build(context)
173
+ when :list_farm_members
174
+ Aws::Deadline::Endpoints::ListFarmMembers.build(context)
175
+ when :list_farms
176
+ Aws::Deadline::Endpoints::ListFarms.build(context)
177
+ when :list_fleet_members
178
+ Aws::Deadline::Endpoints::ListFleetMembers.build(context)
179
+ when :list_fleets
180
+ Aws::Deadline::Endpoints::ListFleets.build(context)
181
+ when :list_job_members
182
+ Aws::Deadline::Endpoints::ListJobMembers.build(context)
183
+ when :list_jobs
184
+ Aws::Deadline::Endpoints::ListJobs.build(context)
185
+ when :list_license_endpoints
186
+ Aws::Deadline::Endpoints::ListLicenseEndpoints.build(context)
187
+ when :list_metered_products
188
+ Aws::Deadline::Endpoints::ListMeteredProducts.build(context)
189
+ when :list_monitors
190
+ Aws::Deadline::Endpoints::ListMonitors.build(context)
191
+ when :list_queue_environments
192
+ Aws::Deadline::Endpoints::ListQueueEnvironments.build(context)
193
+ when :list_queue_fleet_associations
194
+ Aws::Deadline::Endpoints::ListQueueFleetAssociations.build(context)
195
+ when :list_queue_members
196
+ Aws::Deadline::Endpoints::ListQueueMembers.build(context)
197
+ when :list_queues
198
+ Aws::Deadline::Endpoints::ListQueues.build(context)
199
+ when :list_session_actions
200
+ Aws::Deadline::Endpoints::ListSessionActions.build(context)
201
+ when :list_sessions
202
+ Aws::Deadline::Endpoints::ListSessions.build(context)
203
+ when :list_sessions_for_worker
204
+ Aws::Deadline::Endpoints::ListSessionsForWorker.build(context)
205
+ when :list_step_consumers
206
+ Aws::Deadline::Endpoints::ListStepConsumers.build(context)
207
+ when :list_step_dependencies
208
+ Aws::Deadline::Endpoints::ListStepDependencies.build(context)
209
+ when :list_steps
210
+ Aws::Deadline::Endpoints::ListSteps.build(context)
211
+ when :list_storage_profiles
212
+ Aws::Deadline::Endpoints::ListStorageProfiles.build(context)
213
+ when :list_storage_profiles_for_queue
214
+ Aws::Deadline::Endpoints::ListStorageProfilesForQueue.build(context)
215
+ when :list_tags_for_resource
216
+ Aws::Deadline::Endpoints::ListTagsForResource.build(context)
217
+ when :list_tasks
218
+ Aws::Deadline::Endpoints::ListTasks.build(context)
219
+ when :list_workers
220
+ Aws::Deadline::Endpoints::ListWorkers.build(context)
221
+ when :put_metered_product
222
+ Aws::Deadline::Endpoints::PutMeteredProduct.build(context)
223
+ when :search_jobs
224
+ Aws::Deadline::Endpoints::SearchJobs.build(context)
225
+ when :search_steps
226
+ Aws::Deadline::Endpoints::SearchSteps.build(context)
227
+ when :search_tasks
228
+ Aws::Deadline::Endpoints::SearchTasks.build(context)
229
+ when :search_workers
230
+ Aws::Deadline::Endpoints::SearchWorkers.build(context)
231
+ when :start_sessions_statistics_aggregation
232
+ Aws::Deadline::Endpoints::StartSessionsStatisticsAggregation.build(context)
233
+ when :tag_resource
234
+ Aws::Deadline::Endpoints::TagResource.build(context)
235
+ when :untag_resource
236
+ Aws::Deadline::Endpoints::UntagResource.build(context)
237
+ when :update_budget
238
+ Aws::Deadline::Endpoints::UpdateBudget.build(context)
239
+ when :update_farm
240
+ Aws::Deadline::Endpoints::UpdateFarm.build(context)
241
+ when :update_fleet
242
+ Aws::Deadline::Endpoints::UpdateFleet.build(context)
243
+ when :update_job
244
+ Aws::Deadline::Endpoints::UpdateJob.build(context)
245
+ when :update_monitor
246
+ Aws::Deadline::Endpoints::UpdateMonitor.build(context)
247
+ when :update_queue
248
+ Aws::Deadline::Endpoints::UpdateQueue.build(context)
249
+ when :update_queue_environment
250
+ Aws::Deadline::Endpoints::UpdateQueueEnvironment.build(context)
251
+ when :update_queue_fleet_association
252
+ Aws::Deadline::Endpoints::UpdateQueueFleetAssociation.build(context)
253
+ when :update_session
254
+ Aws::Deadline::Endpoints::UpdateSession.build(context)
255
+ when :update_step
256
+ Aws::Deadline::Endpoints::UpdateStep.build(context)
257
+ when :update_storage_profile
258
+ Aws::Deadline::Endpoints::UpdateStorageProfile.build(context)
259
+ when :update_task
260
+ Aws::Deadline::Endpoints::UpdateTask.build(context)
261
+ when :update_worker
262
+ Aws::Deadline::Endpoints::UpdateWorker.build(context)
263
+ when :update_worker_schedule
264
+ Aws::Deadline::Endpoints::UpdateWorkerSchedule.build(context)
265
+ end
266
+ end
267
+ end
268
+
269
+ def add_handlers(handlers, _config)
270
+ handlers.add(Handler, step: :build, priority: 75)
271
+ end
272
+ end
273
+ end
274
+ 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::Deadline
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