google-cloud-language-v1beta2 0.4.5 → 0.6.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: 10ef09b3a1e94b52174d85d8deb7103517d3ceaa768abdf2b283d1f94e40140a
4
- data.tar.gz: ff2c1b283e9ce947051bf3cf056aeebb2a91a4fa79bd88b1af59b1c0b6d2e1f9
3
+ metadata.gz: 54edb9b0db12a1443da0bdbaefc899d151ea1f4d62ee48739ddccb2028472c01
4
+ data.tar.gz: c64d9f82f2936a70d140cecf3baba4d855763566fa731a1e240b47d0f47192ae
5
5
  SHA512:
6
- metadata.gz: df79ae6637dd477f33b6a7b502bfcdb6cb65679001a3ac14880f0ba82d1d5ca8b513099419a67c26593ce91f363607bed30b2baf478e6b4cfa33f3182158e526
7
- data.tar.gz: d93737bb7733eb0363e31b07d45585c6a4858f5685fe9c13fec2da5e090b8ed2e65b2faed0a010c591b4b44f1389133c2f837b3802bd4e8955edf72bd6837340
6
+ metadata.gz: 70a0015537cc76fedbf5568a4df22197b5c78b3b5ad19322ddbe84a0e6f058649eef41274a1351e160573bbc4c6d4dbec11bebf9dbec0fc798a30c546eda26d2
7
+ data.tar.gz: 83c1ea529ab771c558beed222cd7a5336a75a142df43e455166ecc2f869399e1b9356485d5411a23730ec5a0c9bf6d296c9f39a315bfacf811c235435bbaa568
data/AUTHENTICATION.md CHANGED
@@ -114,7 +114,7 @@ credentials are discovered.
114
114
  To configure your system for this, simply:
115
115
 
116
116
  1. [Download and install the Cloud SDK](https://cloud.google.com/sdk)
117
- 2. Authenticate using OAuth 2.0 `$ gcloud auth login`
117
+ 2. Authenticate using OAuth 2.0 `$ gcloud auth application-default login`
118
118
  3. Write code as if already authenticated.
119
119
 
120
120
  **NOTE:** This is _not_ recommended for running in production. The Cloud SDK
data/README.md CHANGED
@@ -37,7 +37,7 @@ request = ::Google::Cloud::Language::V1beta2::AnalyzeSentimentRequest.new # (req
37
37
  response = client.analyze_sentiment request
38
38
  ```
39
39
 
40
- View the [Client Library Documentation](https://googleapis.dev/ruby/google-cloud-language-v1beta2/latest)
40
+ View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-language-v1beta2/latest)
41
41
  for class and method documentation.
42
42
 
43
43
  See also the [Product Documentation](https://cloud.google.com/natural-language)
@@ -69,16 +69,21 @@ module GRPC
69
69
  end
70
70
  ```
71
71
 
72
+
73
+ ## Google Cloud Samples
74
+
75
+ To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples).
76
+
72
77
  ## Supported Ruby Versions
73
78
 
74
- This library is supported on Ruby 2.5+.
79
+ This library is supported on Ruby 2.6+.
75
80
 
76
81
  Google provides official support for Ruby versions that are actively supported
77
82
  by Ruby Core—that is, Ruby versions that are either in normal maintenance or
78
- in security maintenance, and not end of life. Currently, this means Ruby 2.5
79
- and later. Older versions of Ruby _may_ still work, but are unsupported and not
80
- recommended. See https://www.ruby-lang.org/en/downloads/branches/ for details
81
- about the Ruby support schedule.
83
+ in security maintenance, and not end of life. Older versions of Ruby _may_
84
+ still work, but are unsupported and not recommended. See
85
+ https://www.ruby-lang.org/en/downloads/branches/ for details about the Ruby
86
+ support schedule.
82
87
 
83
88
  ## Which client should I use?
84
89
 
@@ -416,7 +416,7 @@ module Google
416
416
 
417
417
  ##
418
418
  # Analyzes the syntax of the text and provides sentence boundaries and
419
- # tokenization along with part-of-speech tags, dependency trees, and other
419
+ # tokenization along with part of speech tags, dependency trees, and other
420
420
  # properties.
421
421
  #
422
422
  # @overload analyze_syntax(request, options = nil)
@@ -508,13 +508,16 @@ module Google
508
508
  # @param options [::Gapic::CallOptions, ::Hash]
509
509
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
510
510
  #
