google-cloud-translate 3.7.3 → 3.8.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 23688139762ed002d6ea1689cfa724a963b0f98c8cad36fe721b40c4fff39e63
4
- data.tar.gz: 599281e0a0f27d01dfcf9e46c21b52290572e0211ca268cbc18e87e5c29f10f8
3
+ metadata.gz: fa03e55904f5c90e23c690ea205cdd273bd77fab300efb87781f86f28d5feac1
4
+ data.tar.gz: e01ecde9b386c407b3db1bfa67adccf731447b2b2a4d77bbc666661c76f98407
5
5
  SHA512:
6
- metadata.gz: 54a8550e86f0263ef5e01194aea6247dc3fdc1c41d0c5532040ba4e266aaaa5f3117a92b15cdc1ab7e4f5f5195bad87adc687c0450c3b2d282341172ba48e231
7
- data.tar.gz: c93e11a8fe4b0c497a97ab96494211b7cf2b85dea94a8508814fa1a1311eed78e039b652ef59a4c9c2f3db752c33fbdf993931ca563fb265637a4bea00a74d0c
6
+ metadata.gz: ca08c0a7467a31503d18fe4650ed284327ca4cdfd37ce7aff920f67cb666215cb75a0aa7f8c3e6b4be0ffed84adc88c783a2f9153e84d8a15a2e3f3cf2b04959
7
+ data.tar.gz: c395919b7a97050451d127498d728aa03a0790f63a841006521970326ccc4cfc88a5ce5b4338d92c712f2160bf0138b48cfc83c7a96aff98b417d86598fa2786
data/MIGRATING.md CHANGED
@@ -88,11 +88,18 @@ client = Google::Cloud::Translate.new version: :v2,
88
88
  ```
89
89
 
90
90
  New (V3):
91
- ```
91
+ ```ruby
92
+ require "googleauth"
93
+ require "google/cloud/translate"
94
+
95
+ credentials = ::Google::Auth::ServiceAccountCredentials.make_creds(
96
+ json_key_io: ::File.open("/path/to/keyfile.json")
97
+ )
98
+
92
99
  # Call the translation_service method to create a V3 client,
93
100
  # and pass a block to configure the client.
94
101
  client = Google::Cloud::Translate.translation_service do |config|
95
- config.credentials = "/path/to/credentials.json"
102
+ config.credentials = credentials
96
103
  end
97
104
 
98
105
  # You can omit the block if you're keeping the default configuration
@@ -29,8 +29,11 @@ module Google
29
29
  #
30
30
  # @param [String] project_id Project identifier for the Cloud Translation service you are connecting to. If not
31
31
  # present, the default project for the credentials is used.
32
- # @param [String, Hash, Google::Auth::Credentials] credentials The path to the keyfile as a String, the contents
33
- # of the keyfile as a Hash, or a Google::Auth::Credentials object.
32
+ # @param [Google::Auth::Credentials] credentials A Google::Auth::Credentials
33
+ # object.
34
+ # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials
35
+ # is deprecated. Providing an unvalidated credential configuration to
36
+ # Google APIs can compromise the security of your systems and data.
34
37
  # @param [String] key a public API access key (not an OAuth 2.0 token)
35
38
  # @param [String, Array<String>] scope The OAuth 2.0 scopes controlling the set of resources and operations that
36
39
  # the connection can access. See [Using OAuth 2.0 to Access Google
@@ -48,12 +51,17 @@ module Google
48
51
  # @return [Google::Cloud::Translate::V2::Api]
49
52
  #
50
53
  # @example
54
+ # require "googleauth"
51
55
  # require "google/cloud/translate/v2"
52
56
  #
57
+ # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds(
58
+ # json_key_io: ::File.open("/path/to/keyfile.json")
59
+ # )
60
+ #
53
61
  # translate = Google::Cloud::Translate::V2.new(
54
62
  # version: :v2,
55
63
  # project_id: "my-todo-project",
56
- # credentials: "/path/to/keyfile.json"
64
+ # credentials: credentials
57
65
  # )
58
66
  #
59
67
  # translation = translate.translate "Hello world!", to: "la"
@@ -20,7 +20,7 @@
20
20
  module Google
21
21
  module Cloud
22
22
  module Translate
23
- VERSION = "3.7.3"
23
+ VERSION = "3.8.0"
24
24
  end
25
25
  end
26
26
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-translate
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.7.3
4
+ version: 3.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
@@ -91,7 +91,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
91
91
  requirements:
92
92
  - - ">="
93
93
  - !ruby/object:Gem::Version
94
- version: '3.0'
94
+ version: '3.2'
95
95
  required_rubygems_version: !ruby/object:Gem::Requirement
96
96
  requirements:
97
97
  - - ">="