aws-sdk-translate 1.57.0 → 1.59.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 213cb3717026d24d87c80faf2626e18d8033afeb4c7512466426ad368251d0f1
4
- data.tar.gz: 44a6b09ccaef605bf35bfed7b402c61e660b1402cdf7f1998f43c68a301d038d
3
+ metadata.gz: 757357722fd4a40562e7f67b50acc428dc18981558848aaef985717ca1670049
4
+ data.tar.gz: 66be00fbb9c13528f02a412d30015ef4438788142bb281bb385106f65b4ea869
5
5
  SHA512:
6
- metadata.gz: ccda753a82a663ef1f135188e5b55ba49a0a7a78257b86867f5e433f60b69a1af793efb3d747c858b0393f6aeabd8bbe964213b6d2547377df78525f0d669dc2
7
- data.tar.gz: ace2c07c302368eff9744ad3a67a7b3d85fddf6965bd5149b3d202f1f6f1fc9488c98d0f32f42a5b66abc8abd5ec090cc7cb20c047ab5a226b0416a2a93c5325
6
+ metadata.gz: 81b5dfb9753836e5e81645293763bdba97f974573c0eb618f67e52ede9958b34d8cace9f5dd0a82fa993230bf23e7be6b410a5e3aa0d9028a4838efe4572f22a
7
+ data.tar.gz: 8077f3be33badd47d016f0f0ea957d4f81ed4e01218e891000ede7b9c0a7f7bd3dce130bc51c3ed52206d35973e32f0af97b0b128c799a550d0c33ea9e385c8c
data/CHANGELOG.md CHANGED
@@ -1,6 +1,18 @@
1
1
  Unreleased Changes
2
2
  ------------------
3
3
 
4
+ 1.59.0 (2023-09-27)
5
+ ------------------
6
+
7
+ * Feature - Code Generated Changes, see `./build_tools` or `aws-sdk-core`'s CHANGELOG.md for details.
8
+
9
+ 1.58.0 (2023-08-16)
10
+ ------------------
11
+
12
+ * Feature - Code Generated Changes, see `./build_tools` or `aws-sdk-core`'s CHANGELOG.md for details.
13
+
14
+ * Issue - Preserve Document encoding in `TranslateDocument` for text documents (#2897).
15
+
4
16
  1.57.0 (2023-07-18)
5
17
  ------------------
6
18
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.57.0
1
+ 1.59.0
@@ -33,6 +33,7 @@ require 'aws-sdk-core/plugins/defaults_mode.rb'
33
33
  require 'aws-sdk-core/plugins/recursion_detection.rb'
34
34
  require 'aws-sdk-core/plugins/sign.rb'
35
35
  require 'aws-sdk-core/plugins/protocols/json_rpc.rb'
36
+ require 'aws-sdk-translate/plugins/translate_document_encoding.rb'
36
37
 
37
38
  Aws::Plugins::GlobalConfiguration.add_identifier(:translate)
38
39
 
@@ -83,6 +84,7 @@ module Aws::Translate
83
84
  add_plugin(Aws::Plugins::RecursionDetection)
84
85
  add_plugin(Aws::Plugins::Sign)
85
86
  add_plugin(Aws::Plugins::Protocols::JsonRpc)
87
+ add_plugin(Aws::Translate::Plugins::TranslateDocumentEncoding)
86
88
  add_plugin(Aws::Translate::Plugins::Endpoints)
87
89
 
88
90
  # @overload initialize(options)
@@ -1622,7 +1624,7 @@ module Aws::Translate
1622
1624
  params: params,
1623
1625
  config: config)
1624
1626
  context[:gem_name] = 'aws-sdk-translate'
1625
- context[:gem_version] = '1.57.0'
1627
+ context[:gem_version] = '1.59.0'
1626
1628
  Seahorse::Client::Request.new(handlers, context)
1627
1629
  end
1628
1630
 
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Aws::Translate
4
+ module Plugins
5
+ # @api private
6
+ # The translated_documented returned by the translate_document api is modeled
7
+ # as a blob, since it may contain binary data (eg: word doc). However,
8
+ # when the input document is text (eg: text/plain or text/html) the encoding
9
+ # should be preserved.
10
+ class TranslateDocumentEncoding < Seahorse::Client::Plugin
11
+ class Handler < Seahorse::Client::Handler
12
+ def call(context)
13
+ # detect encoding
14
+ document = context.params[:document]
15
+ encoding =
16
+ if document[:content_type].start_with?('text/') && document[:content].is_a?(String)
17
+ document[:content].encoding
18
+ end
19
+ resp = @handler.call(context)
20
+ if encoding
21
+ resp.translated_document.content = resp.translated_document.content.force_encoding(encoding)
22
+ end
23
+ resp
24
+ end
25
+ end
26
+ def add_handlers(handlers, _config)
27
+ handlers.add(Handler, step: :initialize, operations: [:translate_document])
28
+ end
29
+ end
30
+ end
31
+ end
@@ -52,6 +52,6 @@ require_relative 'aws-sdk-translate/customizations'
52
52
  # @!group service
53
53
  module Aws::Translate
54
54
 
55
- GEM_VERSION = '1.57.0'
55
+ GEM_VERSION = '1.59.0'
56
56
 
57
57
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-sdk-translate
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.57.0
4
+ version: 1.59.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Amazon Web Services
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-07-18 00:00:00.000000000 Z
11
+ date: 2023-09-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-core
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: '3'
20
20
  - - ">="
21
21
  - !ruby/object:Gem::Version
22
- version: 3.177.0
22
+ version: 3.184.0
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: '3'
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
- version: 3.177.0
32
+ version: 3.184.0
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: aws-sigv4
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -64,6 +64,7 @@ files:
64
64
  - lib/aws-sdk-translate/endpoints.rb
65
65
  - lib/aws-sdk-translate/errors.rb
66
66
  - lib/aws-sdk-translate/plugins/endpoints.rb
67
+ - lib/aws-sdk-translate/plugins/translate_document_encoding.rb
67
68
  - lib/aws-sdk-translate/resource.rb
68
69
  - lib/aws-sdk-translate/types.rb
69
70
  homepage: https://github.com/aws/aws-sdk-ruby