google-apis-language_v1 0.17.0 → 0.19.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: df0e4ef18f8cbafecc69c55d6b3ea0c6482c0f29bb4476c975177d37d40793d1
|
4
|
+
data.tar.gz: 55656d8eb6db580fe9eddb7970544d36278bed0033959bd1f361c5992bf92816
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c587227fde476efaeeb4e0e9c39aee820ee37269d9385de1edd8fd4650d0c8471263a5bc60077388c0967a22788e629f814ca54f590d7f2a400f9d30a8142edf
|
7
|
+
data.tar.gz: 15ddb2442cb4e2abc93b072a59293ab23c7ea018bf048e64cb094f99caff6d411a2b4a1d0f9ae50bc275beb5303222e7b995957aae51d243e60d60416ecb8797
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# Release history for google-apis-language_v1
|
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
|
@@ -302,6 +302,11 @@ module Google
|
|
302
302
|
# @return [String]
|
303
303
|
attr_accessor :language
|
304
304
|
|
305
|
+
# Harmful and sensitive categories identified in the input document.
|
306
|
+
# Corresponds to the JSON property `moderationCategories`
|
307
|
+
# @return [Array<Google::Apis::LanguageV1::ClassificationCategory>]
|
308
|
+
attr_accessor :moderation_categories
|
309
|
+
|
305
310
|
# Sentences in the input document. Populated if the user enables
|
306
311
|
# AnnotateTextRequest.Features.extract_syntax.
|
307
312
|
# Corresponds to the JSON property `sentences`
|
@@ -324,6 +329,7 @@ module Google
|
|
324
329
|
@document_sentiment = args[:document_sentiment] if args.key?(:document_sentiment)
|
325
330
|
@entities = args[:entities] if args.key?(:entities)
|
326
331
|
@language = args[:language] if args.key?(:language)
|
332
|
+
@moderation_categories = args[:moderation_categories] if args.key?(:moderation_categories)
|
327
333
|
@sentences = args[:sentences] if args.key?(:sentences)
|
328
334
|
@tokens = args[:tokens] if args.key?(:tokens)
|
329
335
|
end
|
@@ -568,7 +574,7 @@ module Google
|
|
568
574
|
# @return [Google::Apis::LanguageV1::Sentiment]
|
569
575
|
attr_accessor :sentiment
|
570
576
|
|
571
|
-
# Represents
|
577
|
+
# Represents a text span in the input document.
|
572
578
|
# Corresponds to the JSON property `text`
|
573
579
|
# @return [Google::Apis::LanguageV1::TextSpan]
|
574
580
|
attr_accessor :text
|
@@ -630,6 +636,12 @@ module Google
|
|
630
636
|
attr_accessor :extract_syntax
|
631
637
|
alias_method :extract_syntax?, :extract_syntax
|
632
638
|
|
639
|
+
# Moderate the document for harmful and sensitive categories.
|
640
|
+
# Corresponds to the JSON property `moderateText`
|
641
|
+
# @return [Boolean]
|
642
|
+
attr_accessor :moderate_text
|
643
|
+
alias_method :moderate_text?, :moderate_text
|
644
|
+
|
633
645
|
def initialize(**args)
|
634
646
|
update!(**args)
|
635
647
|
end
|
@@ -642,6 +654,45 @@ module Google
|
|
642
654
|
@extract_entities = args[:extract_entities] if args.key?(:extract_entities)
|
643
655
|
@extract_entity_sentiment = args[:extract_entity_sentiment] if args.key?(:extract_entity_sentiment)
|
644
656
|
@extract_syntax = args[:extract_syntax] if args.key?(:extract_syntax)
|
657
|
+
@moderate_text = args[:moderate_text] if args.key?(:moderate_text)
|
658
|
+
end
|
659
|
+
end
|
660
|
+
|
661
|
+
# The document moderation request message.
|
662
|
+
class ModerateTextRequest
|
663
|
+
include Google::Apis::Core::Hashable
|
664
|
+
|
665
|
+
# Represents the input to API methods.
|
666
|
+
# Corresponds to the JSON property `document`
|
667
|
+
# @return [Google::Apis::LanguageV1::Document]
|
668
|
+
attr_accessor :document
|
669
|
+
|
670
|
+
def initialize(**args)
|
671
|
+
update!(**args)
|
672
|
+
end
|
673
|
+
|
674
|
+
# Update properties of this object
|
675
|
+
def update!(**args)
|
676
|
+
@document = args[:document] if args.key?(:document)
|
677
|
+
end
|
678
|
+
end
|
679
|
+
|
680
|
+
# The document moderation response message.
|
681
|
+
class ModerateTextResponse
|
682
|
+
include Google::Apis::Core::Hashable
|
683
|
+
|
684
|
+
# Harmful and sensitive categories representing the input document.
|
685
|
+
# Corresponds to the JSON property `moderationCategories`
|
686
|
+
# @return [Array<Google::Apis::LanguageV1::ClassificationCategory>]
|
687
|
+
attr_accessor :moderation_categories
|
688
|
+
|
689
|
+
def initialize(**args)
|
690
|
+
update!(**args)
|
691
|
+
end
|
692
|
+
|
693
|
+
# Update properties of this object
|
694
|
+
def update!(**args)
|
695
|
+
@moderation_categories = args[:moderation_categories] if args.key?(:moderation_categories)
|
645
696
|
end
|
646
697
|
end
|
647
698
|
|
@@ -740,7 +791,7 @@ module Google
|
|
740
791
|
# @return [Google::Apis::LanguageV1::Sentiment]
|
741
792
|
attr_accessor :sentiment
|
742
793
|
|
743
|
-
# Represents
|
794
|
+
# Represents a text span in the input document.
|
744
795
|
# Corresponds to the JSON property `text`
|
745
796
|
# @return [Google::Apis::LanguageV1::TextSpan]
|
746
797
|
attr_accessor :text
|
@@ -821,7 +872,7 @@ module Google
|
|
821
872
|
end
|
822
873
|
end
|
823
874
|
|
824
|
-
# Represents
|
875
|
+
# Represents a text span in the input document.
|
825
876
|
class TextSpan
|
826
877
|
include Google::Apis::Core::Hashable
|
827
878
|
|
@@ -831,7 +882,7 @@ module Google
|
|
831
882
|
# @return [Fixnum]
|
832
883
|
attr_accessor :begin_offset
|
833
884
|
|
834
|
-
# The content of the
|
885
|
+
# The content of the text span, which is a substring of the document.
|
835
886
|
# Corresponds to the JSON property `content`
|
836
887
|
# @return [String]
|
837
888
|
attr_accessor :content
|
@@ -868,7 +919,7 @@ module Google
|
|
868
919
|
# @return [Google::Apis::LanguageV1::PartOfSpeech]
|
869
920
|
attr_accessor :part_of_speech
|
870
921
|
|
871
|
-
# Represents
|
922
|
+
# Represents a text span in the input document.
|
872
923
|
# Corresponds to the JSON property `text`
|
873
924
|
# @return [Google::Apis::LanguageV1::TextSpan]
|
874
925
|
attr_accessor :text
|
@@ -16,13 +16,13 @@ module Google
|
|
16
16
|
module Apis
|
17
17
|
module LanguageV1
|
18
18
|
# Version of the google-apis-language_v1 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::LanguageV1::Entity, decorator: Google::Apis::LanguageV1::Entity::Representation
|
282
294
|
|
283
295
|
property :language, as: 'language'
|
296
|
+
collection :moderation_categories, as: 'moderationCategories', class: Google::Apis::LanguageV1::ClassificationCategory, decorator: Google::Apis::LanguageV1::ClassificationCategory::Representation
|
297
|
+
|
284
298
|
collection :sentences, as: 'sentences', class: Google::Apis::LanguageV1::Sentence, decorator: Google::Apis::LanguageV1::Sentence::Representation
|
285
299
|
|
286
300
|
collection :tokens, as: 'tokens', class: Google::Apis::LanguageV1::Token, decorator: Google::Apis::LanguageV1::Token::Representation
|
@@ -377,6 +391,23 @@ module Google
|
|
377
391
|
property :extract_entities, as: 'extractEntities'
|
378
392
|
property :extract_entity_sentiment, as: 'extractEntitySentiment'
|
379
393
|
property :extract_syntax, as: 'extractSyntax'
|
394
|
+
property :moderate_text, as: 'moderateText'
|
395
|
+
end
|
396
|
+
end
|
397
|
+
|
398
|
+
class ModerateTextRequest
|
399
|
+
# @private
|
400
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
401
|
+
property :document, as: 'document', class: Google::Apis::LanguageV1::Document, decorator: Google::Apis::LanguageV1::Document::Representation
|
402
|
+
|
403
|
+
end
|
404
|
+
end
|
405
|
+
|
406
|
+
class ModerateTextResponse
|
407
|
+
# @private
|
408
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
409
|
+
collection :moderation_categories, as: 'moderationCategories', class: Google::Apis::LanguageV1::ClassificationCategory, decorator: Google::Apis::LanguageV1::ClassificationCategory::Representation
|
410
|
+
|
380
411
|
end
|
381
412
|
end
|
382
413
|
|
@@ -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::LanguageV1::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::LanguageV1::ModerateTextResponse] parsed result object
|
252
|
+
# @yieldparam err [StandardError] error object if request failed
|
253
|
+
#
|
254
|
+
# @return [Google::Apis::LanguageV1::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, 'v1/documents:moderateText', options)
|
261
|
+
command.request_representation = Google::Apis::LanguageV1::ModerateTextRequest::Representation
|
262
|
+
command.request_object = moderate_text_request_object
|
263
|
+
command.response_representation = Google::Apis::LanguageV1::ModerateTextResponse::Representation
|
264
|
+
command.response_class = Google::Apis::LanguageV1::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_v1
|
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_v1/CHANGELOG.md
|
61
|
-
documentation_uri: https://googleapis.dev/ruby/google-apis-language_v1/v0.
|
61
|
+
documentation_uri: https://googleapis.dev/ruby/google-apis-language_v1/v0.19.0
|
62
62
|
source_code_uri: https://github.com/googleapis/google-api-ruby-client/tree/main/generated/google-apis-language_v1
|
63
63
|
post_install_message:
|
64
64
|
rdoc_options: []
|