google-apis-language_v1beta2 0.16.0 → 0.18.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: a9a4c231b57dba533def811ffbf5a3c94afc6085f1b04fa2d2cc94c40911eb92
4
- data.tar.gz: 50fe8c78d05d90a7f25256253f2bcb8dd4f8299f5286dcc76dd69d62cf0662d0
3
+ metadata.gz: 66e73f4c385bee644726c8ccb7e2553a33976a693e2190c0cd16454e590c9d08
4
+ data.tar.gz: 0ca43e7ba7343fc7b70c3c91daeb0bdc00fc948025f7bd699f04e5d6b1406880
5
5
  SHA512:
6
- metadata.gz: 62c20e82f417f12d0df8af956451faddb85fbed44d7713d9cdbd2f2bdf22c9b9e8f723b6498a1ed7b32fc1cf1efdbb124b5eddce7edb0e607ab3c27c40b479a1
7
- data.tar.gz: f98c8f2cab7635b40ef97ee8c67fd60cb1c52b71e24cbdaf36d88e86454f9934ad3b800b163db056de2d2e3117be16f76bac0710f3dd4ae0287f174729ad8740
6
+ metadata.gz: 3fd7c2869d7844f40d6d5e747c0670a9b8b05d44ce8623c7e7d7c2e167e67510462a7e850d896ee33612bddae4a851bf8c6072ef8d8656b064fa49128d92e988
7
+ data.tar.gz: a7db24c887ecf5d86381776b3119758cc6258cf40af98c249c52bb1e8da9ab276a1f27bbd0f62391348757d8ac60c6adc9c6c0037e2c17f335142ba2db3411ca
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Release history for google-apis-language_v1beta2
2
2
 
3
+ ### v0.18.0 (2023-06-04)
4
+
5
+ * Regenerated from discovery document revision 20230527
6
+
7
+ ### v0.17.0 (2023-04-30)
8
+
9
+ * Regenerated from discovery document revision 20230424
10
+
3
11
  ### v0.16.0 (2023-02-19)
4
12
 
5
13
  * Regenerated using generator version 0.12.0
@@ -260,7 +260,7 @@ module Google
260
260
  attr_accessor :encoding_type
261
261
 
262
262
  # All available features for sentiment, syntax, and semantic analysis. Setting
263
- # each one to true will enable that specific analysis for the input. Next ID: 11
263
+ # each one to true will enable that specific analysis for the input. Next ID: 12
264
264
  # Corresponds to the JSON property `features`
265
265
  # @return [Google::Apis::LanguageV1beta2::Features]
266
266
  attr_accessor :features
@@ -305,6 +305,11 @@ module Google
305
305
  # @return [String]
306
306
  attr_accessor :language
307
307
 
308
+ # Harmful and sensitive categories identified in the input document.
309
+ # Corresponds to the JSON property `moderationCategories`
310
+ # @return [Array<Google::Apis::LanguageV1beta2::ClassificationCategory>]
311
+ attr_accessor :moderation_categories
312
+
308
313
  # Sentences in the input document. Populated if the user enables
309
314
  # AnnotateTextRequest.Features.extract_syntax.
310
315
  # Corresponds to the JSON property `sentences`
@@ -327,6 +332,7 @@ module Google
327
332
  @document_sentiment = args[:document_sentiment] if args.key?(:document_sentiment)
328
333
  @entities = args[:entities] if args.key?(:entities)
329
334
  @language = args[:language] if args.key?(:language)
335
+ @moderation_categories = args[:moderation_categories] if args.key?(:moderation_categories)
330
336
  @sentences = args[:sentences] if args.key?(:sentences)
331
337
  @tokens = args[:tokens] if args.key?(:tokens)
332
338
  end
@@ -342,8 +348,7 @@ module Google
342
348
  # @return [Float]
343
349
  attr_accessor :confidence
344
350
 
345
- # The name of the category representing the document, from the [predefined
346
- # taxonomy](https://cloud.google.com/natural-language/docs/categories).
351
+ # The name of the category representing the document.
347
352
  # Corresponds to the JSON property `name`
348
353
  # @return [String]
349
354
  attr_accessor :name
@@ -611,7 +616,7 @@ module Google
611
616
  end
612
617
 
613
618
  # All available features for sentiment, syntax, and semantic analysis. Setting
