google-apis-language_v1beta2 0.17.0 → 0.19.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 035eb7d23bf14c63cf3fd8ed6d95263dfaa00e3bac104d2214012124c2b5acd9
|
4
|
+
data.tar.gz: 2f80b456edc574f4fb9aa41849eb0d97f23778694f09da6546b3c47ab811c660
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a2a1a44cbde0bcb6a68d18ec9536b7ece95316f52ee29bf7d45bcc286bf395efabd59a2a14bb7af0ff5f2ff4bce50dc743a2b4c3233c12daed8404cae5ac7ce0
|
7
|
+
data.tar.gz: 19ecf64c3ae5634dca9f572a5293b9787d3815ccdff720b84316c90d4588fbcbed86961036477c8641fc37f6e85a4ca117d13eed1c6f5f6d7c58415e6d3ac568
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# Release history for google-apis-language_v1beta2
|
2
2
|
|
3
|
+
### v0.19.0 (2023-08-06)
|
4
|
+
|
5
|
+
* Regenerated from discovery document revision 20230728
|
6
|
+
|
7
|
+
### v0.18.0 (2023-06-04)
|
8
|
+
|
9
|
+
* Regenerated from discovery document revision 20230527
|
10
|
+
|
3
11
|
### v0.17.0 (2023-04-30)
|
4
12
|
|
5
13
|
* Regenerated from discovery document revision 20230424
|
@@ -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
|
@@ -587,7 +593,7 @@ module Google
|
|
587
593
|
# @return [Google::Apis::LanguageV1beta2::Sentiment]
|
588
594
|
attr_accessor :sentiment
|
589
595
|
|
590
|
-
# Represents
|
596
|
+
# Represents a text span in the input document.
|
591
597
|
# Corresponds to the JSON property `text`
|
592
598
|
# @return [Google::Apis::LanguageV1beta2::TextSpan]
|
593
599
|
attr_accessor :text
|
@@ -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
|
|
@@ -761,7 +812,7 @@ module Google
|
|
761
812
|
# @return [Google::Apis::LanguageV1beta2::Sentiment]
|
762
813
|
attr_accessor :sentiment
|
763
814
|
|
764
|
-
# Represents
|
815
|
+
# Represents a text span in the input document.
|
765
816
|
# Corresponds to the JSON property `text`
|
766
817
|
# @return [Google::Apis::LanguageV1beta2::TextSpan]
|
767
818
|
attr_accessor :text
|
@@ -843,7 +894,7 @@ module Google
|
|
843
894
|
end
|
844
895
|
end
|
845
896
|
|
846
|
-
# Represents
|
897
|
+
# Represents a text span in the input document.
|
847
898
|
class TextSpan
|
848
899
|
include Google::Apis::Core::Hashable
|
849
900
|
|
@@ -853,7 +904,7 @@ module Google
|
|
853
904
|
# @return [Fixnum]
|
854
905
|
attr_accessor :begin_offset
|
855
906
|
|
856
|
-
# The content of the
|
907
|
+
# The content of the text span, which is a substring of the document.
|
857
908
|
# Corresponds to the JSON property `content`
|
858
909
|
# @return [String]
|
859
910
|
attr_accessor :content
|
@@ -888,7 +939,7 @@ module Google
|
|
888
939
|
# @return [Google::Apis::LanguageV1beta2::PartOfSpeech]
|
889
940
|
attr_accessor :part_of_speech
|
890
941
|
|
891
|
-
# Represents
|
942
|
+
# Represents a text span in the input document.
|
892
943
|
# Corresponds to the JSON property `text`
|
893
944
|
# @return [Google::Apis::LanguageV1beta2::TextSpan]
|
894
945
|
attr_accessor :text
|
@@ -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.19.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 = "20230728"
|
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.19.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-
|
11
|
+
date: 2023-08-06 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.19.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: []
|