511
- # @overload classify_text(document: nil)
511
+ # @overload classify_text(document: nil, classification_model_options: nil)
512
512
  # Pass arguments to `classify_text` via keyword arguments. Note that at
513
513
  # least one keyword argument is required. To specify no parameters, or to keep all
514
514
  # the default parameter values, pass an empty Hash as a request object (see above).
515
515
  #
516
516
  # @param document [::Google::Cloud::Language::V1beta2::Document, ::Hash]
517
517
  # Required. Input document.
518
+ # @param classification_model_options [::Google::Cloud::Language::V1beta2::ClassificationModelOptions, ::Hash]
519
+ # Model options to use for classification. Defaults to v1 options if not
520
+ # specified.
518
521
  #
519
522
  # @yield [response, operation] Access the result along with the RPC operation
520
523
  # @yieldparam response [::Google::Cloud::Language::V1beta2::ClassifyTextResponse]
@@ -1,17 +1,19 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/cloud/language/v1beta2/language_service.proto
3
3
 
4
+ require 'google/protobuf'
5
+
4
6
  require 'google/api/annotations_pb'
5
7
  require 'google/api/client_pb'
6
8
  require 'google/api/field_behavior_pb'
7
- require 'google/protobuf/timestamp_pb'
8
- require 'google/protobuf'
9
9
 
10
10
  Google::Protobuf::DescriptorPool.generated_pool.build do
11
11
  add_file("google/cloud/language/v1beta2/language_service.proto", :syntax => :proto3) do
12
12
  add_message "google.cloud.language.v1beta2.Document" do
13
13
  optional :type, :enum, 1, "google.cloud.language.v1beta2.Document.Type"
14
14
  optional :language, :string, 4
15
+ optional :reference_web_uri, :string, 5
16
+ optional :boilerplate_handling, :enum, 6, "google.cloud.language.v1beta2.Document.BoilerplateHandling"
15
17
  oneof :source do
16
18
  optional :content, :string, 2
17
19
  optional :gcs_content_uri, :string, 3
@@ -22,6 +24,11 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
22
24
  value :PLAIN_TEXT, 1
23
25
  value :HTML, 2
24
26
  end
27
+ add_enum "google.cloud.language.v1beta2.Document.BoilerplateHandling" do
28
+ value :BOILERPLATE_HANDLING_UNSPECIFIED, 0
29
+ value :SKIP_BOILERPLATE, 1
30
+ value :KEEP_BOILERPLATE, 2
31
+ end
25
32
  add_message "google.cloud.language.v1beta2.Sentence" do
26
33
  optional :text, :message, 1, "google.cloud.language.v1beta2.TextSpan"
27
34
  optional :sentiment, :message, 2, "google.cloud.language.v1beta2.Sentiment"
@@ -286,6 +293,22 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
286
293
  optional :name, :string, 1
287
294
  optional :confidence, :float, 2
288
295
  end
296
+ add_message "google.cloud.language.v1beta2.ClassificationModelOptions" do
297
+ oneof :model_type do
298
+ optional :v1_model, :message, 1, "google.cloud.language.v1beta2.ClassificationModelOptions.V1Model"
299
+ optional :v2_model, :message, 2, "google.cloud.language.v1beta2.ClassificationModelOptions.V2Model"
300
+ end
301
+ end
302
+ add_message "google.cloud.language.v1beta2.ClassificationModelOptions.V1Model" do
303
+ end
304
+ add_message "google.cloud.language.v1beta2.ClassificationModelOptions.V2Model" do
305
+ optional :content_categories_version, :enum, 1, "google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.ContentCategoriesVersion"
306
+ end
307
+ add_enum "google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.ContentCategoriesVersion" do
308
+ value :CONTENT_CATEGORIES_VERSION_UNSPECIFIED, 0
309
+ value :V1, 1
310
+ value :V2, 2
311
+ end
289
312
  add_message "google.cloud.language.v1beta2.AnalyzeSentimentRequest" do
290
313
  optional :document, :message, 1, "google.cloud.language.v1beta2.Document"
291
314
  optional :encoding_type, :enum, 2, "google.cloud.language.v1beta2.EncodingType"
@@ -322,6 +345,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
322
345
  end
323
346
  add_message "google.cloud.language.v1beta2.ClassifyTextRequest" do
324
347
  optional :document, :message, 1, "google.cloud.language.v1beta2.Document"
