google-apis-chromewebstore_v2 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,246 @@
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 ChromewebstoreV2
23
+ # Chrome Web Store API
24
+ #
25
+ # The Chrome Web Store API provides access to data about apps and extensions, as
26
+ # well as developer tools for managing them.
27
+ #
28
+ # @example
29
+ # require 'google/apis/chromewebstore_v2'
30
+ #
31
+ # Chromewebstore = Google::Apis::ChromewebstoreV2 # Alias the module
32
+ # service = Chromewebstore::ChromewebstoreService.new
33
+ #
34
+ # @see https://developer.chrome.com/docs/webstore/api
35
+ class ChromewebstoreService < Google::Apis::Core::BaseService
36
+ DEFAULT_ENDPOINT_TEMPLATE = "https://chromewebstore.$UNIVERSE_DOMAIN$/"
37
+
38
+ # @return [String]
39
+ # API key. Your API key identifies your project and provides you with API access,
40
+ # quota, and reports. Required unless you provide an OAuth 2.0 token.
41
+ attr_accessor :key
42
+
43
+ # @return [String]
44
+ # Available to use for quota purposes for server-side applications. Can be any
45
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
46
+ attr_accessor :quota_user
47
+
48
+ def initialize
49
+ super(DEFAULT_ENDPOINT_TEMPLATE, '',
50
+ client_name: 'google-apis-chromewebstore_v2',
51
+ client_version: Google::Apis::ChromewebstoreV2::GEM_VERSION)
52
+ @batch_path = 'batch'
53
+ end
54
+
55
+ # Upload a new package to an existing item.
56
+ # @param [String] name
57
+ # Required. Name of the item to upload the new package to in the form `
58
+ # publishers/`publisherId`/items/`itemId``
59
+ # @param [Google::Apis::ChromewebstoreV2::UploadItemPackageRequest] upload_item_package_request_object
60
+ # @param [String] fields
61
+ # Selector specifying which fields to include in a partial response.
62
+ # @param [String] quota_user
63
+ # Available to use for quota purposes for server-side applications. Can be any
64
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
65
+ # @param [IO, String] upload_source
66
+ # IO stream or filename containing content to upload
67
+ # @param [String] content_type
68
+ # Content type of the uploaded content.
69
+ # @param [Google::Apis::RequestOptions] options
70
+ # Request-specific options
71
+ #
72
+ # @yield [result, err] Result & error if block supplied
73
+ # @yieldparam result [Google::Apis::ChromewebstoreV2::UploadItemPackageResponse] parsed result object
74
+ # @yieldparam err [StandardError] error object if request failed
75
+ #
76
+ # @return [Google::Apis::ChromewebstoreV2::UploadItemPackageResponse]
77
+ #
78
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
79
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
80
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
81
+ def upload_medium_item_package(name, upload_item_package_request_object = nil, fields: nil, quota_user: nil, upload_source: nil, content_type: nil, options: nil, &block)
82
+ if upload_source.nil?
83
+ command = make_simple_command(:post, 'v2/{+name}:upload', options)
84
+ else
85
+ command = make_upload_command(:post, 'v2/{+name}:upload', options)
86
+ command.upload_source = upload_source
87
+ command.upload_content_type = content_type
88
+ end
89
+ command.request_representation = Google::Apis::ChromewebstoreV2::UploadItemPackageRequest::Representation
90
+ command.request_object = upload_item_package_request_object
91
+ command.response_representation = Google::Apis::ChromewebstoreV2::UploadItemPackageResponse::Representation
92
+ command.response_class = Google::Apis::ChromewebstoreV2::UploadItemPackageResponse
93
+ command.params['name'] = name unless name.nil?
94
+ command.query['fields'] = fields unless fields.nil?
95
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
96
+ execute_or_queue_command(command, &block)
97
+ end
98
+
99
+ # Cancel the current active submission of an item if present. This can be used
100
+ # to cancel the review of a pending submission.
101
+ # @param [String] name
102
+ # Required. Name of the item to cancel the submission of in the form `publishers/
103
+ # `publisherId`/items/`itemId``
104
+ # @param [Google::Apis::ChromewebstoreV2::CancelSubmissionRequest] cancel_submission_request_object
105
+ # @param [String] fields
106
+ # Selector specifying which fields to include in a partial response.
107
+ # @param [String] quota_user
108
+ # Available to use for quota purposes for server-side applications. Can be any
109
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
110
+ # @param [Google::Apis::RequestOptions] options
111
+ # Request-specific options
112
+ #
113
+ # @yield [result, err] Result & error if block supplied
114
+ # @yieldparam result [Google::Apis::ChromewebstoreV2::CancelSubmissionResponse] parsed result object
115
+ # @yieldparam err [StandardError] error object if request failed
116
+ #
117
+ # @return [Google::Apis::ChromewebstoreV2::CancelSubmissionResponse]
118
+ #
119
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
120
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
121
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
122
+ def cancel_item_submission(name, cancel_submission_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
123
+ command = make_simple_command(:post, 'v2/{+name}:cancelSubmission', options)
124
+ command.request_representation = Google::Apis::ChromewebstoreV2::CancelSubmissionRequest::Representation
125
+ command.request_object = cancel_submission_request_object
126
+ command.response_representation = Google::Apis::ChromewebstoreV2::CancelSubmissionResponse::Representation
127
+ command.response_class = Google::Apis::ChromewebstoreV2::CancelSubmissionResponse
128
+ command.params['name'] = name unless name.nil?
129
+ command.query['fields'] = fields unless fields.nil?
130
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
131
+ execute_or_queue_command(command, &block)
132
+ end
133
+
134
+ # Fetch the status of an item.
135
+ # @param [String] name
136
+ # Required. Name of the item to retrieve the status of in the form `publishers/`
137
+ # publisherId`/items/`itemId``
138
+ # @param [String] fields
139
+ # Selector specifying which fields to include in a partial response.
140
+ # @param [String] quota_user
141
+ # Available to use for quota purposes for server-side applications. Can be any
142
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
143
+ # @param [Google::Apis::RequestOptions] options
144
+ # Request-specific options
145
+ #
146
+ # @yield [result, err] Result & error if block supplied
147
+ # @yieldparam result [Google::Apis::ChromewebstoreV2::FetchItemStatusResponse] parsed result object
148
+ # @yieldparam err [StandardError] error object if request failed
149
+ #
150
+ # @return [Google::Apis::ChromewebstoreV2::FetchItemStatusResponse]
151
+ #
152
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
153
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
154
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
155
+ def fetch_publisher_item_status(name, fields: nil, quota_user: nil, options: nil, &block)
156
+ command = make_simple_command(:get, 'v2/{+name}:fetchStatus', options)
157
+ command.response_representation = Google::Apis::ChromewebstoreV2::FetchItemStatusResponse::Representation
158
+ command.response_class = Google::Apis::ChromewebstoreV2::FetchItemStatusResponse
159
+ command.params['name'] = name unless name.nil?
160
+ command.query['fields'] = fields unless fields.nil?
161
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
162
+ execute_or_queue_command(command, &block)
163
+ end
164
+
165
+ # Submit the item to be published in the store. The item will be submitted for
166
+ # review unless `skip_review` is set to true, or the item is staged from a
167
+ # previous submission with `publish_type` set to `STAGED_PUBLISH`.
168
+ # @param [String] name
169
+ # Required. Name of the item in the form `publishers/`publisherId`/items/`itemId`
170
+ # `
171
+ # @param [Google::Apis::ChromewebstoreV2::PublishItemRequest] publish_item_request_object
172
+ # @param [String] fields
173
+ # Selector specifying which fields to include in a partial response.
174
+ # @param [String] quota_user
175
+ # Available to use for quota purposes for server-side applications. Can be any
176
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
177
+ # @param [Google::Apis::RequestOptions] options
178
+ # Request-specific options
179
+ #
180
+ # @yield [result, err] Result & error if block supplied
181
+ # @yieldparam result [Google::Apis::ChromewebstoreV2::PublishItemResponse] parsed result object
182
+ # @yieldparam err [StandardError] error object if request failed
183
+ #
184
+ # @return [Google::Apis::ChromewebstoreV2::PublishItemResponse]
185
+ #
186
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
187
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
188
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
189
+ def publish_item(name, publish_item_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
190
+ command = make_simple_command(:post, 'v2/{+name}:publish', options)
191
+ command.request_representation = Google::Apis::ChromewebstoreV2::PublishItemRequest::Representation
192
+ command.request_object = publish_item_request_object
193
+ command.response_representation = Google::Apis::ChromewebstoreV2::PublishItemResponse::Representation
194
+ command.response_class = Google::Apis::ChromewebstoreV2::PublishItemResponse
195
+ command.params['name'] = name unless name.nil?
196
+ command.query['fields'] = fields unless fields.nil?
197
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
198
+ execute_or_queue_command(command, &block)
199
+ end
200
+
201
+ # Set a higher target deploy percentage for the item's published revision. This
202
+ # will be updated without the item being submitted for review. This is only
203
+ # available to items with over 10,000 seven-day active users.
204
+ # @param [String] name
205
+ # Required. Name of the item to update the published revision of in the form `
206
+ # publishers/`publisherId`/items/`itemId``
207
+ # @param [Google::Apis::ChromewebstoreV2::SetPublishedDeployPercentageRequest] set_published_deploy_percentage_request_object
208
+ # @param [String] fields
209
+ # Selector specifying which fields to include in a partial response.
210
+ # @param [String] quota_user
211
+ # Available to use for quota purposes for server-side applications. Can be any
212
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
213
+ # @param [Google::Apis::RequestOptions] options
214
+ # Request-specific options
215
+ #
216
+ # @yield [result, err] Result & error if block supplied
217
+ # @yieldparam result [Google::Apis::ChromewebstoreV2::SetPublishedDeployPercentageResponse] parsed result object
218
+ # @yieldparam err [StandardError] error object if request failed
219
+ #
220
+ # @return [Google::Apis::ChromewebstoreV2::SetPublishedDeployPercentageResponse]
221
+ #
222
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
223
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
224
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
225
+ def set_item_published_deploy_percentage(name, set_published_deploy_percentage_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
226
+ command = make_simple_command(:post, 'v2/{+name}:setPublishedDeployPercentage', options)
227
+ command.request_representation = Google::Apis::ChromewebstoreV2::SetPublishedDeployPercentageRequest::Representation
228
+ command.request_object = set_published_deploy_percentage_request_object
229
+ command.response_representation = Google::Apis::ChromewebstoreV2::SetPublishedDeployPercentageResponse::Representation
230
+ command.response_class = Google::Apis::ChromewebstoreV2::SetPublishedDeployPercentageResponse
231
+ command.params['name'] = name unless name.nil?
232
+ command.query['fields'] = fields unless fields.nil?
233
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
234
+ execute_or_queue_command(command, &block)
235
+ end
236
+
237
+ protected
238
+
239
+ def apply_command_defaults(command)
240
+ command.query['key'] = key unless key.nil?
241
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
242
+ end
243
+ end
244
+ end
245
+ end
246
+ end
@@ -0,0 +1,40 @@
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/chromewebstore_v2/service.rb'
16
+ require 'google/apis/chromewebstore_v2/classes.rb'
17
+ require 'google/apis/chromewebstore_v2/representations.rb'
18
+ require 'google/apis/chromewebstore_v2/gem_version.rb'
19
+
20
+ module Google
21
+ module Apis
22
+ # Chrome Web Store API
23
+ #
24
+ # The Chrome Web Store API provides access to data about apps and extensions, as
25
+ # well as developer tools for managing them.
26
+ #
27
+ # @see https://developer.chrome.com/docs/webstore/api
28
+ module ChromewebstoreV2
29
+ # Version of the Chrome Web Store API this client connects to.
30
+ # This is NOT the gem version.
31
+ VERSION = 'V2'
32
+
33
+ # See, edit, update, or publish your Chrome Web Store extensions, themes, apps, and licences you have access to
34
+ AUTH_CHROMEWEBSTORE = 'https://www.googleapis.com/auth/chromewebstore'
35
+
36
+ # See and download your Chrome Web Store extensions and apps, and see licenses you have access to
37
+ AUTH_CHROMEWEBSTORE_READONLY = 'https://www.googleapis.com/auth/chromewebstore.readonly'
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,15 @@
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/chromewebstore_v2"
metadata ADDED
@@ -0,0 +1,79 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: google-apis-chromewebstore_v2
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Google LLC
8
+ bindir: bin
9
+ cert_chain: []
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
+ dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: google-apis-core
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - ">="
17
+ - !ruby/object:Gem::Version
18
+ version: 0.15.0
19
+ - - "<"
20
+ - !ruby/object:Gem::Version
21
+ version: 2.a
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ version: 0.15.0
29
+ - - "<"
30
+ - !ruby/object:Gem::Version
31
+ version: 2.a
32
+ description: This is the simple REST client for Chrome Web Store API V2. Simple REST
33
+ clients are Ruby client libraries that provide access to Google services via their
34
+ HTTP REST API endpoints. These libraries are generated and updated automatically
35
+ based on the discovery documents published by the service, and they handle most
36
+ concerns such as authentication, pagination, retry, timeouts, and logging. You can
37
+ use this client to access the Chrome Web Store API, but note that some services
38
+ may provide a separate modern client that is easier to use.
39
+ email: googleapis-packages@google.com
40
+ executables: []
41
+ extensions: []
42
+ extra_rdoc_files: []
43
+ files:
44
+ - ".yardopts"
45
+ - CHANGELOG.md
46
+ - LICENSE.md
47
+ - OVERVIEW.md
48
+ - lib/google-apis-chromewebstore_v2.rb
49
+ - lib/google/apis/chromewebstore_v2.rb
50
+ - lib/google/apis/chromewebstore_v2/classes.rb
51
+ - lib/google/apis/chromewebstore_v2/gem_version.rb
52
+ - lib/google/apis/chromewebstore_v2/representations.rb
53
+ - lib/google/apis/chromewebstore_v2/service.rb
54
+ homepage: https://github.com/google/google-api-ruby-client
55
+ licenses:
56
+ - Apache-2.0
57
+ metadata:
58
+ bug_tracker_uri: https://github.com/googleapis/google-api-ruby-client/issues
59
+ changelog_uri: https://github.com/googleapis/google-api-ruby-client/tree/main/generated/google-apis-chromewebstore_v2/CHANGELOG.md
60
+ documentation_uri: https://googleapis.dev/ruby/google-apis-chromewebstore_v2/v0.1.0
61
+ source_code_uri: https://github.com/googleapis/google-api-ruby-client/tree/main/generated/google-apis-chromewebstore_v2
62
+ rdoc_options: []
63
+ require_paths:
64
+ - lib
65
+ required_ruby_version: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: '3.1'
70
+ required_rubygems_version: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
75
+ requirements: []
76
+ rubygems_version: 3.6.9
77
+ specification_version: 4
78
+ summary: Simple REST client for Chrome Web Store API V2
79
+ test_files: []