google-apis-slides_v1 0.1.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.
@@ -0,0 +1,245 @@
1
+ # Copyright 2020 Google LLC
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 SlidesV1
23
+ # Google Slides API
24
+ #
25
+ # Reads and writes Google Slides presentations.
26
+ #
27
+ # @example
28
+ # require 'google/apis/slides_v1'
29
+ #
30
+ # Slides = Google::Apis::SlidesV1 # Alias the module
31
+ # service = Slides::SlidesService.new
32
+ #
33
+ # @see https://developers.google.com/slides/
34
+ class SlidesService < 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://slides.googleapis.com/', '',
47
+ client_name: 'google-apis-slides_v1',
48
+ client_version: Google::Apis::SlidesV1::GEM_VERSION)
49
+ @batch_path = 'batch'
50
+ end
51
+
52
+ # Applies one or more updates to the presentation. Each request is validated
53
+ # before being applied. If any request is not valid, then the entire request
54
+ # will fail and nothing will be applied. Some requests have replies to give you
55
+ # some information about how they are applied. Other requests do not need to
56
+ # return information; these each return an empty reply. The order of replies
57
+ # matches that of the requests. For example, suppose you call batchUpdate with
58
+ # four updates, and only the third one returns information. The response would
59
+ # have two empty replies: the reply to the third request, and another empty
60
+ # reply, in that order. Because other users may be editing the presentation, the
61
+ # presentation might not exactly reflect your changes: your changes may be
62
+ # altered with respect to collaborator changes. If there are no collaborators,
63
+ # the presentation should reflect your changes. In any case, the updates in your
64
+ # request are guaranteed to be applied together atomically.
65
+ # @param [String] presentation_id
66
+ # The presentation to apply the updates to.
67
+ # @param [Google::Apis::SlidesV1::BatchUpdatePresentationRequest] batch_update_presentation_request_object
68
+ # @param [String] fields
69
+ # Selector specifying which fields to include in a partial response.
70
+ # @param [String] quota_user
71
+ # Available to use for quota purposes for server-side applications. Can be any
72
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
73
+ # @param [Google::Apis::RequestOptions] options
74
+ # Request-specific options
75
+ #
76
+ # @yield [result, err] Result & error if block supplied
77
+ # @yieldparam result [Google::Apis::SlidesV1::BatchUpdatePresentationResponse] parsed result object
78
+ # @yieldparam err [StandardError] error object if request failed
79
+ #
80
+ # @return [Google::Apis::SlidesV1::BatchUpdatePresentationResponse]
81
+ #
82
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
83
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
84
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
85
+ def batch_update_presentation(presentation_id, batch_update_presentation_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
86
+ command = make_simple_command(:post, 'v1/presentations/{presentationId}:batchUpdate', options)
87
+ command.request_representation = Google::Apis::SlidesV1::BatchUpdatePresentationRequest::Representation
88
+ command.request_object = batch_update_presentation_request_object
89
+ command.response_representation = Google::Apis::SlidesV1::BatchUpdatePresentationResponse::Representation
90
+ command.response_class = Google::Apis::SlidesV1::BatchUpdatePresentationResponse
91
+ command.params['presentationId'] = presentation_id unless presentation_id.nil?
92
+ command.query['fields'] = fields unless fields.nil?
93
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
94
+ execute_or_queue_command(command, &block)
95
+ end
96
+
97
+ # Creates a blank presentation using the title given in the request. If a `
98
+ # presentationId` is provided, it is used as the ID of the new presentation.
99
+ # Otherwise, a new ID is generated. Other fields in the request, including any
100
+ # provided content, are ignored. Returns the created presentation.
101
+ # @param [Google::Apis::SlidesV1::Presentation] presentation_object
102
+ # @param [String] fields
103
+ # Selector specifying which fields to include in a partial response.
104
+ # @param [String] quota_user
105
+ # Available to use for quota purposes for server-side applications. Can be any
106
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
107
+ # @param [Google::Apis::RequestOptions] options
108
+ # Request-specific options
109
+ #
110
+ # @yield [result, err] Result & error if block supplied
111
+ # @yieldparam result [Google::Apis::SlidesV1::Presentation] parsed result object
112
+ # @yieldparam err [StandardError] error object if request failed
113
+ #
114
+ # @return [Google::Apis::SlidesV1::Presentation]
115
+ #
116
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
117
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
118
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
119
+ def create_presentation(presentation_object = nil, fields: nil, quota_user: nil, options: nil, &block)
120
+ command = make_simple_command(:post, 'v1/presentations', options)
121
+ command.request_representation = Google::Apis::SlidesV1::Presentation::Representation
122
+ command.request_object = presentation_object
123
+ command.response_representation = Google::Apis::SlidesV1::Presentation::Representation
124
+ command.response_class = Google::Apis::SlidesV1::Presentation
125
+ command.query['fields'] = fields unless fields.nil?
126
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
127
+ execute_or_queue_command(command, &block)
128
+ end
129
+
130
+ # Gets the latest version of the specified presentation.
131
+ # @param [String] presentation_id
132
+ # The ID of the presentation to retrieve.
133
+ # @param [String] fields
134
+ # Selector specifying which fields to include in a partial response.
135
+ # @param [String] quota_user
136
+ # Available to use for quota purposes for server-side applications. Can be any
137
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
138
+ # @param [Google::Apis::RequestOptions] options
139
+ # Request-specific options
140
+ #
141
+ # @yield [result, err] Result & error if block supplied
142
+ # @yieldparam result [Google::Apis::SlidesV1::Presentation] parsed result object
143
+ # @yieldparam err [StandardError] error object if request failed
144
+ #
145
+ # @return [Google::Apis::SlidesV1::Presentation]
146
+ #
147
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
148
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
149
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
150
+ def get_presentation(presentation_id, fields: nil, quota_user: nil, options: nil, &block)
151
+ command = make_simple_command(:get, 'v1/presentations/{+presentationId}', options)
152
+ command.response_representation = Google::Apis::SlidesV1::Presentation::Representation
153
+ command.response_class = Google::Apis::SlidesV1::Presentation
154
+ command.params['presentationId'] = presentation_id unless presentation_id.nil?
155
+ command.query['fields'] = fields unless fields.nil?
156
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
157
+ execute_or_queue_command(command, &block)
158
+ end
159
+
160
+ # Gets the latest version of the specified page in the presentation.
161
+ # @param [String] presentation_id
162
+ # The ID of the presentation to retrieve.
163
+ # @param [String] page_object_id
164
+ # The object ID of the page to retrieve.
165
+ # @param [String] fields
166
+ # Selector specifying which fields to include in a partial response.
167
+ # @param [String] quota_user
168
+ # Available to use for quota purposes for server-side applications. Can be any
169
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
170
+ # @param [Google::Apis::RequestOptions] options
171
+ # Request-specific options
172
+ #
173
+ # @yield [result, err] Result & error if block supplied
174
+ # @yieldparam result [Google::Apis::SlidesV1::Page] parsed result object
175
+ # @yieldparam err [StandardError] error object if request failed
176
+ #
177
+ # @return [Google::Apis::SlidesV1::Page]
178
+ #
179
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
180
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
181
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
182
+ def get_presentation_page(presentation_id, page_object_id, fields: nil, quota_user: nil, options: nil, &block)
183
+ command = make_simple_command(:get, 'v1/presentations/{presentationId}/pages/{pageObjectId}', options)
184
+ command.response_representation = Google::Apis::SlidesV1::Page::Representation
185
+ command.response_class = Google::Apis::SlidesV1::Page
186
+ command.params['presentationId'] = presentation_id unless presentation_id.nil?
187
+ command.params['pageObjectId'] = page_object_id unless page_object_id.nil?
188
+ command.query['fields'] = fields unless fields.nil?
189
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
190
+ execute_or_queue_command(command, &block)
191
+ end
192
+
193
+ # Generates a thumbnail of the latest version of the specified page in the
194
+ # presentation and returns a URL to the thumbnail image. This request counts as
195
+ # an [expensive read request](/slides/limits) for quota purposes.
196
+ # @param [String] presentation_id
197
+ # The ID of the presentation to retrieve.
198
+ # @param [String] page_object_id
199
+ # The object ID of the page whose thumbnail to retrieve.
200
+ # @param [String] thumbnail_properties_mime_type
201
+ # The optional mime type of the thumbnail image. If you don't specify the mime
202
+ # type, the mime type defaults to PNG.
203
+ # @param [String] thumbnail_properties_thumbnail_size
204
+ # The optional thumbnail image size. If you don't specify the size, the server
205
+ # chooses a default size of the image.
206
+ # @param [String] fields
207
+ # Selector specifying which fields to include in a partial response.
208
+ # @param [String] quota_user
209
+ # Available to use for quota purposes for server-side applications. Can be any
210
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
211
+ # @param [Google::Apis::RequestOptions] options
212
+ # Request-specific options
213
+ #
214
+ # @yield [result, err] Result & error if block supplied
215
+ # @yieldparam result [Google::Apis::SlidesV1::Thumbnail] parsed result object
216
+ # @yieldparam err [StandardError] error object if request failed
217
+ #
218
+ # @return [Google::Apis::SlidesV1::Thumbnail]
219
+ #
220
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
221
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
222
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
223
+ def get_presentation_page_thumbnail(presentation_id, page_object_id, thumbnail_properties_mime_type: nil, thumbnail_properties_thumbnail_size: nil, fields: nil, quota_user: nil, options: nil, &block)
224
+ command = make_simple_command(:get, 'v1/presentations/{presentationId}/pages/{pageObjectId}/thumbnail', options)
225
+ command.response_representation = Google::Apis::SlidesV1::Thumbnail::Representation
226
+ command.response_class = Google::Apis::SlidesV1::Thumbnail
227
+ command.params['presentationId'] = presentation_id unless presentation_id.nil?
228
+ command.params['pageObjectId'] = page_object_id unless page_object_id.nil?
229
+ command.query['thumbnailProperties.mimeType'] = thumbnail_properties_mime_type unless thumbnail_properties_mime_type.nil?
230
+ command.query['thumbnailProperties.thumbnailSize'] = thumbnail_properties_thumbnail_size unless thumbnail_properties_thumbnail_size.nil?
231
+ command.query['fields'] = fields unless fields.nil?
232
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
233
+ execute_or_queue_command(command, &block)
234
+ end
235
+
236
+ protected
237
+
238
+ def apply_command_defaults(command)
239
+ command.query['key'] = key unless key.nil?
240
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
241
+ end
242
+ end
243
+ end
244
+ end
245
+ end
metadata ADDED
@@ -0,0 +1,76 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: google-apis-slides_v1
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Google LLC
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2021-01-08 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: google-apis-core
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '0.1'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '0.1'
27
+ description: This is the simple REST client for Google Slides API V1. Simple REST
28
+ clients are Ruby client libraries that provide access to Google services via their
29
+ HTTP REST API endpoints. These libraries are generated and updated automatically
30
+ based on the discovery documents published by the service, and they handle most
31
+ concerns such as authentication, pagination, retry, timeouts, and logging. You can
32
+ use this client to access the Google Slides API, but note that some services may
33
+ provide a separate modern client that is easier to use.
34
+ email: googleapis-packages@google.com
35
+ executables: []
36
+ extensions: []
37
+ extra_rdoc_files: []
38
+ files:
39
+ - ".yardopts"
40
+ - CHANGELOG.md
41
+ - LICENSE.md
42
+ - OVERVIEW.md
43
+ - lib/google-apis-slides_v1.rb
44
+ - lib/google/apis/slides_v1.rb
45
+ - lib/google/apis/slides_v1/classes.rb
46
+ - lib/google/apis/slides_v1/gem_version.rb
47
+ - lib/google/apis/slides_v1/representations.rb
48
+ - lib/google/apis/slides_v1/service.rb
49
+ homepage: https://github.com/google/google-api-ruby-client
50
+ licenses:
51
+ - Apache-2.0
52
+ metadata:
53
+ bug_tracker_uri: https://github.com/googleapis/google-api-ruby-client/issues
54
+ changelog_uri: https://github.com/googleapis/google-api-ruby-client/tree/master/generated/google-apis-slides_v1/CHANGELOG.md
55
+ documentation_uri: https://googleapis.dev/ruby/google-apis-slides_v1/v0.1.0
56
+ source_code_uri: https://github.com/googleapis/google-api-ruby-client/tree/master/generated/google-apis-slides_v1
57
+ post_install_message:
58
+ rdoc_options: []
59
+ require_paths:
60
+ - lib
61
+ required_ruby_version: !ruby/object:Gem::Requirement
62
+ requirements:
63
+ - - ">="
64
+ - !ruby/object:Gem::Version
65
+ version: '2.4'
66
+ required_rubygems_version: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ version: '0'
71
+ requirements: []
72
+ rubygems_version: 3.1.4
73
+ signing_key:
74
+ specification_version: 4
75
+ summary: Simple REST client for Google Slides API V1
76
+ test_files: []