614
- # each one to true will enable that specific analysis for the input. Next ID: 11
619
+ # each one to true will enable that specific analysis for the input. Next ID: 12
615
620
  class Features
616
621
  include Google::Apis::Core::Hashable
617
622
 
@@ -652,6 +657,12 @@ module Google
652
657
  attr_accessor :extract_syntax
653
658
  alias_method :extract_syntax?, :extract_syntax
654
659
 
660
+ # Moderate the document for harmful and sensitive categories.
661
+ # Corresponds to the JSON property `moderateText`
662
+ # @return [Boolean]
663
+ attr_accessor :moderate_text
664
+ alias_method :moderate_text?, :moderate_text
665
+
655
666
  def initialize(**args)
656
667
  update!(**args)
657
668
  end
@@ -664,6 +675,45 @@ module Google
664
675
  @extract_entities = args[:extract_entities] if args.key?(:extract_entities)
665
676
  @extract_entity_sentiment = args[:extract_entity_sentiment] if args.key?(:extract_entity_sentiment)
666
677
  @extract_syntax = args[:extract_syntax] if args.key?(:extract_syntax)
678
+ @moderate_text = args[:moderate_text] if args.key?(:moderate_text)
679
+ end
680
+ end
681
+
682
+ # The document moderation request message.
683
+ class ModerateTextRequest
684
+ include Google::Apis::Core::Hashable
685
+
686
+ # Represents the input to API methods.
687
+ # Corresponds to the JSON property `document`
688
+ # @return [Google::Apis::LanguageV1beta2::Document]
689
+ attr_accessor :document
690
+
691
+ def initialize(**args)
692
+ update!(**args)
693
+ end
694
+
695
+ # Update properties of this object
696
+ def update!(**args)
697
+ @document = args[:document] if args.key?(:document)
698
+ end
699
+ end
700
+
701
+ # The document moderation response message.
702
+ class ModerateTextResponse
703
+ include Google::Apis::Core::Hashable
704
+
705
+ # Harmful and sensitive categories representing the input document.
706
+ # Corresponds to the JSON property `moderationCategories`
707
+ # @return [Array<Google::Apis::LanguageV1beta2::ClassificationCategory>]
708
+ attr_accessor :moderation_categories
709
+
710
+ def initialize(**args)
711
+ update!(**args)
712
+ end
713
+
714
+ # Update properties of this object
715
+ def update!(**args)
716
+ @moderation_categories = args[:moderation_categories] if args.key?(:moderation_categories)
667
717
  end
668
718
  end
669
719
 
@@ -16,13 +16,13 @@ module Google
16
16
  module Apis
17
17
  module LanguageV1beta2
18
18
  # Version of the google-apis-language_v1beta2 gem
19
- GEM_VERSION = "0.16.0"
19
+ GEM_VERSION = "0.18.0"
20
20
 
21
21
  # Version of the code generator used to generate this client
22
22
  GENERATOR_VERSION = "0.12.0"
23
23
 
24
24
  # Revision of the discovery document this client was generated from
25
- REVISION = "20221015"
25
+ REVISION = "20230527"
26
26
  end
27
27
  end
28
28
  end
@@ -136,6 +136,18 @@ module Google
136
136
  include Google::Apis::Core::JsonObjectSupport
137
137
  end
138
138
 
139
+ class ModerateTextRequest
140
+ class Representation < Google::Apis::Core::JsonRepresentation; end
141
+
142
+ include Google::Apis::Core::JsonObjectSupport
143
+ end
144
+
145
+ class ModerateTextResponse
146
+ class Representation < Google::Apis::Core::JsonRepresentation; end
147
+
148
+ include Google::Apis::Core::JsonObjectSupport
149
+ end
150
+
139
151
  class PartOfSpeech
140
152
  class Representation < Google::Apis::Core::JsonRepresentation; end
141
153
 
@@ -281,6 +293,8 @@ module Google
281
293
  collection :entities, as: 'entities', class: Google::Apis::LanguageV1beta2::Entity, decorator: Google::Apis::LanguageV1beta2::Entity::Representation
282
294
 
283
295
  property :language, as: 'language'
