google-apis-language_v1beta2 0.17.0 → 0.18.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 66e73f4c385bee644726c8ccb7e2553a33976a693e2190c0cd16454e590c9d08
|
4
|
+
data.tar.gz: 0ca43e7ba7343fc7b70c3c91daeb0bdc00fc948025f7bd699f04e5d6b1406880
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3fd7c2869d7844f40d6d5e747c0670a9b8b05d44ce8623c7e7d7c2e167e67510462a7e850d896ee33612bddae4a851bf8c6072ef8d8656b064fa49128d92e988
|
7
|
+
data.tar.gz: a7db24c887ecf5d86381776b3119758cc6258cf40af98c249c52bb1e8da9ab276a1f27bbd0f62391348757d8ac60c6adc9c6c0037e2c17f335142ba2db3411ca
|
data/CHANGELOG.md
CHANGED
@@ -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
|
@@ -651,6 +657,12 @@ module Google
|
|
651
657
|
attr_accessor :extract_syntax
|
652
658
|
alias_method :extract_syntax?, :extract_syntax
|
653
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
|
+
|
654
666
|
def initialize(**args)
|
655
667
|
update!(**args)
|
656
668
|
end
|
@@ -663,6 +675,45 @@ module Google
|
|
663
675
|
@extract_entities = args[:extract_entities] if args.key?(:extract_entities)
|
664
676
|
@extract_entity_sentiment = args[:extract_entity_sentiment] if args.key?(:extract_entity_sentiment)
|
665
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)
|
666
717
|
end
|
667
718
|
end
|
668
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.
|
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 = "
|
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.
|
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-04
|
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.
|
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: []
|