348
+ optional :classification_model_options, :message, 3, "google.cloud.language.v1beta2.ClassificationModelOptions"
325
349
  end
326
350
  add_message "google.cloud.language.v1beta2.ClassifyTextResponse" do
327
351
  repeated :categories, :message, 1, "google.cloud.language.v1beta2.ClassificationCategory"
@@ -337,6 +361,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
337
361
  optional :extract_document_sentiment, :bool, 3
338
362
  optional :extract_entity_sentiment, :bool, 4
339
363
  optional :classify_text, :bool, 6
364
+ optional :classification_model_options, :message, 10, "google.cloud.language.v1beta2.ClassificationModelOptions"
340
365
  end
341
366
  add_message "google.cloud.language.v1beta2.AnnotateTextResponse" do
342
367
  repeated :sentences, :message, 1, "google.cloud.language.v1beta2.Sentence"
@@ -361,6 +386,7 @@ module Google
361
386
  module V1beta2
362
387
  Document = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.Document").msgclass
363
388
  Document::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.Document.Type").enummodule
389
+ Document::BoilerplateHandling = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.Document.BoilerplateHandling").enummodule
364
390
  Sentence = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.Sentence").msgclass
365
391
  Entity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.Entity").msgclass
366
392
  Entity::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.Entity.Type").enummodule
@@ -385,6 +411,10 @@ module Google
385
411
  EntityMention::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.EntityMention.Type").enummodule
386
412
  TextSpan = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.TextSpan").msgclass
387
413
  ClassificationCategory = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.ClassificationCategory").msgclass
414
+ ClassificationModelOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.ClassificationModelOptions").msgclass
415
+ ClassificationModelOptions::V1Model = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.ClassificationModelOptions.V1Model").msgclass
416
+ ClassificationModelOptions::V2Model = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.ClassificationModelOptions.V2Model").msgclass
417
+ ClassificationModelOptions::V2Model::ContentCategoriesVersion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.ContentCategoriesVersion").enummodule
388
418
  AnalyzeSentimentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.AnalyzeSentimentRequest").msgclass
389
419
  AnalyzeSentimentResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.AnalyzeSentimentResponse").msgclass
390
420
  AnalyzeEntitySentimentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest").msgclass
@@ -1,7 +1,7 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # Source: google/cloud/language/v1beta2/language_service.proto for package 'google.cloud.language.v1beta2'
3
3
  # Original file comments:
4
- # Copyright 2019 Google LLC.
4
+ # Copyright 2022 Google LLC
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
7
7
  # you may not use this file except in compliance with the License.
@@ -15,7 +15,6 @@
15
15
  # See the License for the specific language governing permissions and
16
16
  # limitations under the License.
17
17
  #
18
- #
19
18
 
20
19
  require 'grpc'
21
20
  require 'google/cloud/language/v1beta2/language_service_pb'
@@ -45,7 +44,7 @@ module Google
45
44
  # sentiment associated with each entity and its mentions.
46
45
  rpc :AnalyzeEntitySentiment, ::Google::Cloud::Language::V1beta2::AnalyzeEntitySentimentRequest, ::Google::Cloud::Language::V1beta2::AnalyzeEntitySentimentResponse
47
46
  # Analyzes the syntax of the text and provides sentence boundaries and
48
- # tokenization along with part-of-speech tags, dependency trees, and other
47
+ # tokenization along with part of speech tags, dependency trees, and other
49
48
  # properties.
50
49
  rpc :AnalyzeSyntax, ::Google::Cloud::Language::V1beta2::AnalyzeSyntaxRequest, ::Google::Cloud::Language::V1beta2::AnalyzeSyntaxResponse
51
50
  # Classifies a document into categories.
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module Language
23
23
  module V1beta2
24
- VERSION = "0.4.5"
24
+ VERSION = "0.6.0"
25
25
  end
26
26
  end
27
27
  end
@@ -25,6 +25,8 @@ module Google
25
25
  ##
26
26
  # To load this package, including all its services, and instantiate a client:
27
27
  #
28
+ # @example
29
+ #
28
30
  # require "google/cloud/language/v1beta2"
29
31
  # client = ::Google::Cloud::Language::V1beta2::LanguageService::Client.new
30
32
  #
@@ -46,6 +46,15 @@ module Google
46
46
  # currently supported languages for each API method. If the language (either
47
47
  # specified by the caller or automatically detected) is not supported by the
