aws-sdk-qbusiness 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,206 @@
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::QBusiness
11
+
12
+ # When QBusiness returns an error response, the Ruby SDK constructs and raises an error.
13
+ # These errors all extend Aws::QBusiness::Errors::ServiceError < {Aws::Errors::ServiceError}
14
+ #
15
+ # You can rescue all QBusiness errors using ServiceError:
16
+ #
17
+ # begin
18
+ # # do stuff
19
+ # rescue Aws::QBusiness::Errors::ServiceError
20
+ # # rescues all QBusiness 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
+ # * {LicenseNotFoundException}
34
+ # * {ResourceNotFoundException}
35
+ # * {ServiceQuotaExceededException}
36
+ # * {ThrottlingException}
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::QBusiness::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::QBusiness::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
+
74
+ # @return [String]
75
+ def resource_id
76
+ @data[:resource_id]
77
+ end
78
+
79
+ # @return [String]
80
+ def resource_type
81
+ @data[:resource_type]
82
+ end
83
+ end
84
+
85
+ class InternalServerException < ServiceError
86
+
87
+ # @param [Seahorse::Client::RequestContext] context
88
+ # @param [String] message
89
+ # @param [Aws::QBusiness::Types::InternalServerException] data
90
+ def initialize(context, message, data = Aws::EmptyStructure.new)
91
+ super(context, message, data)
92
+ end
93
+
94
+ # @return [String]
95
+ def message
96
+ @message || @data[:message]
97
+ end
98
+ end
99
+
100
+ class LicenseNotFoundException < ServiceError
101
+
102
+ # @param [Seahorse::Client::RequestContext] context
103
+ # @param [String] message
104
+ # @param [Aws::QBusiness::Types::LicenseNotFoundException] data
105
+ def initialize(context, message, data = Aws::EmptyStructure.new)
106
+ super(context, message, data)
107
+ end
108
+
109
+ # @return [String]
110
+ def message
111
+ @message || @data[:message]
112
+ end
113
+ end
114
+
115
+ class ResourceNotFoundException < ServiceError
116
+
117
+ # @param [Seahorse::Client::RequestContext] context
118
+ # @param [String] message
119
+ # @param [Aws::QBusiness::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 message
126
+ @message || @data[:message]
127
+ end
128
+
129
+ # @return [String]
130
+ def resource_id
131
+ @data[:resource_id]
132
+ end
133
+
134
+ # @return [String]
135
+ def resource_type
136
+ @data[:resource_type]
137
+ end
138
+ end
139
+
140
+ class ServiceQuotaExceededException < ServiceError
141
+
142
+ # @param [Seahorse::Client::RequestContext] context
143
+ # @param [String] message
144
+ # @param [Aws::QBusiness::Types::ServiceQuotaExceededException] data
145
+ def initialize(context, message, data = Aws::EmptyStructure.new)
146
+ super(context, message, data)
147
+ end
148
+
149
+ # @return [String]
150
+ def message
151
+ @message || @data[:message]
152
+ end
153
+
154
+ # @return [String]
155
+ def resource_id
156
+ @data[:resource_id]
157
+ end
158
+
159
+ # @return [String]
160
+ def resource_type
161
+ @data[:resource_type]
162
+ end
163
+ end
164
+
165
+ class ThrottlingException < ServiceError
166
+
167
+ # @param [Seahorse::Client::RequestContext] context
168
+ # @param [String] message
169
+ # @param [Aws::QBusiness::Types::ThrottlingException] data
170
+ def initialize(context, message, data = Aws::EmptyStructure.new)
171
+ super(context, message, data)
172
+ end
173
+
174
+ # @return [String]
175
+ def message
176
+ @message || @data[:message]
177
+ end
178
+ end
179
+
180
+ class ValidationException < ServiceError
181
+
182
+ # @param [Seahorse::Client::RequestContext] context
183
+ # @param [String] message
184
+ # @param [Aws::QBusiness::Types::ValidationException] data
185
+ def initialize(context, message, data = Aws::EmptyStructure.new)
186
+ super(context, message, data)
187
+ end
188
+
189
+ # @return [String]
190
+ def fields
191
+ @data[:fields]
192
+ end
193
+
194
+ # @return [String]
195
+ def message
196
+ @message || @data[:message]
197
+ end
198
+
199
+ # @return [String]
200
+ def reason
201
+ @data[:reason]
202
+ end
203
+ end
204
+
205
+ end
206
+ end
@@ -0,0 +1,179 @@
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::QBusiness
12
+ module Plugins
13
+ class Endpoints < Seahorse::Client::Plugin
14
+ option(
15
+ :endpoint_provider,
16
+ doc_type: 'Aws::QBusiness::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::QBusiness::EndpointParameters`'
21
+ ) do |cfg|
22
+ Aws::QBusiness::EndpointProvider.new
23
+ end
24
+
25
+ # @api private
26
+ class Handler < Seahorse::Client::Handler
27
+ def call(context)
28
+ unless context[:discovered_endpoint]
29
+ params = parameters_for_operation(context)
30
+ endpoint = context.config.endpoint_provider.resolve_endpoint(params)
31
+
32
+ context.http_request.endpoint = endpoint.url
33
+ apply_endpoint_headers(context, endpoint.headers)
34
+
35
+ context[:endpoint_params] = params
36
+ context[:endpoint_properties] = endpoint.properties
37
+ end
38
+
39
+ context[:auth_scheme] =
40
+ Aws::Endpoints.resolve_auth_scheme(context, endpoint)
41
+
42
+ @handler.call(context)
43
+ end
44
+
45
+ private
46
+
47
+ def apply_endpoint_headers(context, headers)
48
+ headers.each do |key, values|
49
+ value = values
50
+ .compact
51
+ .map { |s| Seahorse::Util.escape_header_list_string(s.to_s) }
52
+ .join(',')
53
+
54
+ context.http_request.headers[key] = value
55
+ end
56
+ end
57
+
58
+ def parameters_for_operation(context)
59
+ case context.operation_name
60
+ when :batch_delete_document
61
+ Aws::QBusiness::Endpoints::BatchDeleteDocument.build(context)
62
+ when :batch_put_document
63
+ Aws::QBusiness::Endpoints::BatchPutDocument.build(context)
64
+ when :chat_sync
65
+ Aws::QBusiness::Endpoints::ChatSync.build(context)
66
+ when :create_application
67
+ Aws::QBusiness::Endpoints::CreateApplication.build(context)
68
+ when :create_data_source
69
+ Aws::QBusiness::Endpoints::CreateDataSource.build(context)
70
+ when :create_index
71
+ Aws::QBusiness::Endpoints::CreateIndex.build(context)
72
+ when :create_plugin
73
+ Aws::QBusiness::Endpoints::CreatePlugin.build(context)
74
+ when :create_retriever
75
+ Aws::QBusiness::Endpoints::CreateRetriever.build(context)
76
+ when :create_user
77
+ Aws::QBusiness::Endpoints::CreateUser.build(context)
78
+ when :create_web_experience
79
+ Aws::QBusiness::Endpoints::CreateWebExperience.build(context)
80
+ when :delete_application
81
+ Aws::QBusiness::Endpoints::DeleteApplication.build(context)
82
+ when :delete_chat_controls_configuration
83
+ Aws::QBusiness::Endpoints::DeleteChatControlsConfiguration.build(context)
84
+ when :delete_conversation
85
+ Aws::QBusiness::Endpoints::DeleteConversation.build(context)
86
+ when :delete_data_source
87
+ Aws::QBusiness::Endpoints::DeleteDataSource.build(context)
88
+ when :delete_group
89
+ Aws::QBusiness::Endpoints::DeleteGroup.build(context)
90
+ when :delete_index
91
+ Aws::QBusiness::Endpoints::DeleteIndex.build(context)
92
+ when :delete_plugin
93
+ Aws::QBusiness::Endpoints::DeletePlugin.build(context)
94
+ when :delete_retriever
95
+ Aws::QBusiness::Endpoints::DeleteRetriever.build(context)
96
+ when :delete_user
97
+ Aws::QBusiness::Endpoints::DeleteUser.build(context)
98
+ when :delete_web_experience
99
+ Aws::QBusiness::Endpoints::DeleteWebExperience.build(context)
100
+ when :get_application
101
+ Aws::QBusiness::Endpoints::GetApplication.build(context)
102
+ when :get_chat_controls_configuration
103
+ Aws::QBusiness::Endpoints::GetChatControlsConfiguration.build(context)
104
+ when :get_data_source
105
+ Aws::QBusiness::Endpoints::GetDataSource.build(context)
106
+ when :get_group
107
+ Aws::QBusiness::Endpoints::GetGroup.build(context)
108
+ when :get_index
109
+ Aws::QBusiness::Endpoints::GetIndex.build(context)
110
+ when :get_plugin
111
+ Aws::QBusiness::Endpoints::GetPlugin.build(context)
112
+ when :get_retriever
113
+ Aws::QBusiness::Endpoints::GetRetriever.build(context)
114
+ when :get_user
115
+ Aws::QBusiness::Endpoints::GetUser.build(context)
116
+ when :get_web_experience
117
+ Aws::QBusiness::Endpoints::GetWebExperience.build(context)
118
+ when :list_applications
119
+ Aws::QBusiness::Endpoints::ListApplications.build(context)
120
+ when :list_conversations
121
+ Aws::QBusiness::Endpoints::ListConversations.build(context)
122
+ when :list_data_source_sync_jobs
123
+ Aws::QBusiness::Endpoints::ListDataSourceSyncJobs.build(context)
124
+ when :list_data_sources
125
+ Aws::QBusiness::Endpoints::ListDataSources.build(context)
126
+ when :list_documents
127
+ Aws::QBusiness::Endpoints::ListDocuments.build(context)
128
+ when :list_groups
129
+ Aws::QBusiness::Endpoints::ListGroups.build(context)
130
+ when :list_indices
131
+ Aws::QBusiness::Endpoints::ListIndices.build(context)
132
+ when :list_messages
133
+ Aws::QBusiness::Endpoints::ListMessages.build(context)
134
+ when :list_plugins
135
+ Aws::QBusiness::Endpoints::ListPlugins.build(context)
136
+ when :list_retrievers
137
+ Aws::QBusiness::Endpoints::ListRetrievers.build(context)
138
+ when :list_tags_for_resource
139
+ Aws::QBusiness::Endpoints::ListTagsForResource.build(context)
140
+ when :list_web_experiences
141
+ Aws::QBusiness::Endpoints::ListWebExperiences.build(context)
142
+ when :put_feedback
143
+ Aws::QBusiness::Endpoints::PutFeedback.build(context)
144
+ when :put_group
145
+ Aws::QBusiness::Endpoints::PutGroup.build(context)
146
+ when :start_data_source_sync_job
147
+ Aws::QBusiness::Endpoints::StartDataSourceSyncJob.build(context)
148
+ when :stop_data_source_sync_job
149
+ Aws::QBusiness::Endpoints::StopDataSourceSyncJob.build(context)
150
+ when :tag_resource
151
+ Aws::QBusiness::Endpoints::TagResource.build(context)
152
+ when :untag_resource
153
+ Aws::QBusiness::Endpoints::UntagResource.build(context)
154
+ when :update_application
155
+ Aws::QBusiness::Endpoints::UpdateApplication.build(context)
156
+ when :update_chat_controls_configuration
157
+ Aws::QBusiness::Endpoints::UpdateChatControlsConfiguration.build(context)
158
+ when :update_data_source
159
+ Aws::QBusiness::Endpoints::UpdateDataSource.build(context)
160
+ when :update_index
161
+ Aws::QBusiness::Endpoints::UpdateIndex.build(context)
162
+ when :update_plugin
163
+ Aws::QBusiness::Endpoints::UpdatePlugin.build(context)
164
+ when :update_retriever
165
+ Aws::QBusiness::Endpoints::UpdateRetriever.build(context)
166
+ when :update_user
167
+ Aws::QBusiness::Endpoints::UpdateUser.build(context)
168
+ when :update_web_experience
169
+ Aws::QBusiness::Endpoints::UpdateWebExperience.build(context)
170
+ end
171
+ end
172
+ end
173
+
174
+ def add_handlers(handlers, _config)
175
+ handlers.add(Handler, step: :build, priority: 75)
176
+ end
177
+ end
178
+ end
179
+ 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::QBusiness
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