google-apis-cloudscheduler_v1 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,28 @@
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
+ module Google
16
+ module Apis
17
+ module CloudschedulerV1
18
+ # Version of the google-apis-cloudscheduler_v1 gem
19
+ GEM_VERSION = "0.1.0"
20
+
21
+ # Version of the code generator used to generate this client
22
+ GENERATOR_VERSION = "0.1.1"
23
+
24
+ # Revision of the discovery document this client was generated from
25
+ REVISION = "20200814"
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,298 @@
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 '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 CloudschedulerV1
24
+
25
+ class AppEngineHttpTarget
26
+ class Representation < Google::Apis::Core::JsonRepresentation; end
27
+
28
+ include Google::Apis::Core::JsonObjectSupport
29
+ end
30
+
31
+ class AppEngineRouting
32
+ class Representation < Google::Apis::Core::JsonRepresentation; end
33
+
34
+ include Google::Apis::Core::JsonObjectSupport
35
+ end
36
+
37
+ class Empty
38
+ class Representation < Google::Apis::Core::JsonRepresentation; end
39
+
40
+ include Google::Apis::Core::JsonObjectSupport
41
+ end
42
+
43
+ class HttpTarget
44
+ class Representation < Google::Apis::Core::JsonRepresentation; end
45
+
46
+ include Google::Apis::Core::JsonObjectSupport
47
+ end
48
+
49
+ class Job
50
+ class Representation < Google::Apis::Core::JsonRepresentation; end
51
+
52
+ include Google::Apis::Core::JsonObjectSupport
53
+ end
54
+
55
+ class ListJobsResponse
56
+ class Representation < Google::Apis::Core::JsonRepresentation; end
57
+
58
+ include Google::Apis::Core::JsonObjectSupport
59
+ end
60
+
61
+ class ListLocationsResponse
62
+ class Representation < Google::Apis::Core::JsonRepresentation; end
63
+
64
+ include Google::Apis::Core::JsonObjectSupport
65
+ end
66
+
67
+ class Location
68
+ class Representation < Google::Apis::Core::JsonRepresentation; end
69
+
70
+ include Google::Apis::Core::JsonObjectSupport
71
+ end
72
+
73
+ class OAuthToken
74
+ class Representation < Google::Apis::Core::JsonRepresentation; end
75
+
76
+ include Google::Apis::Core::JsonObjectSupport
77
+ end
78
+
79
+ class OidcToken
80
+ class Representation < Google::Apis::Core::JsonRepresentation; end
81
+
82
+ include Google::Apis::Core::JsonObjectSupport
83
+ end
84
+
85
+ class PauseJobRequest
86
+ class Representation < Google::Apis::Core::JsonRepresentation; end
87
+
88
+ include Google::Apis::Core::JsonObjectSupport
89
+ end
90
+
91
+ class PubsubMessage
92
+ class Representation < Google::Apis::Core::JsonRepresentation; end
93
+
94
+ include Google::Apis::Core::JsonObjectSupport
95
+ end
96
+
97
+ class PubsubTarget
98
+ class Representation < Google::Apis::Core::JsonRepresentation; end
99
+
100
+ include Google::Apis::Core::JsonObjectSupport
101
+ end
102
+
103
+ class ResumeJobRequest
104
+ class Representation < Google::Apis::Core::JsonRepresentation; end
105
+
106
+ include Google::Apis::Core::JsonObjectSupport
107
+ end
108
+
109
+ class RetryConfig
110
+ class Representation < Google::Apis::Core::JsonRepresentation; end
111
+
112
+ include Google::Apis::Core::JsonObjectSupport
113
+ end
114
+
115
+ class RunJobRequest
116
+ class Representation < Google::Apis::Core::JsonRepresentation; end
117
+
118
+ include Google::Apis::Core::JsonObjectSupport
119
+ end
120
+
121
+ class Status
122
+ class Representation < Google::Apis::Core::JsonRepresentation; end
123
+
124
+ include Google::Apis::Core::JsonObjectSupport
125
+ end
126
+
127
+ class AppEngineHttpTarget
128
+ # @private
129
+ class Representation < Google::Apis::Core::JsonRepresentation
130
+ property :app_engine_routing, as: 'appEngineRouting', class: Google::Apis::CloudschedulerV1::AppEngineRouting, decorator: Google::Apis::CloudschedulerV1::AppEngineRouting::Representation
131
+
132
+ property :body, :base64 => true, as: 'body'
133
+ hash :headers, as: 'headers'
134
+ property :http_method, as: 'httpMethod'
135
+ property :relative_uri, as: 'relativeUri'
136
+ end
137
+ end
138
+
139
+ class AppEngineRouting
140
+ # @private
141
+ class Representation < Google::Apis::Core::JsonRepresentation
142
+ property :host, as: 'host'
143
+ property :instance, as: 'instance'
144
+ property :service, as: 'service'
145
+ property :version, as: 'version'
146
+ end
147
+ end
148
+
149
+ class Empty
150
+ # @private
151
+ class Representation < Google::Apis::Core::JsonRepresentation
152
+ end
153
+ end
154
+
155
+ class HttpTarget
156
+ # @private
157
+ class Representation < Google::Apis::Core::JsonRepresentation
158
+ property :body, :base64 => true, as: 'body'
159
+ hash :headers, as: 'headers'
160
+ property :http_method, as: 'httpMethod'
161
+ property :oauth_token, as: 'oauthToken', class: Google::Apis::CloudschedulerV1::OAuthToken, decorator: Google::Apis::CloudschedulerV1::OAuthToken::Representation
162
+
163
+ property :oidc_token, as: 'oidcToken', class: Google::Apis::CloudschedulerV1::OidcToken, decorator: Google::Apis::CloudschedulerV1::OidcToken::Representation
164
+
165
+ property :uri, as: 'uri'
166
+ end
167
+ end
168
+
169
+ class Job
170
+ # @private
171
+ class Representation < Google::Apis::Core::JsonRepresentation
172
+ property :app_engine_http_target, as: 'appEngineHttpTarget', class: Google::Apis::CloudschedulerV1::AppEngineHttpTarget, decorator: Google::Apis::CloudschedulerV1::AppEngineHttpTarget::Representation
173
+
174
+ property :attempt_deadline, as: 'attemptDeadline'
175
+ property :description, as: 'description'
176
+ property :http_target, as: 'httpTarget', class: Google::Apis::CloudschedulerV1::HttpTarget, decorator: Google::Apis::CloudschedulerV1::HttpTarget::Representation
177
+
178
+ property :last_attempt_time, as: 'lastAttemptTime'
179
+ property :name, as: 'name'
180
+ property :pubsub_target, as: 'pubsubTarget', class: Google::Apis::CloudschedulerV1::PubsubTarget, decorator: Google::Apis::CloudschedulerV1::PubsubTarget::Representation
181
+
182
+ property :retry_config, as: 'retryConfig', class: Google::Apis::CloudschedulerV1::RetryConfig, decorator: Google::Apis::CloudschedulerV1::RetryConfig::Representation
183
+
184
+ property :schedule, as: 'schedule'
185
+ property :schedule_time, as: 'scheduleTime'
186
+ property :state, as: 'state'
187
+ property :status, as: 'status', class: Google::Apis::CloudschedulerV1::Status, decorator: Google::Apis::CloudschedulerV1::Status::Representation
188
+
189
+ property :time_zone, as: 'timeZone'
190
+ property :user_update_time, as: 'userUpdateTime'
191
+ end
192
+ end
193
+
194
+ class ListJobsResponse
195
+ # @private
196
+ class Representation < Google::Apis::Core::JsonRepresentation
197
+ collection :jobs, as: 'jobs', class: Google::Apis::CloudschedulerV1::Job, decorator: Google::Apis::CloudschedulerV1::Job::Representation
198
+
199
+ property :next_page_token, as: 'nextPageToken'
200
+ end
201
+ end
202
+
203
+ class ListLocationsResponse
204
+ # @private
205
+ class Representation < Google::Apis::Core::JsonRepresentation
206
+ collection :locations, as: 'locations', class: Google::Apis::CloudschedulerV1::Location, decorator: Google::Apis::CloudschedulerV1::Location::Representation
207
+
208
+ property :next_page_token, as: 'nextPageToken'
209
+ end
210
+ end
211
+
212
+ class Location
213
+ # @private
214
+ class Representation < Google::Apis::Core::JsonRepresentation
215
+ property :display_name, as: 'displayName'
216
+ hash :labels, as: 'labels'
217
+ property :location_id, as: 'locationId'
218
+ hash :metadata, as: 'metadata'
219
+ property :name, as: 'name'
220
+ end
221
+ end
222
+
223
+ class OAuthToken
224
+ # @private
225
+ class Representation < Google::Apis::Core::JsonRepresentation
226
+ property :scope, as: 'scope'
227
+ property :service_account_email, as: 'serviceAccountEmail'
228
+ end
229
+ end
230
+
231
+ class OidcToken
232
+ # @private
233
+ class Representation < Google::Apis::Core::JsonRepresentation
234
+ property :audience, as: 'audience'
235
+ property :service_account_email, as: 'serviceAccountEmail'
236
+ end
237
+ end
238
+
239
+ class PauseJobRequest
240
+ # @private
241
+ class Representation < Google::Apis::Core::JsonRepresentation
242
+ end
243
+ end
244
+
245
+ class PubsubMessage
246
+ # @private
247
+ class Representation < Google::Apis::Core::JsonRepresentation
248
+ hash :attributes, as: 'attributes'
249
+ property :data, :base64 => true, as: 'data'
250
+ property :message_id, as: 'messageId'
251
+ property :ordering_key, as: 'orderingKey'
252
+ property :publish_time, as: 'publishTime'
253
+ end
254
+ end
255
+
256
+ class PubsubTarget
257
+ # @private
258
+ class Representation < Google::Apis::Core::JsonRepresentation
259
+ hash :attributes, as: 'attributes'
260
+ property :data, :base64 => true, as: 'data'
261
+ property :topic_name, as: 'topicName'
262
+ end
263
+ end
264
+
265
+ class ResumeJobRequest
266
+ # @private
267
+ class Representation < Google::Apis::Core::JsonRepresentation
268
+ end
269
+ end
270
+
271
+ class RetryConfig
272
+ # @private
273
+ class Representation < Google::Apis::Core::JsonRepresentation
274
+ property :max_backoff_duration, as: 'maxBackoffDuration'
275
+ property :max_doublings, as: 'maxDoublings'
276
+ property :max_retry_duration, as: 'maxRetryDuration'
277
+ property :min_backoff_duration, as: 'minBackoffDuration'
278
+ property :retry_count, as: 'retryCount'
279
+ end
280
+ end
281
+
282
+ class RunJobRequest
283
+ # @private
284
+ class Representation < Google::Apis::Core::JsonRepresentation
285
+ end
286
+ end
287
+
288
+ class Status
289
+ # @private
290
+ class Representation < Google::Apis::Core::JsonRepresentation
291
+ property :code, as: 'code'
292
+ collection :details, as: 'details'
293
+ property :message, as: 'message'
294
+ end
295
+ end
296
+ end
297
+ end
298
+ end
@@ -0,0 +1,426 @@
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 CloudschedulerV1
23
+ # Cloud Scheduler API
24
+ #
25
+ # Creates and manages jobs run on a regular recurring schedule.
26
+ #
27
+ # @example
28
+ # require 'google/apis/cloudscheduler_v1'
29
+ #
30
+ # Cloudscheduler = Google::Apis::CloudschedulerV1 # Alias the module
31
+ # service = Cloudscheduler::CloudSchedulerService.new
32
+ #
33
+ # @see https://cloud.google.com/scheduler/
34
+ class CloudSchedulerService < 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://cloudscheduler.googleapis.com/', '',
47
+ client_name: 'google-apis-cloudscheduler_v1',
48
+ client_version: Google::Apis::CloudschedulerV1::GEM_VERSION)
49
+ @batch_path = 'batch'
50
+ end
51
+
52
+ # Gets information about a location.
53
+ # @param [String] name
54
+ # Resource name for the location.
55
+ # @param [String] fields
56
+ # Selector specifying which fields to include in a partial response.
57
+ # @param [String] quota_user
58
+ # Available to use for quota purposes for server-side applications. Can be any
59
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
60
+ # @param [Google::Apis::RequestOptions] options
61
+ # Request-specific options
62
+ #
63
+ # @yield [result, err] Result & error if block supplied
64
+ # @yieldparam result [Google::Apis::CloudschedulerV1::Location] parsed result object
65
+ # @yieldparam err [StandardError] error object if request failed
66
+ #
67
+ # @return [Google::Apis::CloudschedulerV1::Location]
68
+ #
69
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
70
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
71
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
72
+ def get_project_location(name, fields: nil, quota_user: nil, options: nil, &block)
73
+ command = make_simple_command(:get, 'v1/{+name}', options)
74
+ command.response_representation = Google::Apis::CloudschedulerV1::Location::Representation
75
+ command.response_class = Google::Apis::CloudschedulerV1::Location
76
+ command.params['name'] = name unless name.nil?
77
+ command.query['fields'] = fields unless fields.nil?
78
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
79
+ execute_or_queue_command(command, &block)
80
+ end
81
+
82
+ # Lists information about the supported locations for this service.
83
+ # @param [String] name
84
+ # The resource that owns the locations collection, if applicable.
85
+ # @param [String] filter
86
+ # The standard list filter.
87
+ # @param [Fixnum] page_size
88
+ # The standard list page size.
89
+ # @param [String] page_token
90
+ # The standard list page token.
91
+ # @param [String] fields
92
+ # Selector specifying which fields to include in a partial response.
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 [Google::Apis::RequestOptions] options
97
+ # Request-specific options
98
+ #
99
+ # @yield [result, err] Result & error if block supplied
100
+ # @yieldparam result [Google::Apis::CloudschedulerV1::ListLocationsResponse] parsed result object
101
+ # @yieldparam err [StandardError] error object if request failed
102
+ #
103
+ # @return [Google::Apis::CloudschedulerV1::ListLocationsResponse]
104
+ #
105
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
106
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
107
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
108
+ def list_project_locations(name, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
109
+ command = make_simple_command(:get, 'v1/{+name}/locations', options)
110
+ command.response_representation = Google::Apis::CloudschedulerV1::ListLocationsResponse::Representation
111
+ command.response_class = Google::Apis::CloudschedulerV1::ListLocationsResponse
112
+ command.params['name'] = name unless name.nil?
113
+ command.query['filter'] = filter unless filter.nil?
114
+ command.query['pageSize'] = page_size unless page_size.nil?
115
+ command.query['pageToken'] = page_token unless page_token.nil?
116
+ command.query['fields'] = fields unless fields.nil?
117
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
118
+ execute_or_queue_command(command, &block)
119
+ end
120
+
121
+ # Creates a job.
122
+ # @param [String] parent
123
+ # Required. The location name. For example: `projects/PROJECT_ID/locations/
124
+ # LOCATION_ID`.
125
+ # @param [Google::Apis::CloudschedulerV1::Job] job_object
126
+ # @param [String] fields
127
+ # Selector specifying which fields to include in a partial response.
128
+ # @param [String] quota_user
129
+ # Available to use for quota purposes for server-side applications. Can be any
130
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
131
+ # @param [Google::Apis::RequestOptions] options
132
+ # Request-specific options
133
+ #
134
+ # @yield [result, err] Result & error if block supplied
135
+ # @yieldparam result [Google::Apis::CloudschedulerV1::Job] parsed result object
136
+ # @yieldparam err [StandardError] error object if request failed
137
+ #
138
+ # @return [Google::Apis::CloudschedulerV1::Job]
139
+ #
140
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
141
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
142
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
143
+ def create_project_location_job(parent, job_object = nil, fields: nil, quota_user: nil, options: nil, &block)
144
+ command = make_simple_command(:post, 'v1/{+parent}/jobs', options)
145
+ command.request_representation = Google::Apis::CloudschedulerV1::Job::Representation
146
+ command.request_object = job_object
147
+ command.response_representation = Google::Apis::CloudschedulerV1::Job::Representation
148
+ command.response_class = Google::Apis::CloudschedulerV1::Job
149
+ command.params['parent'] = parent unless parent.nil?
150
+ command.query['fields'] = fields unless fields.nil?
151
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
152
+ execute_or_queue_command(command, &block)
153
+ end
154
+
155
+ # Deletes a job.
156
+ # @param [String] name
157
+ # Required. The job name. For example: `projects/PROJECT_ID/locations/
158
+ # LOCATION_ID/jobs/JOB_ID`.
159
+ # @param [String] fields
160
+ # Selector specifying which fields to include in a partial response.
161
+ # @param [String] quota_user
162
+ # Available to use for quota purposes for server-side applications. Can be any
163
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
164
+ # @param [Google::Apis::RequestOptions] options
165
+ # Request-specific options
166
+ #
167
+ # @yield [result, err] Result & error if block supplied
168
+ # @yieldparam result [Google::Apis::CloudschedulerV1::Empty] parsed result object
169
+ # @yieldparam err [StandardError] error object if request failed
170
+ #
171
+ # @return [Google::Apis::CloudschedulerV1::Empty]
172
+ #
173
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
174
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
175
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
176
+ def delete_project_location_job(name, fields: nil, quota_user: nil, options: nil, &block)
177
+ command = make_simple_command(:delete, 'v1/{+name}', options)
178
+ command.response_representation = Google::Apis::CloudschedulerV1::Empty::Representation
179
+ command.response_class = Google::Apis::CloudschedulerV1::Empty
180
+ command.params['name'] = name unless name.nil?
181
+ command.query['fields'] = fields unless fields.nil?
182
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
183
+ execute_or_queue_command(command, &block)
184
+ end
185
+
186
+ # Gets a job.
187
+ # @param [String] name
188
+ # Required. The job name. For example: `projects/PROJECT_ID/locations/
189
+ # LOCATION_ID/jobs/JOB_ID`.
190
+ # @param [String] fields
191
+ # Selector specifying which fields to include in a partial response.
192
+ # @param [String] quota_user
193
+ # Available to use for quota purposes for server-side applications. Can be any
194
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
195
+ # @param [Google::Apis::RequestOptions] options
196
+ # Request-specific options
197
+ #
198
+ # @yield [result, err] Result & error if block supplied
199
+ # @yieldparam result [Google::Apis::CloudschedulerV1::Job] parsed result object
200
+ # @yieldparam err [StandardError] error object if request failed
201
+ #
202
+ # @return [Google::Apis::CloudschedulerV1::Job]
203
+ #
204
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
205
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
206
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
207
+ def get_project_location_job(name, fields: nil, quota_user: nil, options: nil, &block)
208
+ command = make_simple_command(:get, 'v1/{+name}', options)
209
+ command.response_representation = Google::Apis::CloudschedulerV1::Job::Representation
210
+ command.response_class = Google::Apis::CloudschedulerV1::Job
211
+ command.params['name'] = name unless name.nil?
212
+ command.query['fields'] = fields unless fields.nil?
213
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
214
+ execute_or_queue_command(command, &block)
215
+ end
216
+
217
+ # Lists jobs.
218
+ # @param [String] parent
219
+ # Required. The location name. For example: `projects/PROJECT_ID/locations/
220
+ # LOCATION_ID`.
221
+ # @param [Fixnum] page_size
222
+ # Requested page size. The maximum page size is 500. If unspecified, the page
223
+ # size will be the maximum. Fewer jobs than requested might be returned, even if
224
+ # more jobs exist; use next_page_token to determine if more jobs exist.
225
+ # @param [String] page_token
226
+ # A token identifying a page of results the server will return. To request the
227
+ # first page results, page_token must be empty. To request the next page of
228
+ # results, page_token must be the value of next_page_token returned from the
229
+ # previous call to ListJobs. It is an error to switch the value of filter or
230
+ # order_by while iterating through pages.
231
+ # @param [String] fields
232
+ # Selector specifying which fields to include in a partial response.
233
+ # @param [String] quota_user
234
+ # Available to use for quota purposes for server-side applications. Can be any
235
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
236
+ # @param [Google::Apis::RequestOptions] options
237
+ # Request-specific options
238
+ #
239
+ # @yield [result, err] Result & error if block supplied
240
+ # @yieldparam result [Google::Apis::CloudschedulerV1::ListJobsResponse] parsed result object
241
+ # @yieldparam err [StandardError] error object if request failed
242
+ #
243
+ # @return [Google::Apis::CloudschedulerV1::ListJobsResponse]
244
+ #
245
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
246
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
247
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
248
+ def list_project_location_jobs(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
249
+ command = make_simple_command(:get, 'v1/{+parent}/jobs', options)
250
+ command.response_representation = Google::Apis::CloudschedulerV1::ListJobsResponse::Representation
251
+ command.response_class = Google::Apis::CloudschedulerV1::ListJobsResponse
252
+ command.params['parent'] = parent unless parent.nil?
253
+ command.query['pageSize'] = page_size unless page_size.nil?
254
+ command.query['pageToken'] = page_token unless page_token.nil?
255
+ command.query['fields'] = fields unless fields.nil?
256
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
257
+ execute_or_queue_command(command, &block)
258
+ end
259
+
260
+ # Updates a job. If successful, the updated Job is returned. If the job does not
261
+ # exist, `NOT_FOUND` is returned. If UpdateJob does not successfully return, it
262
+ # is possible for the job to be in an Job.State.UPDATE_FAILED state. A job in
263
+ # this state may not be executed. If this happens, retry the UpdateJob request
264
+ # until a successful response is received.
265
+ # @param [String] name
266
+ # Optionally caller-specified in CreateJob, after which it becomes output only.
267
+ # The job name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/jobs/
268
+ # JOB_ID`. * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]),
269
+ # hyphens (-), colons (:), or periods (.). For more information, see [
270
+ # Identifying projects](https://cloud.google.com/resource-manager/docs/creating-
271
+ # managing-projects#identifying_projects) * `LOCATION_ID` is the canonical ID
272
+ # for the job's location. The list of available locations can be obtained by
273
+ # calling ListLocations. For more information, see https://cloud.google.com/
274
+ # about/locations/. * `JOB_ID` can contain only letters ([A-Za-z]), numbers ([0-
275
+ # 9]), hyphens (-), or underscores (_). The maximum length is 500 characters.
276
+ # @param [Google::Apis::CloudschedulerV1::Job] job_object
277
+ # @param [String] update_mask
278
+ # A mask used to specify which fields of the job are being updated.
279
+ # @param [String] fields
280
+ # Selector specifying which fields to include in a partial response.
281
+ # @param [String] quota_user
282
+ # Available to use for quota purposes for server-side applications. Can be any
283
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
284
+ # @param [Google::Apis::RequestOptions] options
285
+ # Request-specific options
286
+ #
287
+ # @yield [result, err] Result & error if block supplied
288
+ # @yieldparam result [Google::Apis::CloudschedulerV1::Job] parsed result object
289
+ # @yieldparam err [StandardError] error object if request failed
290
+ #
291
+ # @return [Google::Apis::CloudschedulerV1::Job]
292
+ #
293
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
294
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
295
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
296
+ def patch_project_location_job(name, job_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
297
+ command = make_simple_command(:patch, 'v1/{+name}', options)
298
+ command.request_representation = Google::Apis::CloudschedulerV1::Job::Representation
299
+ command.request_object = job_object
300
+ command.response_representation = Google::Apis::CloudschedulerV1::Job::Representation
301
+ command.response_class = Google::Apis::CloudschedulerV1::Job
302
+ command.params['name'] = name unless name.nil?
303
+ command.query['updateMask'] = update_mask unless update_mask.nil?
304
+ command.query['fields'] = fields unless fields.nil?
305
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
306
+ execute_or_queue_command(command, &block)
307
+ end
308
+
309
+ # Pauses a job. If a job is paused then the system will stop executing the job
310
+ # until it is re-enabled via ResumeJob. The state of the job is stored in state;
311
+ # if paused it will be set to Job.State.PAUSED. A job must be in Job.State.
312
+ # ENABLED to be paused.
313
+ # @param [String] name
314
+ # Required. The job name. For example: `projects/PROJECT_ID/locations/
315
+ # LOCATION_ID/jobs/JOB_ID`.
316
+ # @param [Google::Apis::CloudschedulerV1::PauseJobRequest] pause_job_request_object
317
+ # @param [String] fields
318
+ # Selector specifying which fields to include in a partial response.
319
+ # @param [String] quota_user
320
+ # Available to use for quota purposes for server-side applications. Can be any
321
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
322
+ # @param [Google::Apis::RequestOptions] options
323
+ # Request-specific options
324
+ #
325
+ # @yield [result, err] Result & error if block supplied
326
+ # @yieldparam result [Google::Apis::CloudschedulerV1::Job] parsed result object
327
+ # @yieldparam err [StandardError] error object if request failed
328
+ #
329
+ # @return [Google::Apis::CloudschedulerV1::Job]
330
+ #
331
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
332
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
333
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
334
+ def pause_job(name, pause_job_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
335
+ command = make_simple_command(:post, 'v1/{+name}:pause', options)
336
+ command.request_representation = Google::Apis::CloudschedulerV1::PauseJobRequest::Representation
337
+ command.request_object = pause_job_request_object
338
+ command.response_representation = Google::Apis::CloudschedulerV1::Job::Representation
339
+ command.response_class = Google::Apis::CloudschedulerV1::Job
340
+ command.params['name'] = name unless name.nil?
341
+ command.query['fields'] = fields unless fields.nil?
342
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
343
+ execute_or_queue_command(command, &block)
344
+ end
345
+
346
+ # Resume a job. This method reenables a job after it has been Job.State.PAUSED.
347
+ # The state of a job is stored in Job.state; after calling this method it will
348
+ # be set to Job.State.ENABLED. A job must be in Job.State.PAUSED to be resumed.
349
+ # @param [String] name
350
+ # Required. The job name. For example: `projects/PROJECT_ID/locations/
351
+ # LOCATION_ID/jobs/JOB_ID`.
352
+ # @param [Google::Apis::CloudschedulerV1::ResumeJobRequest] resume_job_request_object
353
+ # @param [String] fields
354
+ # Selector specifying which fields to include in a partial response.
355
+ # @param [String] quota_user
356
+ # Available to use for quota purposes for server-side applications. Can be any
357
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
358
+ # @param [Google::Apis::RequestOptions] options
359
+ # Request-specific options
360
+ #
361
+ # @yield [result, err] Result & error if block supplied
362
+ # @yieldparam result [Google::Apis::CloudschedulerV1::Job] parsed result object
363
+ # @yieldparam err [StandardError] error object if request failed
364
+ #
365
+ # @return [Google::Apis::CloudschedulerV1::Job]
366
+ #
367
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
368
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
369
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
370
+ def resume_job(name, resume_job_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
371
+ command = make_simple_command(:post, 'v1/{+name}:resume', options)
372
+ command.request_representation = Google::Apis::CloudschedulerV1::ResumeJobRequest::Representation
373
+ command.request_object = resume_job_request_object
374
+ command.response_representation = Google::Apis::CloudschedulerV1::Job::Representation
375
+ command.response_class = Google::Apis::CloudschedulerV1::Job
376
+ command.params['name'] = name unless name.nil?
377
+ command.query['fields'] = fields unless fields.nil?
378
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
379
+ execute_or_queue_command(command, &block)
380
+ end
381
+
382
+ # Forces a job to run now. When this method is called, Cloud Scheduler will
383
+ # dispatch the job, even if the job is already running.
384
+ # @param [String] name
385
+ # Required. The job name. For example: `projects/PROJECT_ID/locations/
386
+ # LOCATION_ID/jobs/JOB_ID`.
387
+ # @param [Google::Apis::CloudschedulerV1::RunJobRequest] run_job_request_object
388
+ # @param [String] fields
389
+ # Selector specifying which fields to include in a partial response.
390
+ # @param [String] quota_user
391
+ # Available to use for quota purposes for server-side applications. Can be any
392
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
393
+ # @param [Google::Apis::RequestOptions] options
394
+ # Request-specific options
395
+ #
396
+ # @yield [result, err] Result & error if block supplied
397
+ # @yieldparam result [Google::Apis::CloudschedulerV1::Job] parsed result object
398
+ # @yieldparam err [StandardError] error object if request failed
399
+ #
400
+ # @return [Google::Apis::CloudschedulerV1::Job]
401
+ #
402
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
403
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
404
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
405
+ def run_job(name, run_job_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
406
+ command = make_simple_command(:post, 'v1/{+name}:run', options)
407
+ command.request_representation = Google::Apis::CloudschedulerV1::RunJobRequest::Representation
408
+ command.request_object = run_job_request_object
409
+ command.response_representation = Google::Apis::CloudschedulerV1::Job::Representation
410
+ command.response_class = Google::Apis::CloudschedulerV1::Job
411
+ command.params['name'] = name unless name.nil?
412
+ command.query['fields'] = fields unless fields.nil?
413
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
414
+ execute_or_queue_command(command, &block)
415
+ end
416
+
417
+ protected
418
+
419
+ def apply_command_defaults(command)
420
+ command.query['key'] = key unless key.nil?
421
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
422
+ end
423
+ end
424
+ end
425
+ end
426
+ end