aws-sdk-translate 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: d0e241b3f82d92681d3e942d298145a0e36f47e5
4
+ data.tar.gz: 5185c48579a5f4ed2b99839c620f66f8331990de
5
+ SHA512:
6
+ metadata.gz: ad889caf35dbadac3c3ab9807f8de93cff3b870c2a1b1270bde6932e38c954fa21c2b4d574754b5c8c06dab30462b58d3bc33f5b1490b19586c4422f5e138a4b
7
+ data.tar.gz: c301dbfc155b8c03097120fc260dc8aa1080335c10378eb14a4d29d91a9aeccd6472df2520a34473b7dbb33b38216968ee0163ba1fc39c9121bd5f33b68a0057
@@ -0,0 +1,47 @@
1
+ # WARNING ABOUT GENERATED CODE
2
+ #
3
+ # This file is generated. See the contributing guide for more information:
4
+ # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
5
+ #
6
+ # WARNING ABOUT GENERATED CODE
7
+
8
+ require 'aws-sdk-core'
9
+ require 'aws-sigv4'
10
+
11
+ require_relative 'aws-sdk-translate/types'
12
+ require_relative 'aws-sdk-translate/client_api'
13
+ require_relative 'aws-sdk-translate/client'
14
+ require_relative 'aws-sdk-translate/errors'
15
+ require_relative 'aws-sdk-translate/resource'
16
+ require_relative 'aws-sdk-translate/customizations'
17
+
18
+ # This module provides support for Amazon Translate. This module is available in the
19
+ # `aws-sdk-translate` gem.
20
+ #
21
+ # # Client
22
+ #
23
+ # The {Client} class provides one method for each API operation. Operation
24
+ # methods each accept a hash of request parameters and return a response
25
+ # structure.
26
+ #
27
+ # See {Client} for more information.
28
+ #
29
+ # # Errors
30
+ #
31
+ # Errors returned from Amazon Translate all
32
+ # extend {Errors::ServiceError}.
33
+ #
34
+ # begin
35
+ # # do stuff
36
+ # rescue Aws::Translate::Errors::ServiceError
37
+ # # rescues all service API errors
38
+ # end
39
+ #
40
+ # See {Errors} for more information.
41
+ #
42
+ # @service
43
+ module Aws::Translate
44
+
45
+ GEM_VERSION = '1.0.0'
46
+
47
+ end
@@ -0,0 +1,251 @@
1
+ # WARNING ABOUT GENERATED CODE
2
+ #
3
+ # This file is generated. See the contributing guide for more information:
4
+ # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
5
+ #
6
+ # WARNING ABOUT GENERATED CODE
7
+
8
+ require 'seahorse/client/plugins/content_length.rb'
9
+ require 'aws-sdk-core/plugins/credentials_configuration.rb'
10
+ require 'aws-sdk-core/plugins/logging.rb'
11
+ require 'aws-sdk-core/plugins/param_converter.rb'
12
+ require 'aws-sdk-core/plugins/param_validator.rb'
13
+ require 'aws-sdk-core/plugins/user_agent.rb'
14
+ require 'aws-sdk-core/plugins/helpful_socket_errors.rb'
15
+ require 'aws-sdk-core/plugins/retry_errors.rb'
16
+ require 'aws-sdk-core/plugins/global_configuration.rb'
17
+ require 'aws-sdk-core/plugins/regional_endpoint.rb'
18
+ require 'aws-sdk-core/plugins/response_paging.rb'
19
+ require 'aws-sdk-core/plugins/stub_responses.rb'
20
+ require 'aws-sdk-core/plugins/idempotency_token.rb'
21
+ require 'aws-sdk-core/plugins/jsonvalue_converter.rb'
22
+ require 'aws-sdk-core/plugins/signature_v4.rb'
23
+ require 'aws-sdk-core/plugins/protocols/json_rpc.rb'
24
+
25
+ Aws::Plugins::GlobalConfiguration.add_identifier(:translate)
26
+
27
+ module Aws::Translate
28
+ class Client < Seahorse::Client::Base
29
+
30
+ include Aws::ClientStubs
31
+
32
+ @identifier = :translate
33
+
34
+ set_api(ClientApi::API)
35
+
36
+ add_plugin(Seahorse::Client::Plugins::ContentLength)
37
+ add_plugin(Aws::Plugins::CredentialsConfiguration)
38
+ add_plugin(Aws::Plugins::Logging)
39
+ add_plugin(Aws::Plugins::ParamConverter)
40
+ add_plugin(Aws::Plugins::ParamValidator)
41
+ add_plugin(Aws::Plugins::UserAgent)
42
+ add_plugin(Aws::Plugins::HelpfulSocketErrors)
43
+ add_plugin(Aws::Plugins::RetryErrors)
44
+ add_plugin(Aws::Plugins::GlobalConfiguration)
45
+ add_plugin(Aws::Plugins::RegionalEndpoint)
46
+ add_plugin(Aws::Plugins::ResponsePaging)
47
+ add_plugin(Aws::Plugins::StubResponses)
48
+ add_plugin(Aws::Plugins::IdempotencyToken)
49
+ add_plugin(Aws::Plugins::JsonvalueConverter)
50
+ add_plugin(Aws::Plugins::SignatureV4)
51
+ add_plugin(Aws::Plugins::Protocols::JsonRpc)
52
+
53
+ # @option options [required, Aws::CredentialProvider] :credentials
54
+ # Your AWS credentials. This can be an instance of any one of the
55
+ # following classes:
56
+ #
57
+ # * `Aws::Credentials` - Used for configuring static, non-refreshing
58
+ # credentials.
59
+ #
60
+ # * `Aws::InstanceProfileCredentials` - Used for loading credentials
61
+ # from an EC2 IMDS on an EC2 instance.
62
+ #
63
+ # * `Aws::SharedCredentials` - Used for loading credentials from a
64
+ # shared file, such as `~/.aws/config`.
65
+ #
66
+ # * `Aws::AssumeRoleCredentials` - Used when you need to assume a role.
67
+ #
68
+ # When `:credentials` are not configured directly, the following
69
+ # locations will be searched for credentials:
70
+ #
71
+ # * `Aws.config[:credentials]`
72
+ # * The `:access_key_id`, `:secret_access_key`, and `:session_token` options.
73
+ # * ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY']
74
+ # * `~/.aws/credentials`
75
+ # * `~/.aws/config`
76
+ # * EC2 IMDS instance profile - When used by default, the timeouts are
77
+ # very aggressive. Construct and pass an instance of
78
+ # `Aws::InstanceProfileCredentails` to enable retries and extended
79
+ # timeouts.
80
+ #
81
+ # @option options [required, String] :region
82
+ # The AWS region to connect to. The configured `:region` is
83
+ # used to determine the service `:endpoint`. When not passed,
84
+ # a default `:region` is search for in the following locations:
85
+ #
86
+ # * `Aws.config[:region]`
87
+ # * `ENV['AWS_REGION']`
88
+ # * `ENV['AMAZON_REGION']`
89
+ # * `ENV['AWS_DEFAULT_REGION']`
90
+ # * `~/.aws/credentials`
91
+ # * `~/.aws/config`
92
+ #
93
+ # @option options [String] :access_key_id
94
+ #
95
+ # @option options [Boolean] :convert_params (true)
96
+ # When `true`, an attempt is made to coerce request parameters into
97
+ # the required types.
98
+ #
99
+ # @option options [String] :endpoint
100
+ # The client endpoint is normally constructed from the `:region`
101
+ # option. You should only configure an `:endpoint` when connecting
102
+ # to test endpoints. This should be avalid HTTP(S) URI.
103
+ #
104
+ # @option options [Aws::Log::Formatter] :log_formatter (Aws::Log::Formatter.default)
105
+ # The log formatter.
106
+ #
107
+ # @option options [Symbol] :log_level (:info)
108
+ # The log level to send messages to the `:logger` at.
109
+ #
110
+ # @option options [Logger] :logger
111
+ # The Logger instance to send log messages to. If this option
112
+ # is not set, logging will be disabled.
113
+ #
114
+ # @option options [String] :profile ("default")
115
+ # Used when loading credentials from the shared credentials file
116
+ # at HOME/.aws/credentials. When not specified, 'default' is used.
117
+ #
118
+ # @option options [Integer] :retry_limit (3)
119
+ # The maximum number of times to retry failed requests. Only
120
+ # ~ 500 level server errors and certain ~ 400 level client errors
121
+ # are retried. Generally, these are throttling errors, data
122
+ # checksum errors, networking errors, timeout errors and auth
123
+ # errors from expired credentials.
124
+ #
125
+ # @option options [String] :secret_access_key
126
+ #
127
+ # @option options [String] :session_token
128
+ #
129
+ # @option options [Boolean] :simple_json (false)
130
+ # Disables request parameter conversion, validation, and formatting.
131
+ # Also disable response data type conversions. This option is useful
132
+ # when you want to ensure the highest level of performance by
133
+ # avoiding overhead of walking request parameters and response data
134
+ # structures.
135
+ #
136
+ # When `:simple_json` is enabled, the request parameters hash must
137
+ # be formatted exactly as the DynamoDB API expects.
138
+ #
139
+ # @option options [Boolean] :stub_responses (false)
140
+ # Causes the client to return stubbed responses. By default
141
+ # fake responses are generated and returned. You can specify
142
+ # the response data to return or errors to raise by calling
143
+ # {ClientStubs#stub_responses}. See {ClientStubs} for more information.
144
+ #
145
+ # ** Please note ** When response stubbing is enabled, no HTTP
146
+ # requests are made, and retries are disabled.
147
+ #
148
+ # @option options [Boolean] :validate_params (true)
149
+ # When `true`, request parameters are validated before
150
+ # sending the request.
151
+ #
152
+ def initialize(*args)
153
+ super
154
+ end
155
+
156
+ # @!group API Operations
157
+
158
+ # Translates input text from the source language to the target language.
159
+ # You can translate between English (en) and one of the following
160
+ # languages, or between one of the following languages and English.
161
+ #
162
+ # * Arabic (ar)
163
+ #
164
+ # * Chinese (Simplified) (zh)
165
+ #
166
+ # * French (fr)
167
+ #
168
+ # * German (de)
169
+ #
170
+ # * Portuguese (pt)
171
+ #
172
+ # * Spanish (es)
173
+ #
174
+ # @option params [required, String] :text
175
+ # The text to translate.
176
+ #
177
+ # @option params [required, String] :source_language_code
178
+ # One of the supported language codes for the source text. If the
179
+ # `TargetLanguageCode` is not "en", the `SourceLanguageCode` must be
180
+ # "en".
181
+ #
182
+ # @option params [required, String] :target_language_code
183
+ # One of the supported language codes for the target text. If the
184
+ # `SourceLanguageCode` is not "en", the `TargetLanguageCode` must be
185
+ # "en".
186
+ #
187
+ # @return [Types::TranslateTextResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
188
+ #
189
+ # * {Types::TranslateTextResponse#translated_text #translated_text} => String
190
+ # * {Types::TranslateTextResponse#source_language_code #source_language_code} => String
191
+ # * {Types::TranslateTextResponse#target_language_code #target_language_code} => String
192
+ #
193
+ # @example Request syntax with placeholder values
194
+ #
195
+ # resp = client.translate_text({
196
+ # text: "BoundedLengthString", # required
197
+ # source_language_code: "LanguageCodeString", # required
198
+ # target_language_code: "LanguageCodeString", # required
199
+ # })
200
+ #
201
+ # @example Response structure
202
+ #
203
+ # resp.translated_text #=> String
204
+ # resp.source_language_code #=> String
205
+ # resp.target_language_code #=> String
206
+ #
207
+ # @see http://docs.aws.amazon.com/goto/WebAPI/translate-2017-07-01/TranslateText AWS API Documentation
208
+ #
209
+ # @overload translate_text(params = {})
210
+ # @param [Hash] params ({})
211
+ def translate_text(params = {}, options = {})
212
+ req = build_request(:translate_text, params)
213
+ req.send_request(options)
214
+ end
215
+
216
+ # @!endgroup
217
+
218
+ # @param params ({})
219
+ # @api private
220
+ def build_request(operation_name, params = {})
221
+ handlers = @handlers.for(operation_name)
222
+ context = Seahorse::Client::RequestContext.new(
223
+ operation_name: operation_name,
224
+ operation: config.api.operation(operation_name),
225
+ client: self,
226
+ params: params,
227
+ config: config)
228
+ context[:gem_name] = 'aws-sdk-translate'
229
+ context[:gem_version] = '1.0.0'
230
+ Seahorse::Client::Request.new(handlers, context)
231
+ end
232
+
233
+ # @api private
234
+ # @deprecated
235
+ def waiter_names
236
+ []
237
+ end
238
+
239
+ class << self
240
+
241
+ # @api private
242
+ attr_reader :identifier
243
+
244
+ # @api private
245
+ def errors_module
246
+ Errors
247
+ end
248
+
249
+ end
250
+ end
251
+ end
@@ -0,0 +1,68 @@
1
+ # WARNING ABOUT GENERATED CODE
2
+ #
3
+ # This file is generated. See the contributing guide for more information:
4
+ # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
5
+ #
6
+ # WARNING ABOUT GENERATED CODE
7
+
8
+ module Aws::Translate
9
+ # @api private
10
+ module ClientApi
11
+
12
+ include Seahorse::Model
13
+
14
+ BoundedLengthString = Shapes::StringShape.new(name: 'BoundedLengthString')
15
+ InternalServerException = Shapes::StructureShape.new(name: 'InternalServerException')
16
+ InvalidRequestException = Shapes::StructureShape.new(name: 'InvalidRequestException')
17
+ LanguageCodeString = Shapes::StringShape.new(name: 'LanguageCodeString')
18
+ ServiceUnavailableException = Shapes::StructureShape.new(name: 'ServiceUnavailableException')
19
+ String = Shapes::StringShape.new(name: 'String')
20
+ TextSizeLimitExceededException = Shapes::StructureShape.new(name: 'TextSizeLimitExceededException')
21
+ TooManyRequestsException = Shapes::StructureShape.new(name: 'TooManyRequestsException')
22
+ TranslateTextRequest = Shapes::StructureShape.new(name: 'TranslateTextRequest')
23
+ TranslateTextResponse = Shapes::StructureShape.new(name: 'TranslateTextResponse')
24
+ UnsupportedLanguagePairException = Shapes::StructureShape.new(name: 'UnsupportedLanguagePairException')
25
+
26
+ TranslateTextRequest.add_member(:text, Shapes::ShapeRef.new(shape: BoundedLengthString, required: true, location_name: "Text"))
27
+ TranslateTextRequest.add_member(:source_language_code, Shapes::ShapeRef.new(shape: LanguageCodeString, required: true, location_name: "SourceLanguageCode"))
28
+ TranslateTextRequest.add_member(:target_language_code, Shapes::ShapeRef.new(shape: LanguageCodeString, required: true, location_name: "TargetLanguageCode"))
29
+ TranslateTextRequest.struct_class = Types::TranslateTextRequest
30
+
31
+ TranslateTextResponse.add_member(:translated_text, Shapes::ShapeRef.new(shape: String, required: true, location_name: "TranslatedText"))
32
+ TranslateTextResponse.add_member(:source_language_code, Shapes::ShapeRef.new(shape: LanguageCodeString, required: true, location_name: "SourceLanguageCode"))
33
+ TranslateTextResponse.add_member(:target_language_code, Shapes::ShapeRef.new(shape: LanguageCodeString, required: true, location_name: "TargetLanguageCode"))
34
+ TranslateTextResponse.struct_class = Types::TranslateTextResponse
35
+
36
+
37
+ # @api private
38
+ API = Seahorse::Model::Api.new.tap do |api|
39
+
40
+ api.version = "2017-07-01"
41
+
42
+ api.metadata = {
43
+ "endpointPrefix" => "translate",
44
+ "jsonVersion" => "1.1",
45
+ "protocol" => "json",
46
+ "serviceFullName" => "Amazon Translate",
47
+ "signatureVersion" => "v4",
48
+ "signingName" => "translate",
49
+ "targetPrefix" => "AWSShineFrontendService_20170701",
50
+ }
51
+
52
+ api.add_operation(:translate_text, Seahorse::Model::Operation.new.tap do |o|
53
+ o.name = "TranslateText"
54
+ o.http_method = "POST"
55
+ o.http_request_uri = "/"
56
+ o.input = Shapes::ShapeRef.new(shape: TranslateTextRequest)
57
+ o.output = Shapes::ShapeRef.new(shape: TranslateTextResponse)
58
+ o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
59
+ o.errors << Shapes::ShapeRef.new(shape: TextSizeLimitExceededException)
60
+ o.errors << Shapes::ShapeRef.new(shape: TooManyRequestsException)
61
+ o.errors << Shapes::ShapeRef.new(shape: UnsupportedLanguagePairException)
62
+ o.errors << Shapes::ShapeRef.new(shape: InternalServerException)
63
+ o.errors << Shapes::ShapeRef.new(shape: ServiceUnavailableException)
64
+ end)
65
+ end
66
+
67
+ end
68
+ end
@@ -0,0 +1,14 @@
1
+ # WARNING ABOUT GENERATED CODE
2
+ #
3
+ # This file is generated. See the contributing guide for more information:
4
+ # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
5
+ #
6
+ # WARNING ABOUT GENERATED CODE
7
+
8
+ module Aws::Translate
9
+ module Errors
10
+
11
+ extend Aws::Errors::DynamicErrors
12
+
13
+ end
14
+ end
@@ -0,0 +1,23 @@
1
+ # WARNING ABOUT GENERATED CODE
2
+ #
3
+ # This file is generated. See the contributing guide for more information:
4
+ # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
5
+ #
6
+ # WARNING ABOUT GENERATED CODE
7
+
8
+ module Aws::Translate
9
+ class Resource
10
+
11
+ # @param options ({})
12
+ # @option options [Client] :client
13
+ def initialize(options = {})
14
+ @client = options[:client] || Client.new(options)
15
+ end
16
+
17
+ # @return [Client]
18
+ def client
19
+ @client
20
+ end
21
+
22
+ end
23
+ end
@@ -0,0 +1,67 @@
1
+ # WARNING ABOUT GENERATED CODE
2
+ #
3
+ # This file is generated. See the contributing guide for more information:
4
+ # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
5
+ #
6
+ # WARNING ABOUT GENERATED CODE
7
+
8
+ module Aws::Translate
9
+ module Types
10
+
11
+ # @note When making an API call, you may pass TranslateTextRequest
12
+ # data as a hash:
13
+ #
14
+ # {
15
+ # text: "BoundedLengthString", # required
16
+ # source_language_code: "LanguageCodeString", # required
17
+ # target_language_code: "LanguageCodeString", # required
18
+ # }
19
+ #
20
+ # @!attribute [rw] text
21
+ # The text to translate.
22
+ # @return [String]
23
+ #
24
+ # @!attribute [rw] source_language_code
25
+ # One of the supported language codes for the source text. If the
26
+ # `TargetLanguageCode` is not "en", the `SourceLanguageCode` must be
27
+ # "en".
28
+ # @return [String]
29
+ #
30
+ # @!attribute [rw] target_language_code
31
+ # One of the supported language codes for the target text. If the
32
+ # `SourceLanguageCode` is not "en", the `TargetLanguageCode` must be
33
+ # "en".
34
+ # @return [String]
35
+ #
36
+ # @see http://docs.aws.amazon.com/goto/WebAPI/translate-2017-07-01/TranslateTextRequest AWS API Documentation
37
+ #
38
+ class TranslateTextRequest < Struct.new(
39
+ :text,
40
+ :source_language_code,
41
+ :target_language_code)
42
+ include Aws::Structure
43
+ end
44
+
45
+ # @!attribute [rw] translated_text
46
+ # The text translated into the target language.
47
+ # @return [String]
48
+ #
49
+ # @!attribute [rw] source_language_code
50
+ # The language code for the language of the input text.
51
+ # @return [String]
52
+ #
53
+ # @!attribute [rw] target_language_code
54
+ # The language code for the language of the translated text.
55
+ # @return [String]
56
+ #
57
+ # @see http://docs.aws.amazon.com/goto/WebAPI/translate-2017-07-01/TranslateTextResponse AWS API Documentation
58
+ #
59
+ class TranslateTextResponse < Struct.new(
60
+ :translated_text,
61
+ :source_language_code,
62
+ :target_language_code)
63
+ include Aws::Structure
64
+ end
65
+
66
+ end
67
+ end
metadata ADDED
@@ -0,0 +1,82 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: aws-sdk-translate
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Amazon Web Services
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2017-11-29 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: aws-sdk-core
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '3'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '3'
27
+ - !ruby/object:Gem::Dependency
28
+ name: aws-sigv4
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.0'
41
+ description: Official AWS Ruby gem for Amazon Translate. This gem is part of the AWS
42
+ SDK for Ruby.
43
+ email:
44
+ - trevrowe@amazon.com
45
+ executables: []
46
+ extensions: []
47
+ extra_rdoc_files: []
48
+ files:
49
+ - lib/aws-sdk-translate.rb
50
+ - lib/aws-sdk-translate/client.rb
51
+ - lib/aws-sdk-translate/client_api.rb
52
+ - lib/aws-sdk-translate/customizations.rb
53
+ - lib/aws-sdk-translate/errors.rb
54
+ - lib/aws-sdk-translate/resource.rb
55
+ - lib/aws-sdk-translate/types.rb
56
+ homepage: http://github.com/aws/aws-sdk-ruby
57
+ licenses:
58
+ - Apache-2.0
59
+ metadata:
60
+ source_code_uri: https://github.com/aws/aws-sdk-ruby/tree/master/gems/aws-sdk-translate
61
+ changelog_uri: https://github.com/aws/aws-sdk-ruby/tree/master/gems/aws-sdk-translate/CHANGELOG.md
62
+ post_install_message:
63
+ rdoc_options: []
64
+ require_paths:
65
+ - lib
66
+ required_ruby_version: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ version: '0'
71
+ required_rubygems_version: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ requirements: []
77
+ rubyforge_project:
78
+ rubygems_version: 2.5.1
79
+ signing_key:
80
+ specification_version: 4
81
+ summary: AWS SDK for Ruby - Amazon Translate
82
+ test_files: []