aws-sdk-datazone 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,174 @@
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::DataZone
11
+
12
+ # When DataZone returns an error response, the Ruby SDK constructs and raises an error.
13
+ # These errors all extend Aws::DataZone::Errors::ServiceError < {Aws::Errors::ServiceError}
14
+ #
15
+ # You can rescue all DataZone errors using ServiceError:
16
+ #
17
+ # begin
18
+ # # do stuff
19
+ # rescue Aws::DataZone::Errors::ServiceError
20
+ # # rescues all DataZone 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
+ # * {UnauthorizedException}
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::DataZone::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 message
56
+ @message || @data[:message]
57
+ end
58
+ end
59
+
60
+ class ConflictException < ServiceError
61
+
62
+ # @param [Seahorse::Client::RequestContext] context
63
+ # @param [String] message
64
+ # @param [Aws::DataZone::Types::ConflictException] data
65
+ def initialize(context, message, data = Aws::EmptyStructure.new)
66
+ super(context, message, data)
67
+ end
68
+
69
+ # @return [String]
70
+ def message
71
+ @message || @data[:message]
72
+ end
73
+ end
74
+
75
+ class InternalServerException < ServiceError
76
+
77
+ # @param [Seahorse::Client::RequestContext] context
78
+ # @param [String] message
79
+ # @param [Aws::DataZone::Types::InternalServerException] data
80
+ def initialize(context, message, data = Aws::EmptyStructure.new)
81
+ super(context, message, data)
82
+ end
83
+
84
+ # @return [String]
85
+ def message
86
+ @message || @data[:message]
87
+ end
88
+
89
+ def retryable?
90
+ true
91
+ end
92
+ end
93
+
94
+ class ResourceNotFoundException < ServiceError
95
+
96
+ # @param [Seahorse::Client::RequestContext] context
97
+ # @param [String] message
98
+ # @param [Aws::DataZone::Types::ResourceNotFoundException] data
99
+ def initialize(context, message, data = Aws::EmptyStructure.new)
100
+ super(context, message, data)
101
+ end
102
+
103
+ # @return [String]
104
+ def message
105
+ @message || @data[:message]
106
+ end
107
+ end
108
+
109
+ class ServiceQuotaExceededException < ServiceError
110
+
111
+ # @param [Seahorse::Client::RequestContext] context
112
+ # @param [String] message
113
+ # @param [Aws::DataZone::Types::ServiceQuotaExceededException] data
114
+ def initialize(context, message, data = Aws::EmptyStructure.new)
115
+ super(context, message, data)
116
+ end
117
+
118
+ # @return [String]
119
+ def message
120
+ @message || @data[:message]
121
+ end
122
+ end
123
+
124
+ class ThrottlingException < ServiceError
125
+
126
+ # @param [Seahorse::Client::RequestContext] context
127
+ # @param [String] message
128
+ # @param [Aws::DataZone::Types::ThrottlingException] data
129
+ def initialize(context, message, data = Aws::EmptyStructure.new)
130
+ super(context, message, data)
131
+ end
132
+
133
+ # @return [String]
134
+ def message
135
+ @message || @data[:message]
136
+ end
137
+
138
+ def retryable?
139
+ true
140
+ end
141
+ end
142
+
143
+ class UnauthorizedException < ServiceError
144
+
145
+ # @param [Seahorse::Client::RequestContext] context
146
+ # @param [String] message
147
+ # @param [Aws::DataZone::Types::UnauthorizedException] data
148
+ def initialize(context, message, data = Aws::EmptyStructure.new)
149
+ super(context, message, data)
150
+ end
151
+
152
+ # @return [String]
153
+ def message
154
+ @message || @data[:message]
155
+ end
156
+ end
157
+
158
+ class ValidationException < ServiceError
159
+
160
+ # @param [Seahorse::Client::RequestContext] context
161
+ # @param [String] message
162
+ # @param [Aws::DataZone::Types::ValidationException] data
163
+ def initialize(context, message, data = Aws::EmptyStructure.new)
164
+ super(context, message, data)
165
+ end
166
+
167
+ # @return [String]
168
+ def message
169
+ @message || @data[:message]
170
+ end
171
+ end
172
+
173
+ end
174
+ end
@@ -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
+
11
+ module Aws::DataZone
12
+ module Plugins
13
+ class Endpoints < Seahorse::Client::Plugin
14
+ option(
15
+ :endpoint_provider,
16
+ doc_type: 'Aws::DataZone::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::DataZone::EndpointParameters`'
21
+ ) do |cfg|
22
+ Aws::DataZone::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 :accept_predictions
60
+ Aws::DataZone::Endpoints::AcceptPredictions.build(context)
61
+ when :accept_subscription_request
62
+ Aws::DataZone::Endpoints::AcceptSubscriptionRequest.build(context)
63
+ when :cancel_subscription
64
+ Aws::DataZone::Endpoints::CancelSubscription.build(context)
65
+ when :create_asset
66
+ Aws::DataZone::Endpoints::CreateAsset.build(context)
67
+ when :create_asset_revision
68
+ Aws::DataZone::Endpoints::CreateAssetRevision.build(context)
69
+ when :create_asset_type
70
+ Aws::DataZone::Endpoints::CreateAssetType.build(context)
71
+ when :create_data_source
72
+ Aws::DataZone::Endpoints::CreateDataSource.build(context)
73
+ when :create_domain
74
+ Aws::DataZone::Endpoints::CreateDomain.build(context)
75
+ when :create_environment
76
+ Aws::DataZone::Endpoints::CreateEnvironment.build(context)
77
+ when :create_environment_profile
78
+ Aws::DataZone::Endpoints::CreateEnvironmentProfile.build(context)
79
+ when :create_form_type
80
+ Aws::DataZone::Endpoints::CreateFormType.build(context)
81
+ when :create_glossary
82
+ Aws::DataZone::Endpoints::CreateGlossary.build(context)
83
+ when :create_glossary_term
84
+ Aws::DataZone::Endpoints::CreateGlossaryTerm.build(context)
85
+ when :create_group_profile
86
+ Aws::DataZone::Endpoints::CreateGroupProfile.build(context)
87
+ when :create_listing_change_set
88
+ Aws::DataZone::Endpoints::CreateListingChangeSet.build(context)
89
+ when :create_project
90
+ Aws::DataZone::Endpoints::CreateProject.build(context)
91
+ when :create_project_membership
92
+ Aws::DataZone::Endpoints::CreateProjectMembership.build(context)
93
+ when :create_subscription_grant
94
+ Aws::DataZone::Endpoints::CreateSubscriptionGrant.build(context)
95
+ when :create_subscription_request
96
+ Aws::DataZone::Endpoints::CreateSubscriptionRequest.build(context)
97
+ when :create_subscription_target
98
+ Aws::DataZone::Endpoints::CreateSubscriptionTarget.build(context)
99
+ when :create_user_profile
100
+ Aws::DataZone::Endpoints::CreateUserProfile.build(context)
101
+ when :delete_asset
102
+ Aws::DataZone::Endpoints::DeleteAsset.build(context)
103
+ when :delete_asset_type
104
+ Aws::DataZone::Endpoints::DeleteAssetType.build(context)
105
+ when :delete_data_source
106
+ Aws::DataZone::Endpoints::DeleteDataSource.build(context)
107
+ when :delete_domain
108
+ Aws::DataZone::Endpoints::DeleteDomain.build(context)
109
+ when :delete_environment
110
+ Aws::DataZone::Endpoints::DeleteEnvironment.build(context)
111
+ when :delete_environment_blueprint_configuration
112
+ Aws::DataZone::Endpoints::DeleteEnvironmentBlueprintConfiguration.build(context)
113
+ when :delete_environment_profile
114
+ Aws::DataZone::Endpoints::DeleteEnvironmentProfile.build(context)
115
+ when :delete_form_type
116
+ Aws::DataZone::Endpoints::DeleteFormType.build(context)
117
+ when :delete_glossary
118
+ Aws::DataZone::Endpoints::DeleteGlossary.build(context)
119
+ when :delete_glossary_term
120
+ Aws::DataZone::Endpoints::DeleteGlossaryTerm.build(context)
121
+ when :delete_listing
122
+ Aws::DataZone::Endpoints::DeleteListing.build(context)
123
+ when :delete_project
124
+ Aws::DataZone::Endpoints::DeleteProject.build(context)
125
+ when :delete_project_membership
126
+ Aws::DataZone::Endpoints::DeleteProjectMembership.build(context)
127
+ when :delete_subscription_grant
128
+ Aws::DataZone::Endpoints::DeleteSubscriptionGrant.build(context)
129
+ when :delete_subscription_request
130
+ Aws::DataZone::Endpoints::DeleteSubscriptionRequest.build(context)
131
+ when :delete_subscription_target
132
+ Aws::DataZone::Endpoints::DeleteSubscriptionTarget.build(context)
133
+ when :get_asset
134
+ Aws::DataZone::Endpoints::GetAsset.build(context)
135
+ when :get_asset_type
136
+ Aws::DataZone::Endpoints::GetAssetType.build(context)
137
+ when :get_data_source
138
+ Aws::DataZone::Endpoints::GetDataSource.build(context)
139
+ when :get_data_source_run
140
+ Aws::DataZone::Endpoints::GetDataSourceRun.build(context)
141
+ when :get_domain
142
+ Aws::DataZone::Endpoints::GetDomain.build(context)
143
+ when :get_environment
144
+ Aws::DataZone::Endpoints::GetEnvironment.build(context)
145
+ when :get_environment_blueprint
146
+ Aws::DataZone::Endpoints::GetEnvironmentBlueprint.build(context)
147
+ when :get_environment_blueprint_configuration
148
+ Aws::DataZone::Endpoints::GetEnvironmentBlueprintConfiguration.build(context)
149
+ when :get_environment_profile
150
+ Aws::DataZone::Endpoints::GetEnvironmentProfile.build(context)
151
+ when :get_form_type
152
+ Aws::DataZone::Endpoints::GetFormType.build(context)
153
+ when :get_glossary
154
+ Aws::DataZone::Endpoints::GetGlossary.build(context)
155
+ when :get_glossary_term
156
+ Aws::DataZone::Endpoints::GetGlossaryTerm.build(context)
157
+ when :get_group_profile
158
+ Aws::DataZone::Endpoints::GetGroupProfile.build(context)
159
+ when :get_iam_portal_login_url
160
+ Aws::DataZone::Endpoints::GetIamPortalLoginUrl.build(context)
161
+ when :get_listing
162
+ Aws::DataZone::Endpoints::GetListing.build(context)
163
+ when :get_project
164
+ Aws::DataZone::Endpoints::GetProject.build(context)
165
+ when :get_subscription
166
+ Aws::DataZone::Endpoints::GetSubscription.build(context)
167
+ when :get_subscription_grant
168
+ Aws::DataZone::Endpoints::GetSubscriptionGrant.build(context)
169
+ when :get_subscription_request_details
170
+ Aws::DataZone::Endpoints::GetSubscriptionRequestDetails.build(context)
171
+ when :get_subscription_target
172
+ Aws::DataZone::Endpoints::GetSubscriptionTarget.build(context)
173
+ when :get_user_profile
174
+ Aws::DataZone::Endpoints::GetUserProfile.build(context)
175
+ when :list_asset_revisions
176
+ Aws::DataZone::Endpoints::ListAssetRevisions.build(context)
177
+ when :list_data_source_run_activities
178
+ Aws::DataZone::Endpoints::ListDataSourceRunActivities.build(context)
179
+ when :list_data_source_runs
180
+ Aws::DataZone::Endpoints::ListDataSourceRuns.build(context)
181
+ when :list_data_sources
182
+ Aws::DataZone::Endpoints::ListDataSources.build(context)
183
+ when :list_domains
184
+ Aws::DataZone::Endpoints::ListDomains.build(context)
185
+ when :list_environment_blueprint_configurations
186
+ Aws::DataZone::Endpoints::ListEnvironmentBlueprintConfigurations.build(context)
187
+ when :list_environment_blueprints
188
+ Aws::DataZone::Endpoints::ListEnvironmentBlueprints.build(context)
189
+ when :list_environment_profiles
190
+ Aws::DataZone::Endpoints::ListEnvironmentProfiles.build(context)
191
+ when :list_environments
192
+ Aws::DataZone::Endpoints::ListEnvironments.build(context)
193
+ when :list_notifications
194
+ Aws::DataZone::Endpoints::ListNotifications.build(context)
195
+ when :list_project_memberships
196
+ Aws::DataZone::Endpoints::ListProjectMemberships.build(context)
197
+ when :list_projects
198
+ Aws::DataZone::Endpoints::ListProjects.build(context)
199
+ when :list_subscription_grants
200
+ Aws::DataZone::Endpoints::ListSubscriptionGrants.build(context)
201
+ when :list_subscription_requests
202
+ Aws::DataZone::Endpoints::ListSubscriptionRequests.build(context)
203
+ when :list_subscription_targets
204
+ Aws::DataZone::Endpoints::ListSubscriptionTargets.build(context)
205
+ when :list_subscriptions
206
+ Aws::DataZone::Endpoints::ListSubscriptions.build(context)
207
+ when :list_tags_for_resource
208
+ Aws::DataZone::Endpoints::ListTagsForResource.build(context)
209
+ when :put_environment_blueprint_configuration
210
+ Aws::DataZone::Endpoints::PutEnvironmentBlueprintConfiguration.build(context)
211
+ when :reject_predictions
212
+ Aws::DataZone::Endpoints::RejectPredictions.build(context)
213
+ when :reject_subscription_request
214
+ Aws::DataZone::Endpoints::RejectSubscriptionRequest.build(context)
215
+ when :revoke_subscription
216
+ Aws::DataZone::Endpoints::RevokeSubscription.build(context)
217
+ when :search
218
+ Aws::DataZone::Endpoints::Search.build(context)
219
+ when :search_group_profiles
220
+ Aws::DataZone::Endpoints::SearchGroupProfiles.build(context)
221
+ when :search_listings
222
+ Aws::DataZone::Endpoints::SearchListings.build(context)
223
+ when :search_types
224
+ Aws::DataZone::Endpoints::SearchTypes.build(context)
225
+ when :search_user_profiles
226
+ Aws::DataZone::Endpoints::SearchUserProfiles.build(context)
227
+ when :start_data_source_run
228
+ Aws::DataZone::Endpoints::StartDataSourceRun.build(context)
229
+ when :tag_resource
230
+ Aws::DataZone::Endpoints::TagResource.build(context)
231
+ when :untag_resource
232
+ Aws::DataZone::Endpoints::UntagResource.build(context)
233
+ when :update_data_source
234
+ Aws::DataZone::Endpoints::UpdateDataSource.build(context)
235
+ when :update_domain
236
+ Aws::DataZone::Endpoints::UpdateDomain.build(context)
237
+ when :update_environment
238
+ Aws::DataZone::Endpoints::UpdateEnvironment.build(context)
239
+ when :update_environment_profile
240
+ Aws::DataZone::Endpoints::UpdateEnvironmentProfile.build(context)
241
+ when :update_glossary
242
+ Aws::DataZone::Endpoints::UpdateGlossary.build(context)
243
+ when :update_glossary_term
244
+ Aws::DataZone::Endpoints::UpdateGlossaryTerm.build(context)
245
+ when :update_group_profile
246
+ Aws::DataZone::Endpoints::UpdateGroupProfile.build(context)
247
+ when :update_project
248
+ Aws::DataZone::Endpoints::UpdateProject.build(context)
249
+ when :update_subscription_grant_status
250
+ Aws::DataZone::Endpoints::UpdateSubscriptionGrantStatus.build(context)
251
+ when :update_subscription_request
252
+ Aws::DataZone::Endpoints::UpdateSubscriptionRequest.build(context)
253
+ when :update_subscription_target
254
+ Aws::DataZone::Endpoints::UpdateSubscriptionTarget.build(context)
255
+ when :update_user_profile
256
+ Aws::DataZone::Endpoints::UpdateUserProfile.build(context)
257
+ end
258
+ end
259
+ end
260
+
261
+ def add_handlers(handlers, _config)
262
+ handlers.add(Handler, step: :build, priority: 75)
263
+ end
264
+ end
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::DataZone
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