48
48
  # called API method, an `INVALID_ARGUMENT` error is returned.
49
+ # @!attribute [rw] reference_web_uri
50
+ # @return [::String]
51
+ # The web URI where the document comes from. This URI is not used for
52
+ # fetching the content, but as a hint for analyzing the document.
53
+ # @!attribute [rw] boilerplate_handling
54
+ # @return [::Google::Cloud::Language::V1beta2::Document::BoilerplateHandling]
55
+ # Indicates how detected boilerplate(e.g. advertisements, copyright
56
+ # declarations, banners) should be handled for this document. If not
57
+ # specified, boilerplate will be treated the same as content.
49
58
  class Document
50
59
  include ::Google::Protobuf::MessageExts
51
60
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -61,6 +70,19 @@ module Google
61
70
  # HTML
62
71
  HTML = 2
63
72
  end
73
+
74
+ # Ways of handling boilerplate detected in the document
75
+ module BoilerplateHandling
76
+ # The boilerplate handling is not specified.
77
+ BOILERPLATE_HANDLING_UNSPECIFIED = 0
78
+
79
+ # Do not analyze detected boilerplate. Reference web URI is required for
80
+ # detecting boilerplate.
81
+ SKIP_BOILERPLATE = 1
82
+
83
+ # Treat boilerplate the same as content.
84
+ KEEP_BOILERPLATE = 2
85
+ end
64
86
  end
65
87
 
66
88
  # Represents a sentence in the input document.
@@ -896,6 +918,49 @@ module Google
896
918
  extend ::Google::Protobuf::MessageExts::ClassMethods
897
919
  end
898
920
 
921
+ # Model options available for classification requests.
922
+ # @!attribute [rw] v1_model
923
+ # @return [::Google::Cloud::Language::V1beta2::ClassificationModelOptions::V1Model]
924
+ # Setting this field will use the V1 model and V1 content categories
925
+ # version. The V1 model is a legacy model; support for this will be
926
+ # discontinued in the future.
927
+ # @!attribute [rw] v2_model
928
+ # @return [::Google::Cloud::Language::V1beta2::ClassificationModelOptions::V2Model]
929
+ # Setting this field will use the V2 model with the appropriate content
930
+ # categories version. The V2 model is a better performing model.
931
+ class ClassificationModelOptions
932
+ include ::Google::Protobuf::MessageExts
933
+ extend ::Google::Protobuf::MessageExts::ClassMethods
934
+
935
+ # Options for the V1 model.
936
+ class V1Model
937
+ include ::Google::Protobuf::MessageExts
938
+ extend ::Google::Protobuf::MessageExts::ClassMethods
939
+ end
940
+
941
+ # Options for the V2 model.
942
+ # @!attribute [rw] content_categories_version
943
+ # @return [::Google::Cloud::Language::V1beta2::ClassificationModelOptions::V2Model::ContentCategoriesVersion]
944
+ # The content categories used for classification.
945
+ class V2Model
946
+ include ::Google::Protobuf::MessageExts
947
+ extend ::Google::Protobuf::MessageExts::ClassMethods
948
+
949
+ # The content categories used for classification.
950
+ module ContentCategoriesVersion
951
+ # If `ContentCategoriesVersion` is not specified, this option will
952
+ # default to `V1`.
953
+ CONTENT_CATEGORIES_VERSION_UNSPECIFIED = 0
954
+
955
+ # Legacy content categories of our initial launch in 2017.
956
+ V1 = 1
957
+
958
+ # Updated content categories in 2022.
959
+ V2 = 2
960
+ end
961
+ end
962
+ end
963
+
899
964
  # The sentiment analysis request message.
900
965
  # @!attribute [rw] document
901
966
  # @return [::Google::Cloud::Language::V1beta2::Document]
@@ -1011,6 +1076,10 @@ module Google
1011
1076
  # @!attribute [rw] document
1012
1077
  # @return [::Google::Cloud::Language::V1beta2::Document]
1013
1078
  # Required. Input document.
1079
+ # @!attribute [rw] classification_model_options
1080
+ # @return [::Google::Cloud::Language::V1beta2::ClassificationModelOptions]
1081
+ # Model options to use for classification. Defaults to v1 options if not
1082
+ # specified.
1014
1083
  class ClassifyTextRequest
1015
1084
  include ::Google::Protobuf::MessageExts
1016
1085
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -1042,7 +1111,7 @@ module Google
1042
1111
 