296
+ collection :moderation_categories, as: 'moderationCategories', class: Google::Apis::LanguageV1beta2::ClassificationCategory, decorator: Google::Apis::LanguageV1beta2::ClassificationCategory::Representation
297
+
284
298
  collection :sentences, as: 'sentences', class: Google::Apis::LanguageV1beta2::Sentence, decorator: Google::Apis::LanguageV1beta2::Sentence::Representation
285
299
 
286
300
  collection :tokens, as: 'tokens', class: Google::Apis::LanguageV1beta2::Token, decorator: Google::Apis::LanguageV1beta2::Token::Representation
@@ -379,6 +393,23 @@ module Google
379
393
  property :extract_entities, as: 'extractEntities'
380
394
  property :extract_entity_sentiment, as: 'extractEntitySentiment'
381
395
  property :extract_syntax, as: 'extractSyntax'
396
+ property :moderate_text, as: 'moderateText'
397
+ end
398
+ end
399
+
400
+ class ModerateTextRequest
401
+ # @private
402
+ class Representation < Google::Apis::Core::JsonRepresentation
403
+ property :document, as: 'document', class: Google::Apis::LanguageV1beta2::Document, decorator: Google::Apis::LanguageV1beta2::Document::Representation
404
+
405
+ end
406
+ end
407
+
408
+ class ModerateTextResponse
409
+ # @private
410
+ class Representation < Google::Apis::Core::JsonRepresentation
411
+ collection :moderation_categories, as: 'moderationCategories', class: Google::Apis::LanguageV1beta2::ClassificationCategory, decorator: Google::Apis::LanguageV1beta2::ClassificationCategory::Representation
412
+
382
413
  end
383
414
  end
384
415
 
@@ -236,6 +236,36 @@ module Google
236
236
  command.query['quotaUser'] = quota_user unless quota_user.nil?
237
237
  execute_or_queue_command(command, &block)
238
238
  end
239
+
240
+ # Moderates a document for harmful and sensitive categories.
241
+ # @param [Google::Apis::LanguageV1beta2::ModerateTextRequest] moderate_text_request_object
242
+ # @param [String] fields
243
+ # Selector specifying which fields to include in a partial response.
244
+ # @param [String] quota_user
245
+ # Available to use for quota purposes for server-side applications. Can be any
246
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
247
+ # @param [Google::Apis::RequestOptions] options
248
+ # Request-specific options
249
+ #
250
+ # @yield [result, err] Result & error if block supplied
251
+ # @yieldparam result [Google::Apis::LanguageV1beta2::ModerateTextResponse] parsed result object
252
+ # @yieldparam err [StandardError] error object if request failed
253
+ #
254
+ # @return [Google::Apis::LanguageV1beta2::ModerateTextResponse]
255
+ #
256
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
257
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
258
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
259
+ def moderate_document_text(moderate_text_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
260
+ command = make_simple_command(:post, 'v1beta2/documents:moderateText', options)
261
+ command.request_representation = Google::Apis::LanguageV1beta2::ModerateTextRequest::Representation
262
+ command.request_object = moderate_text_request_object
263
+ command.response_representation = Google::Apis::LanguageV1beta2::ModerateTextResponse::Representation
264
+ command.response_class = Google::Apis::LanguageV1beta2::ModerateTextResponse
265
+ command.query['fields'] = fields unless fields.nil?
266
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
267
+ execute_or_queue_command(command, &block)
268
+ end
239
269
 
240
270
  protected
241
271
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-apis-language_v1beta2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.0
4
+ version: 0.18.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: 2023-02-19 00:00:00.000000000 Z
11
+ date: 2023-06-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-apis-core
@@ -58,7 +58,7 @@ licenses:
58
58
  metadata:
59
59
  bug_tracker_uri: https://github.com/googleapis/google-api-ruby-client/issues
60
60
  changelog_uri: https://github.com/googleapis/google-api-ruby-client/tree/main/generated/google-apis-language_v1beta2/CHANGELOG.md
61
- documentation_uri: https://googleapis.dev/ruby/google-apis-language_v1beta2/v0.16.0
61
+ documentation_uri: https://googleapis.dev/ruby/google-apis-language_v1beta2/v0.18.0
62
62
  source_code_uri: https://github.com/googleapis/google-api-ruby-client/tree/main/generated/google-apis-language_v1beta2
63
63
  post_install_message:
64
64
  rdoc_options: []