google-api-client 0.9.8 → 0.9.20
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +37 -0
- data/Gemfile +9 -1
- data/README.md +10 -2
- data/api_names.yaml +63 -110
- data/generated/google/apis/adexchangebuyer2_v2beta1.rb +35 -0
- data/generated/google/apis/adexchangebuyer2_v2beta1/classes.rb +298 -0
- data/generated/google/apis/adexchangebuyer2_v2beta1/representations.rb +122 -0
- data/generated/google/apis/adexchangebuyer2_v2beta1/service.rb +458 -0
- data/generated/google/apis/adexchangebuyer_v1_4.rb +1 -1
- data/generated/google/apis/adexchangebuyer_v1_4/classes.rb +260 -13
- data/generated/google/apis/adexchangebuyer_v1_4/representations.rb +81 -0
- data/generated/google/apis/adexchangebuyer_v1_4/service.rb +60 -8
- data/generated/google/apis/adexchangeseller_v2_0.rb +2 -3
- data/generated/google/apis/adexchangeseller_v2_0/service.rb +1 -2
- data/generated/google/apis/admin_directory_v1.rb +1 -1
- data/generated/google/apis/admin_directory_v1/classes.rb +86 -0
- data/generated/google/apis/admin_directory_v1/representations.rb +24 -0
- data/generated/google/apis/admin_directory_v1/service.rb +41 -2
- data/generated/google/apis/admin_reports_v1.rb +3 -3
- data/generated/google/apis/admin_reports_v1/service.rb +2 -2
- data/generated/google/apis/adsense_v1_4.rb +1 -1
- data/generated/google/apis/adsense_v1_4/classes.rb +1 -1
- data/generated/google/apis/adsensehost_v4_1.rb +1 -1
- data/generated/google/apis/adsensehost_v4_1/classes.rb +1 -2
- data/generated/google/apis/analytics_v3.rb +1 -1
- data/generated/google/apis/analytics_v3/classes.rb +379 -3
- data/generated/google/apis/analytics_v3/representations.rb +136 -0
- data/generated/google/apis/analytics_v3/service.rb +217 -0
- data/generated/google/apis/analyticsreporting_v4.rb +1 -1
- data/generated/google/apis/analyticsreporting_v4/classes.rb +50 -22
- data/generated/google/apis/androidenterprise_v1.rb +1 -1
- data/generated/google/apis/androidenterprise_v1/classes.rb +813 -49
- data/generated/google/apis/androidenterprise_v1/representations.rb +336 -0
- data/generated/google/apis/androidenterprise_v1/service.rb +1234 -145
- data/generated/google/apis/androidpublisher_v2.rb +1 -1
- data/generated/google/apis/androidpublisher_v2/classes.rb +47 -8
- data/generated/google/apis/androidpublisher_v2/representations.rb +27 -0
- data/generated/google/apis/androidpublisher_v2/service.rb +55 -0
- data/generated/google/apis/appengine_v1beta5.rb +7 -1
- data/generated/google/apis/appengine_v1beta5/classes.rb +516 -313
- data/generated/google/apis/appengine_v1beta5/representations.rb +115 -22
- data/generated/google/apis/appengine_v1beta5/service.rb +329 -33
- data/generated/google/apis/appsactivity_v1.rb +1 -1
- data/generated/google/apis/appsactivity_v1/classes.rb +7 -0
- data/generated/google/apis/appsactivity_v1/representations.rb +1 -0
- data/generated/google/apis/appstate_v1.rb +1 -1
- data/generated/google/apis/bigquery_v2.rb +1 -1
- data/generated/google/apis/bigquery_v2/classes.rb +277 -20
- data/generated/google/apis/bigquery_v2/representations.rb +86 -0
- data/generated/google/apis/bigquery_v2/service.rb +8 -2
- data/generated/google/apis/books_v1.rb +2 -2
- data/generated/google/apis/books_v1/classes.rb +79 -1
- data/generated/google/apis/books_v1/representations.rb +34 -0
- data/generated/google/apis/books_v1/service.rb +7 -3
- data/generated/google/apis/calendar_v3.rb +1 -1
- data/generated/google/apis/civicinfo_v2.rb +3 -2
- data/generated/google/apis/civicinfo_v2/classes.rb +377 -5
- data/generated/google/apis/civicinfo_v2/representations.rb +149 -0
- data/generated/google/apis/civicinfo_v2/service.rb +27 -6
- data/generated/google/apis/classroom_v1.rb +1 -1
- data/generated/google/apis/classroom_v1/classes.rb +183 -37
- data/generated/google/apis/classroom_v1/representations.rb +74 -9
- data/generated/google/apis/classroom_v1/service.rb +403 -38
- data/generated/google/apis/cloudbuild_v1.rb +1 -1
- data/generated/google/apis/cloudbuild_v1/classes.rb +381 -17
- data/generated/google/apis/cloudbuild_v1/representations.rb +137 -2
- data/generated/google/apis/cloudbuild_v1/service.rb +174 -1
- data/generated/google/apis/clouddebugger_v2.rb +3 -6
- data/generated/google/apis/clouddebugger_v2/service.rb +4 -4
- data/generated/google/apis/cloudmonitoring_v2beta2.rb +1 -1
- data/generated/google/apis/cloudresourcemanager_v1.rb +1 -1
- data/generated/google/apis/cloudresourcemanager_v1/classes.rb +502 -111
- data/generated/google/apis/cloudresourcemanager_v1/representations.rb +162 -24
- data/generated/google/apis/cloudresourcemanager_v1/service.rb +274 -30
- data/generated/google/apis/cloudresourcemanager_v1beta1.rb +1 -1
- data/generated/google/apis/cloudresourcemanager_v1beta1/classes.rb +121 -9
- data/generated/google/apis/cloudresourcemanager_v1beta1/representations.rb +46 -0
- data/generated/google/apis/cloudresourcemanager_v1beta1/service.rb +71 -58
- data/generated/google/apis/compute_beta.rb +1 -1
- data/generated/google/apis/compute_beta/classes.rb +2299 -434
- data/generated/google/apis/compute_beta/representations.rb +752 -33
- data/generated/google/apis/compute_beta/service.rb +6067 -3153
- data/generated/google/apis/compute_v1.rb +1 -1
- data/generated/google/apis/compute_v1/classes.rb +1681 -207
- data/generated/google/apis/compute_v1/representations.rb +552 -0
- data/generated/google/apis/compute_v1/service.rb +2797 -1171
- data/generated/google/apis/content_v2.rb +1 -1
- data/generated/google/apis/content_v2/classes.rb +757 -1
- data/generated/google/apis/content_v2/representations.rb +337 -0
- data/generated/google/apis/content_v2/service.rb +244 -0
- data/generated/google/apis/dataflow_v1b3.rb +38 -0
- data/generated/google/apis/dataflow_v1b3/classes.rb +4053 -0
- data/generated/google/apis/dataflow_v1b3/representations.rb +1736 -0
- data/generated/google/apis/dataflow_v1b3/service.rb +875 -0
- data/generated/google/apis/dataproc_v1.rb +2 -2
- data/generated/google/apis/dataproc_v1/classes.rb +213 -68
- data/generated/google/apis/dataproc_v1/representations.rb +38 -0
- data/generated/google/apis/dataproc_v1/service.rb +78 -48
- data/generated/google/apis/datastore_v1.rb +38 -0
- data/generated/google/apis/datastore_v1/classes.rb +1284 -0
- data/generated/google/apis/datastore_v1/representations.rb +572 -0
- data/generated/google/apis/datastore_v1/service.rb +259 -0
- data/generated/google/apis/datastore_v1beta3.rb +38 -0
- data/generated/google/apis/datastore_v1beta3/classes.rb +1284 -0
- data/generated/google/apis/datastore_v1beta3/representations.rb +572 -0
- data/generated/google/apis/datastore_v1beta3/service.rb +259 -0
- data/generated/google/apis/deploymentmanager_v2.rb +1 -1
- data/generated/google/apis/deploymentmanager_v2/classes.rb +384 -2
- data/generated/google/apis/deploymentmanager_v2/representations.rb +161 -0
- data/generated/google/apis/deploymentmanager_v2/service.rb +217 -55
- data/generated/google/apis/dfareporting_v2_5.rb +40 -0
- data/generated/google/apis/dfareporting_v2_5/classes.rb +11225 -0
- data/generated/google/apis/dfareporting_v2_5/representations.rb +3982 -0
- data/generated/google/apis/dfareporting_v2_5/service.rb +8755 -0
- data/generated/google/apis/dfareporting_v2_6.rb +40 -0
- data/generated/google/apis/dfareporting_v2_6/classes.rb +11586 -0
- data/generated/google/apis/dfareporting_v2_6/representations.rb +4119 -0
- data/generated/google/apis/dfareporting_v2_6/service.rb +9025 -0
- data/generated/google/apis/dns_v1.rb +1 -1
- data/generated/google/apis/dns_v1/classes.rb +1 -1
- data/generated/google/apis/doubleclickbidmanager_v1.rb +1 -1
- data/generated/google/apis/doubleclickbidmanager_v1/classes.rb +79 -86
- data/generated/google/apis/doubleclickbidmanager_v1/representations.rb +25 -28
- data/generated/google/apis/doubleclickbidmanager_v1/service.rb +10 -8
- data/generated/google/apis/doubleclicksearch_v2.rb +1 -1
- data/generated/google/apis/drive_v2.rb +1 -1
- data/generated/google/apis/drive_v2/classes.rb +27 -3
- data/generated/google/apis/drive_v2/representations.rb +4 -0
- data/generated/google/apis/drive_v2/service.rb +16 -3
- data/generated/google/apis/drive_v3.rb +1 -1
- data/generated/google/apis/drive_v3/classes.rb +50 -16
- data/generated/google/apis/drive_v3/representations.rb +4 -0
- data/generated/google/apis/drive_v3/service.rb +12 -2
- data/generated/google/apis/fitness_v1.rb +8 -2
- data/generated/google/apis/fitness_v1/classes.rb +64 -6
- data/generated/google/apis/fitness_v1/representations.rb +20 -0
- data/generated/google/apis/fitness_v1/service.rb +17 -18
- data/generated/google/apis/fusiontables_v2.rb +1 -1
- data/generated/google/apis/fusiontables_v2/classes.rb +4 -3
- data/generated/google/apis/games_configuration_v1configuration.rb +1 -1
- data/generated/google/apis/games_management_v1management.rb +1 -1
- data/generated/google/apis/games_v1.rb +1 -1
- data/generated/google/apis/genomics_v1.rb +2 -4
- data/generated/google/apis/genomics_v1/classes.rb +143 -34
- data/generated/google/apis/genomics_v1/representations.rb +48 -11
- data/generated/google/apis/genomics_v1/service.rb +35 -37
- data/generated/google/apis/gmail_v1.rb +10 -1
- data/generated/google/apis/gmail_v1/classes.rb +542 -4
- data/generated/google/apis/gmail_v1/representations.rb +213 -0
- data/generated/google/apis/gmail_v1/service.rb +898 -1
- data/generated/google/apis/groupssettings_v1.rb +1 -1
- data/generated/google/apis/groupssettings_v1/classes.rb +12 -0
- data/generated/google/apis/groupssettings_v1/representations.rb +2 -0
- data/generated/google/apis/iam_v1.rb +2 -2
- data/generated/google/apis/iam_v1/classes.rb +181 -206
- data/generated/google/apis/iam_v1/representations.rb +36 -45
- data/generated/google/apis/iam_v1/service.rb +101 -67
- data/generated/google/apis/identitytoolkit_v3.rb +4 -1
- data/generated/google/apis/identitytoolkit_v3/classes.rb +171 -1
- data/generated/google/apis/identitytoolkit_v3/representations.rb +26 -0
- data/generated/google/apis/language_v1beta1.rb +36 -0
- data/generated/google/apis/language_v1beta1/classes.rb +599 -0
- data/generated/google/apis/language_v1beta1/representations.rb +289 -0
- data/generated/google/apis/language_v1beta1/service.rb +152 -0
- data/generated/google/apis/logging_v2beta1.rb +6 -6
- data/generated/google/apis/logging_v2beta1/classes.rb +760 -731
- data/generated/google/apis/logging_v2beta1/representations.rb +136 -147
- data/generated/google/apis/logging_v2beta1/service.rb +290 -209
- data/generated/google/apis/mirror_v1.rb +2 -2
- data/generated/google/apis/mirror_v1/service.rb +1 -1
- data/generated/google/apis/monitoring_v3.rb +45 -0
- data/generated/google/apis/monitoring_v3/classes.rb +1337 -0
- data/generated/google/apis/monitoring_v3/representations.rb +516 -0
- data/generated/google/apis/monitoring_v3/service.rb +711 -0
- data/generated/google/apis/oauth2_v2.rb +1 -1
- data/generated/google/apis/pagespeedonline_v2.rb +1 -1
- data/generated/google/apis/plus_domains_v1.rb +1 -1
- data/generated/google/apis/plus_v1.rb +1 -1
- data/generated/google/apis/pubsub_v1.rb +1 -1
- data/generated/google/apis/pubsub_v1/classes.rb +10 -9
- data/generated/google/apis/pubsub_v1/service.rb +128 -27
- data/generated/google/apis/qpx_express_v1.rb +1 -1
- data/generated/google/apis/qpx_express_v1/classes.rb +6 -0
- data/generated/google/apis/qpx_express_v1/representations.rb +1 -0
- data/generated/google/apis/replicapool_v1beta2.rb +1 -1
- data/generated/google/apis/replicapoolupdater_v1beta1.rb +4 -2
- data/generated/google/apis/replicapoolupdater_v1beta1/service.rb +3 -1
- data/generated/google/apis/script_v1.rb +1 -1
- data/generated/google/apis/script_v1/classes.rb +6 -0
- data/generated/google/apis/script_v1/representations.rb +1 -0
- data/generated/google/apis/sheets_v4.rb +1 -1
- data/generated/google/apis/sheets_v4/classes.rb +910 -89
- data/generated/google/apis/sheets_v4/representations.rb +194 -10
- data/generated/google/apis/sheets_v4/service.rb +216 -49
- data/generated/google/apis/slides_v1.rb +49 -0
- data/generated/google/apis/slides_v1/classes.rb +3926 -0
- data/generated/google/apis/slides_v1/representations.rb +1722 -0
- data/generated/google/apis/slides_v1/service.rb +202 -0
- data/generated/google/apis/speech_v1beta1.rb +34 -0
- data/generated/google/apis/speech_v1beta1/classes.rb +511 -0
- data/generated/google/apis/speech_v1beta1/representations.rb +218 -0
- data/generated/google/apis/speech_v1beta1/service.rb +271 -0
- data/generated/google/apis/sqladmin_v1beta4.rb +1 -1
- data/generated/google/apis/sqladmin_v1beta4/classes.rb +32 -8
- data/generated/google/apis/sqladmin_v1beta4/representations.rb +3 -0
- data/generated/google/apis/sqladmin_v1beta4/service.rb +42 -0
- data/generated/google/apis/storage_v1.rb +1 -1
- data/generated/google/apis/storage_v1/classes.rb +43 -18
- data/generated/google/apis/storage_v1/representations.rb +4 -1
- data/generated/google/apis/storage_v1/service.rb +5 -2
- data/generated/google/apis/translate_v2.rb +2 -2
- data/generated/google/apis/translate_v2/service.rb +1 -1
- data/generated/google/apis/vision_v1.rb +1 -1
- data/generated/google/apis/vision_v1/classes.rb +12 -11
- data/generated/google/apis/youtube_analytics_v1.rb +1 -1
- data/generated/google/apis/youtube_partner_v1.rb +1 -1
- data/generated/google/apis/youtube_partner_v1/classes.rb +6 -0
- data/generated/google/apis/youtube_partner_v1/representations.rb +2 -0
- data/generated/google/apis/youtube_partner_v1/service.rb +15 -3
- data/generated/google/apis/youtube_v3.rb +1 -1
- data/generated/google/apis/youtube_v3/classes.rb +183 -21
- data/generated/google/apis/youtube_v3/representations.rb +85 -4
- data/generated/google/apis/youtube_v3/service.rb +41 -5
- data/generated/google/apis/youtubereporting_v1.rb +1 -1
- data/google-api-client.gemspec +2 -1
- data/lib/google/apis/core/api_command.rb +4 -0
- data/lib/google/apis/core/base_service.rb +10 -4
- data/lib/google/apis/core/download.rb +7 -2
- data/lib/google/apis/core/http_command.rb +5 -1
- data/lib/google/apis/core/upload.rb +7 -1
- data/lib/google/apis/errors.rb +2 -2
- data/lib/google/apis/generator/annotator.rb +6 -0
- data/lib/google/apis/version.rb +1 -1
- data/samples/cli/lib/samples/bigquery.rb +101 -0
- data/samples/cli/lib/samples/sheets.rb +61 -0
- data/sync.rb +71 -0
- metadata +55 -13
@@ -0,0 +1,218 @@
|
|
1
|
+
# Copyright 2015 Google Inc.
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
15
|
+
require 'date'
|
16
|
+
require 'google/apis/core/base_service'
|
17
|
+
require 'google/apis/core/json_representation'
|
18
|
+
require 'google/apis/core/hashable'
|
19
|
+
require 'google/apis/errors'
|
20
|
+
|
21
|
+
module Google
|
22
|
+
module Apis
|
23
|
+
module SpeechV1beta1
|
24
|
+
|
25
|
+
class Status
|
26
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
27
|
+
|
28
|
+
include Google::Apis::Core::JsonObjectSupport
|
29
|
+
end
|
30
|
+
|
31
|
+
class RecognitionAudio
|
32
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
33
|
+
|
34
|
+
include Google::Apis::Core::JsonObjectSupport
|
35
|
+
end
|
36
|
+
|
37
|
+
class Operation
|
38
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
39
|
+
|
40
|
+
include Google::Apis::Core::JsonObjectSupport
|
41
|
+
end
|
42
|
+
|
43
|
+
class SpeechRecognitionAlternative
|
44
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
45
|
+
|
46
|
+
include Google::Apis::Core::JsonObjectSupport
|
47
|
+
end
|
48
|
+
|
49
|
+
class CancelOperationRequest
|
50
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
51
|
+
|
52
|
+
include Google::Apis::Core::JsonObjectSupport
|
53
|
+
end
|
54
|
+
|
55
|
+
class RecognitionConfig
|
56
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
57
|
+
|
58
|
+
include Google::Apis::Core::JsonObjectSupport
|
59
|
+
end
|
60
|
+
|
61
|
+
class SyncRecognizeRequest
|
62
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
63
|
+
|
64
|
+
include Google::Apis::Core::JsonObjectSupport
|
65
|
+
end
|
66
|
+
|
67
|
+
class SpeechRecognitionResult
|
68
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
69
|
+
|
70
|
+
include Google::Apis::Core::JsonObjectSupport
|
71
|
+
end
|
72
|
+
|
73
|
+
class ListOperationsResponse
|
74
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
75
|
+
|
76
|
+
include Google::Apis::Core::JsonObjectSupport
|
77
|
+
end
|
78
|
+
|
79
|
+
class Empty
|
80
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
81
|
+
|
82
|
+
include Google::Apis::Core::JsonObjectSupport
|
83
|
+
end
|
84
|
+
|
85
|
+
class SyncRecognizeResponse
|
86
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
87
|
+
|
88
|
+
include Google::Apis::Core::JsonObjectSupport
|
89
|
+
end
|
90
|
+
|
91
|
+
class SpeechContext
|
92
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
93
|
+
|
94
|
+
include Google::Apis::Core::JsonObjectSupport
|
95
|
+
end
|
96
|
+
|
97
|
+
class AsyncRecognizeRequest
|
98
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
99
|
+
|
100
|
+
include Google::Apis::Core::JsonObjectSupport
|
101
|
+
end
|
102
|
+
|
103
|
+
class Status
|
104
|
+
# @private
|
105
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
106
|
+
property :code, as: 'code'
|
107
|
+
collection :details, as: 'details'
|
108
|
+
property :message, as: 'message'
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
112
|
+
class RecognitionAudio
|
113
|
+
# @private
|
114
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
115
|
+
property :content, :base64 => true, as: 'content'
|
116
|
+
property :uri, as: 'uri'
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
120
|
+
class Operation
|
121
|
+
# @private
|
122
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
123
|
+
property :error, as: 'error', class: Google::Apis::SpeechV1beta1::Status, decorator: Google::Apis::SpeechV1beta1::Status::Representation
|
124
|
+
|
125
|
+
property :done, as: 'done'
|
126
|
+
hash :metadata, as: 'metadata'
|
127
|
+
hash :response, as: 'response'
|
128
|
+
property :name, as: 'name'
|
129
|
+
end
|
130
|
+
end
|
131
|
+
|
132
|
+
class SpeechRecognitionAlternative
|
133
|
+
# @private
|
134
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
135
|
+
property :transcript, as: 'transcript'
|
136
|
+
property :confidence, as: 'confidence'
|
137
|
+
end
|
138
|
+
end
|
139
|
+
|
140
|
+
class CancelOperationRequest
|
141
|
+
# @private
|
142
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
143
|
+
end
|
144
|
+
end
|
145
|
+
|
146
|
+
class RecognitionConfig
|
147
|
+
# @private
|
148
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
149
|
+
property :max_alternatives, as: 'maxAlternatives'
|
150
|
+
property :language_code, as: 'languageCode'
|
151
|
+
property :speech_context, as: 'speechContext', class: Google::Apis::SpeechV1beta1::SpeechContext, decorator: Google::Apis::SpeechV1beta1::SpeechContext::Representation
|
152
|
+
|
153
|
+
property :encoding, as: 'encoding'
|
154
|
+
property :profanity_filter, as: 'profanityFilter'
|
155
|
+
property :sample_rate, as: 'sampleRate'
|
156
|
+
end
|
157
|
+
end
|
158
|
+
|
159
|
+
class SyncRecognizeRequest
|
160
|
+
# @private
|
161
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
162
|
+
property :audio, as: 'audio', class: Google::Apis::SpeechV1beta1::RecognitionAudio, decorator: Google::Apis::SpeechV1beta1::RecognitionAudio::Representation
|
163
|
+
|
164
|
+
property :config, as: 'config', class: Google::Apis::SpeechV1beta1::RecognitionConfig, decorator: Google::Apis::SpeechV1beta1::RecognitionConfig::Representation
|
165
|
+
|
166
|
+
end
|
167
|
+
end
|
168
|
+
|
169
|
+
class SpeechRecognitionResult
|
170
|
+
# @private
|
171
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
172
|
+
collection :alternatives, as: 'alternatives', class: Google::Apis::SpeechV1beta1::SpeechRecognitionAlternative, decorator: Google::Apis::SpeechV1beta1::SpeechRecognitionAlternative::Representation
|
173
|
+
|
174
|
+
end
|
175
|
+
end
|
176
|
+
|
177
|
+
class ListOperationsResponse
|
178
|
+
# @private
|
179
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
180
|
+
property :next_page_token, as: 'nextPageToken'
|
181
|
+
collection :operations, as: 'operations', class: Google::Apis::SpeechV1beta1::Operation, decorator: Google::Apis::SpeechV1beta1::Operation::Representation
|
182
|
+
|
183
|
+
end
|
184
|
+
end
|
185
|
+
|
186
|
+
class Empty
|
187
|
+
# @private
|
188
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
189
|
+
end
|
190
|
+
end
|
191
|
+
|
192
|
+
class SyncRecognizeResponse
|
193
|
+
# @private
|
194
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
195
|
+
collection :results, as: 'results', class: Google::Apis::SpeechV1beta1::SpeechRecognitionResult, decorator: Google::Apis::SpeechV1beta1::SpeechRecognitionResult::Representation
|
196
|
+
|
197
|
+
end
|
198
|
+
end
|
199
|
+
|
200
|
+
class SpeechContext
|
201
|
+
# @private
|
202
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
203
|
+
collection :phrases, as: 'phrases'
|
204
|
+
end
|
205
|
+
end
|
206
|
+
|
207
|
+
class AsyncRecognizeRequest
|
208
|
+
# @private
|
209
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
210
|
+
property :audio, as: 'audio', class: Google::Apis::SpeechV1beta1::RecognitionAudio, decorator: Google::Apis::SpeechV1beta1::RecognitionAudio::Representation
|
211
|
+
|
212
|
+
property :config, as: 'config', class: Google::Apis::SpeechV1beta1::RecognitionConfig, decorator: Google::Apis::SpeechV1beta1::RecognitionConfig::Representation
|
213
|
+
|
214
|
+
end
|
215
|
+
end
|
216
|
+
end
|
217
|
+
end
|
218
|
+
end
|
@@ -0,0 +1,271 @@
|
|
1
|
+
# Copyright 2015 Google Inc.
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
15
|
+
require 'google/apis/core/base_service'
|
16
|
+
require 'google/apis/core/json_representation'
|
17
|
+
require 'google/apis/core/hashable'
|
18
|
+
require 'google/apis/errors'
|
19
|
+
|
20
|
+
module Google
|
21
|
+
module Apis
|
22
|
+
module SpeechV1beta1
|
23
|
+
# Google Cloud Speech API
|
24
|
+
#
|
25
|
+
# Google Cloud Speech API.
|
26
|
+
#
|
27
|
+
# @example
|
28
|
+
# require 'google/apis/speech_v1beta1'
|
29
|
+
#
|
30
|
+
# Speech = Google::Apis::SpeechV1beta1 # Alias the module
|
31
|
+
# service = Speech::SpeechService.new
|
32
|
+
#
|
33
|
+
# @see https://cloud.google.com/speech/
|
34
|
+
class SpeechService < Google::Apis::Core::BaseService
|
35
|
+
# @return [String]
|
36
|
+
# API key. Your API key identifies your project and provides you with API access,
|
37
|
+
# quota, and reports. Required unless you provide an OAuth 2.0 token.
|
38
|
+
attr_accessor :key
|
39
|
+
|
40
|
+
# @return [String]
|
41
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
42
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
43
|
+
attr_accessor :quota_user
|
44
|
+
|
45
|
+
def initialize
|
46
|
+
super('https://speech.googleapis.com/', '')
|
47
|
+
end
|
48
|
+
|
49
|
+
# Gets the latest state of a long-running operation. Clients can use this
|
50
|
+
# method to poll the operation result at intervals as recommended by the API
|
51
|
+
# service.
|
52
|
+
# @param [String] name
|
53
|
+
# The name of the operation resource.
|
54
|
+
# @param [String] quota_user
|
55
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
56
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
57
|
+
# @param [String] fields
|
58
|
+
# Selector specifying which fields to include in a partial response.
|
59
|
+
# @param [Google::Apis::RequestOptions] options
|
60
|
+
# Request-specific options
|
61
|
+
#
|
62
|
+
# @yield [result, err] Result & error if block supplied
|
63
|
+
# @yieldparam result [Google::Apis::SpeechV1beta1::Operation] parsed result object
|
64
|
+
# @yieldparam err [StandardError] error object if request failed
|
65
|
+
#
|
66
|
+
# @return [Google::Apis::SpeechV1beta1::Operation]
|
67
|
+
#
|
68
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
69
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
70
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
71
|
+
def get_operation(name, quota_user: nil, fields: nil, options: nil, &block)
|
72
|
+
command = make_simple_command(:get, 'v1beta1/operations/{+name}', options)
|
73
|
+
command.response_representation = Google::Apis::SpeechV1beta1::Operation::Representation
|
74
|
+
command.response_class = Google::Apis::SpeechV1beta1::Operation
|
75
|
+
command.params['name'] = name unless name.nil?
|
76
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
77
|
+
command.query['fields'] = fields unless fields.nil?
|
78
|
+
execute_or_queue_command(command, &block)
|
79
|
+
end
|
80
|
+
|
81
|
+
# Lists operations that match the specified filter in the request. If the
|
82
|
+
# server doesn't support this method, it returns `UNIMPLEMENTED`.
|
83
|
+
# NOTE: the `name` binding below allows API services to override the binding
|
84
|
+
# to use different resource name schemes, such as `users/*/operations`.
|
85
|
+
# @param [Fixnum] page_size
|
86
|
+
# The standard list page size.
|
87
|
+
# @param [String] filter
|
88
|
+
# The standard list filter.
|
89
|
+
# @param [String] name
|
90
|
+
# The name of the operation collection.
|
91
|
+
# @param [String] page_token
|
92
|
+
# The standard list page token.
|
93
|
+
# @param [String] quota_user
|
94
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
95
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
96
|
+
# @param [String] fields
|
97
|
+
# Selector specifying which fields to include in a partial response.
|
98
|
+
# @param [Google::Apis::RequestOptions] options
|
99
|
+
# Request-specific options
|
100
|
+
#
|
101
|
+
# @yield [result, err] Result & error if block supplied
|
102
|
+
# @yieldparam result [Google::Apis::SpeechV1beta1::ListOperationsResponse] parsed result object
|
103
|
+
# @yieldparam err [StandardError] error object if request failed
|
104
|
+
#
|
105
|
+
# @return [Google::Apis::SpeechV1beta1::ListOperationsResponse]
|
106
|
+
#
|
107
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
108
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
109
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
110
|
+
def list_operations(page_size: nil, filter: nil, name: nil, page_token: nil, quota_user: nil, fields: nil, options: nil, &block)
|
111
|
+
command = make_simple_command(:get, 'v1beta1/operations', options)
|
112
|
+
command.response_representation = Google::Apis::SpeechV1beta1::ListOperationsResponse::Representation
|
113
|
+
command.response_class = Google::Apis::SpeechV1beta1::ListOperationsResponse
|
114
|
+
command.query['pageSize'] = page_size unless page_size.nil?
|
115
|
+
command.query['filter'] = filter unless filter.nil?
|
116
|
+
command.query['name'] = name unless name.nil?
|
117
|
+
command.query['pageToken'] = page_token unless page_token.nil?
|
118
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
119
|
+
command.query['fields'] = fields unless fields.nil?
|
120
|
+
execute_or_queue_command(command, &block)
|
121
|
+
end
|
122
|
+
|
123
|
+
# Deletes a long-running operation. This method indicates that the client is
|
124
|
+
# no longer interested in the operation result. It does not cancel the
|
125
|
+
# operation. If the server doesn't support this method, it returns
|
126
|
+
# `google.rpc.Code.UNIMPLEMENTED`.
|
127
|
+
# @param [String] name
|
128
|
+
# The name of the operation resource to be deleted.
|
129
|
+
# @param [String] quota_user
|
130
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
131
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
132
|
+
# @param [String] fields
|
133
|
+
# Selector specifying which fields to include in a partial response.
|
134
|
+
# @param [Google::Apis::RequestOptions] options
|
135
|
+
# Request-specific options
|
136
|
+
#
|
137
|
+
# @yield [result, err] Result & error if block supplied
|
138
|
+
# @yieldparam result [Google::Apis::SpeechV1beta1::Empty] parsed result object
|
139
|
+
# @yieldparam err [StandardError] error object if request failed
|
140
|
+
#
|
141
|
+
# @return [Google::Apis::SpeechV1beta1::Empty]
|
142
|
+
#
|
143
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
144
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
145
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
146
|
+
def delete_operation(name, quota_user: nil, fields: nil, options: nil, &block)
|
147
|
+
command = make_simple_command(:delete, 'v1beta1/operations/{+name}', options)
|
148
|
+
command.response_representation = Google::Apis::SpeechV1beta1::Empty::Representation
|
149
|
+
command.response_class = Google::Apis::SpeechV1beta1::Empty
|
150
|
+
command.params['name'] = name unless name.nil?
|
151
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
152
|
+
command.query['fields'] = fields unless fields.nil?
|
153
|
+
execute_or_queue_command(command, &block)
|
154
|
+
end
|
155
|
+
|
156
|
+
# Starts asynchronous cancellation on a long-running operation. The server
|
157
|
+
# makes a best effort to cancel the operation, but success is not
|
158
|
+
# guaranteed. If the server doesn't support this method, it returns
|
159
|
+
# `google.rpc.Code.UNIMPLEMENTED`. Clients can use
|
160
|
+
# Operations.GetOperation or
|
161
|
+
# other methods to check whether the cancellation succeeded or whether the
|
162
|
+
# operation completed despite cancellation. On successful cancellation,
|
163
|
+
# the operation is not deleted; instead, it becomes an operation with
|
164
|
+
# an Operation.error value with a google.rpc.Status.code of 1,
|
165
|
+
# corresponding to `Code.CANCELLED`.
|
166
|
+
# @param [String] name
|
167
|
+
# The name of the operation resource to be cancelled.
|
168
|
+
# @param [Google::Apis::SpeechV1beta1::CancelOperationRequest] cancel_operation_request_object
|
169
|
+
# @param [String] quota_user
|
170
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
171
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
172
|
+
# @param [String] fields
|
173
|
+
# Selector specifying which fields to include in a partial response.
|
174
|
+
# @param [Google::Apis::RequestOptions] options
|
175
|
+
# Request-specific options
|
176
|
+
#
|
177
|
+
# @yield [result, err] Result & error if block supplied
|
178
|
+
# @yieldparam result [Google::Apis::SpeechV1beta1::Empty] parsed result object
|
179
|
+
# @yieldparam err [StandardError] error object if request failed
|
180
|
+
#
|
181
|
+
# @return [Google::Apis::SpeechV1beta1::Empty]
|
182
|
+
#
|
183
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
184
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
185
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
186
|
+
def cancel_operation(name, cancel_operation_request_object = nil, quota_user: nil, fields: nil, options: nil, &block)
|
187
|
+
command = make_simple_command(:post, 'v1beta1/operations/{+name}:cancel', options)
|
188
|
+
command.request_representation = Google::Apis::SpeechV1beta1::CancelOperationRequest::Representation
|
189
|
+
command.request_object = cancel_operation_request_object
|
190
|
+
command.response_representation = Google::Apis::SpeechV1beta1::Empty::Representation
|
191
|
+
command.response_class = Google::Apis::SpeechV1beta1::Empty
|
192
|
+
command.params['name'] = name unless name.nil?
|
193
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
194
|
+
command.query['fields'] = fields unless fields.nil?
|
195
|
+
execute_or_queue_command(command, &block)
|
196
|
+
end
|
197
|
+
|
198
|
+
# Performs synchronous speech recognition: receive results after all audio
|
199
|
+
# has been sent and processed.
|
200
|
+
# @param [Google::Apis::SpeechV1beta1::SyncRecognizeRequest] sync_recognize_request_object
|
201
|
+
# @param [String] quota_user
|
202
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
203
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
204
|
+
# @param [String] fields
|
205
|
+
# Selector specifying which fields to include in a partial response.
|
206
|
+
# @param [Google::Apis::RequestOptions] options
|
207
|
+
# Request-specific options
|
208
|
+
#
|
209
|
+
# @yield [result, err] Result & error if block supplied
|
210
|
+
# @yieldparam result [Google::Apis::SpeechV1beta1::SyncRecognizeResponse] parsed result object
|
211
|
+
# @yieldparam err [StandardError] error object if request failed
|
212
|
+
#
|
213
|
+
# @return [Google::Apis::SpeechV1beta1::SyncRecognizeResponse]
|
214
|
+
#
|
215
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
216
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
217
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
218
|
+
def sync_recognize_speech(sync_recognize_request_object = nil, quota_user: nil, fields: nil, options: nil, &block)
|
219
|
+
command = make_simple_command(:post, 'v1beta1/speech:syncrecognize', options)
|
220
|
+
command.request_representation = Google::Apis::SpeechV1beta1::SyncRecognizeRequest::Representation
|
221
|
+
command.request_object = sync_recognize_request_object
|
222
|
+
command.response_representation = Google::Apis::SpeechV1beta1::SyncRecognizeResponse::Representation
|
223
|
+
command.response_class = Google::Apis::SpeechV1beta1::SyncRecognizeResponse
|
224
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
225
|
+
command.query['fields'] = fields unless fields.nil?
|
226
|
+
execute_or_queue_command(command, &block)
|
227
|
+
end
|
228
|
+
|
229
|
+
# Performs asynchronous speech recognition: receive results via the
|
230
|
+
# google.longrunning.Operations interface. Returns either an
|
231
|
+
# `Operation.error` or an `Operation.response` which contains
|
232
|
+
# an `AsyncRecognizeResponse` message.
|
233
|
+
# @param [Google::Apis::SpeechV1beta1::AsyncRecognizeRequest] async_recognize_request_object
|
234
|
+
# @param [String] quota_user
|
235
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
236
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
237
|
+
# @param [String] fields
|
238
|
+
# Selector specifying which fields to include in a partial response.
|
239
|
+
# @param [Google::Apis::RequestOptions] options
|
240
|
+
# Request-specific options
|
241
|
+
#
|
242
|
+
# @yield [result, err] Result & error if block supplied
|
243
|
+
# @yieldparam result [Google::Apis::SpeechV1beta1::Operation] parsed result object
|
244
|
+
# @yieldparam err [StandardError] error object if request failed
|
245
|
+
#
|
246
|
+
# @return [Google::Apis::SpeechV1beta1::Operation]
|
247
|
+
#
|
248
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
249
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
250
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
251
|
+
def async_recognize_speech(async_recognize_request_object = nil, quota_user: nil, fields: nil, options: nil, &block)
|
252
|
+
command = make_simple_command(:post, 'v1beta1/speech:asyncrecognize', options)
|
253
|
+
command.request_representation = Google::Apis::SpeechV1beta1::AsyncRecognizeRequest::Representation
|
254
|
+
command.request_object = async_recognize_request_object
|
255
|
+
command.response_representation = Google::Apis::SpeechV1beta1::Operation::Representation
|
256
|
+
command.response_class = Google::Apis::SpeechV1beta1::Operation
|
257
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
258
|
+
command.query['fields'] = fields unless fields.nil?
|
259
|
+
execute_or_queue_command(command, &block)
|
260
|
+
end
|
261
|
+
|
262
|
+
protected
|
263
|
+
|
264
|
+
def apply_command_defaults(command)
|
265
|
+
command.query['key'] = key unless key.nil?
|
266
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
267
|
+
end
|
268
|
+
end
|
269
|
+
end
|
270
|
+
end
|
271
|
+
end
|