1043
1112
  # All available features for sentiment, syntax, and semantic analysis.
1044
1113
  # Setting each one to true will enable that specific analysis for the input.
1045
- # Next ID: 10
1114
+ # Next ID: 11
1046
1115
  # @!attribute [rw] extract_syntax
1047
1116
  # @return [::Boolean]
1048
1117
  # Extract syntax information.
@@ -1061,6 +1130,10 @@ module Google
1061
1130
  # the API will use the default model which classifies into a
1062
1131
  # [predefined
1063
1132
  # taxonomy](https://cloud.google.com/natural-language/docs/categories).
1133
+ # @!attribute [rw] classification_model_options
1134
+ # @return [::Google::Cloud::Language::V1beta2::ClassificationModelOptions]
1135
+ # The model options to use for classification. Defaults to v1 options
1136
+ # if not specified. Only used if `classify_text` is set to true.
1064
1137
  class Features
1065
1138
  include ::Google::Protobuf::MessageExts
1066
1139
  extend ::Google::Protobuf::MessageExts::ClassMethods
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-language-v1beta2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.5
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-11 00:00:00.000000000 Z
11
+ date: 2022-09-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gapic-common
@@ -16,7 +16,7 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '0.7'
19
+ version: '0.12'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: 2.a
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: '0.7'
29
+ version: '0.12'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: 2.a
@@ -50,28 +50,28 @@ dependencies:
50
50
  requirements:
51
51
  - - "~>"
52
52
  - !ruby/object:Gem::Version
53
- version: 1.25.1
53
+ version: 1.26.1
54
54
  type: :development
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  requirements:
58
58
  - - "~>"
59
59
  - !ruby/object:Gem::Version
60
- version: 1.25.1
60
+ version: 1.26.1
61
61
  - !ruby/object:Gem::Dependency
62
62
  name: minitest
63
63
  requirement: !ruby/object:Gem::Requirement
64
64
  requirements:
65
65
  - - "~>"
66
66
  - !ruby/object:Gem::Version
67
- version: '5.14'
67
+ version: '5.16'
68
68
  type: :development
69
69
  prerelease: false
70
70
  version_requirements: !ruby/object:Gem::Requirement
71
71
  requirements:
72
72
  - - "~>"
73
73
  - !ruby/object:Gem::Version
74
- version: '5.14'
74
+ version: '5.16'
75
75
  - !ruby/object:Gem::Dependency
76
76
  name: minitest-focus
77
77
  requirement: !ruby/object:Gem::Requirement
@@ -106,14 +106,14 @@ dependencies:
106
106
  requirements:
107
107
  - - ">="
108
108
  - !ruby/object:Gem::Version
109
- version: '12.0'
109
+ version: '13.0'
110
110
  type: :development
111
111
  prerelease: false
112
112
  version_requirements: !ruby/object:Gem::Requirement
113
113
  requirements:
114
114
  - - ">="
115
115
  - !ruby/object:Gem::Version
116
- version: '12.0'
116
+ version: '13.0'
117
117
  - !ruby/object:Gem::Dependency
118
118
  name: redcarpet
119
119
  requirement: !ruby/object:Gem::Requirement
@@ -182,7 +182,6 @@ files:
182
182
  - proto_docs/google/api/field_behavior.rb
183
183
  - proto_docs/google/api/resource.rb
184
184
  - proto_docs/google/cloud/language/v1beta2/language_service.rb
185
- - proto_docs/google/protobuf/timestamp.rb
186
185
  homepage: https://github.com/googleapis/google-cloud-ruby
187
186
  licenses:
188
187
  - Apache-2.0
@@ -195,14 +194,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
195
194
  requirements:
196
195
  - - ">="
197
196
  - !ruby/object:Gem::Version
198
- version: '2.5'
197
+ version: '2.6'
199
198
  required_rubygems_version: !ruby/object:Gem::Requirement
200
199
  requirements:
201
200
  - - ">="
202
201
  - !ruby/object:Gem::Version
203
202
  version: '0'
204
203
  requirements: []
205
- rubygems_version: 3.3.4
204
+ rubygems_version: 3.3.14
206
205
  signing_key:
207
206
  specification_version: 4
208
207
  summary: API Client library for the Natural Language V1beta2 API
@@ -1,129 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Copyright 2020 Google LLC
4
- #
5
- # Licensed under the Apache License, Version 2.0 (the "License");
6
- # you may not use this file except in compliance with the License.
7
- # You may obtain a copy of the License at
8
- #
9
- # https://www.apache.org/licenses/LICENSE-2.0
10
- #
11
- # Unless required by applicable law or agreed to in writing, software
12
- # distributed under the License is distributed on an "AS IS" BASIS,
13
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- # See the License for the specific language governing permissions and
15
- # limitations under the License.
16
-
17
- # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
-
19
-
20
- module Google
21
- module Protobuf
22
- # A Timestamp represents a point in time independent of any time zone or local
23
- # calendar, encoded as a count of seconds and fractions of seconds at
24
- # nanosecond resolution. The count is relative to an epoch at UTC midnight on
25
- # January 1, 1970, in the proleptic Gregorian calendar which extends the
26
- # Gregorian calendar backwards to year one.
27
- #
28
- # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
29
- # second table is needed for interpretation, using a [24-hour linear
30
- # smear](https://developers.google.com/time/smear).
31
- #
32
- # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
33
- # restricting to that range, we ensure that we can convert to and from [RFC
34
- # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
35
- #
36
- # # Examples
37
- #
38
- # Example 1: Compute Timestamp from POSIX `time()`.
39
- #
40
- # Timestamp timestamp;
41
- # timestamp.set_seconds(time(NULL));
42
- # timestamp.set_nanos(0);
43
- #
44
- # Example 2: Compute Timestamp from POSIX `gettimeofday()`.
45
- #
46
- # struct timeval tv;
47
- # gettimeofday(&tv, NULL);
48
- #
49
- # Timestamp timestamp;
50
- # timestamp.set_seconds(tv.tv_sec);
51
- # timestamp.set_nanos(tv.tv_usec * 1000);
52
- #
53
- # Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
54
- #
55
- # FILETIME ft;
56
- # GetSystemTimeAsFileTime(&ft);
57
- # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
58
- #
59
- # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
60
- # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
61
- # Timestamp timestamp;
62
- # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
63
- # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
64
- #
65
- # Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
66
- #
67
- # long millis = System.currentTimeMillis();
68
- #
69
- # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
70
- # .setNanos((int) ((millis % 1000) * 1000000)).build();
71
- #
72
- #
73
- # Example 5: Compute Timestamp from Java `Instant.now()`.
74
- #
75
- # Instant now = Instant.now();
76
- #
77
- # Timestamp timestamp =
78
- # Timestamp.newBuilder().setSeconds(now.getEpochSecond())
79
- # .setNanos(now.getNano()).build();
80
- #
81
- #
82
- # Example 6: Compute Timestamp from current time in Python.
83
- #
84
- # timestamp = Timestamp()
85
- # timestamp.GetCurrentTime()
86
- #
87
- # # JSON Mapping
88
- #
89
- # In JSON format, the Timestamp type is encoded as a string in the
90
- # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
91
- # format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z"
92
- # where \\{year} is always expressed using four digits while \\{month}, \\{day},
93
- # \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional
94
- # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
95
- # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
96
- # is required. A proto3 JSON serializer should always use UTC (as indicated by
97
- # "Z") when printing the Timestamp type and a proto3 JSON parser should be
98
- # able to accept both UTC and other timezones (as indicated by an offset).
99
- #
100
- # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
101
- # 01:30 UTC on January 15, 2017.
102
- #
103
- # In JavaScript, one can convert a Date object to this format using the
104
- # standard
105
- # [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
106
- # method. In Python, a standard `datetime.datetime` object can be converted
107
- # to this format using
108
- # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
109
- # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
110
- # the Joda Time's [`ISODateTimeFormat.dateTime()`](
111
- # http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D
112
- # ) to obtain a formatter capable of generating timestamps in this format.
113
- # @!attribute [rw] seconds
114
- # @return [::Integer]
115
- # Represents seconds of UTC time since Unix epoch
116
- # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
117
- # 9999-12-31T23:59:59Z inclusive.
118
- # @!attribute [rw] nanos
119
- # @return [::Integer]
120
- # Non-negative fractions of a second at nanosecond resolution. Negative
121
- # second values with fractions must still have non-negative nanos values
122
- # that count forward in time. Must be from 0 to 999,999,999
123
- # inclusive.
124
- class Timestamp
125
- include ::Google::Protobuf::MessageExts
126
- extend ::Google::Protobuf::MessageExts::ClassMethods
127
- end
128
- end
129
- end