Skip to content

Commit f66cd70

Browse files
feat: Automated regeneration of batch v1 client (googleapis#21838)
Auto-created at 2025-02-26 20:55:02 +0000 using the toys pull request generator.
1 parent fb5ecf1 commit f66cd70

File tree

6 files changed

+86
-3
lines changed

6 files changed

+86
-3
lines changed

api_names_out.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45651,6 +45651,8 @@
4565145651
"/batch:v1/Binding/members": members
4565245652
"/batch:v1/Binding/members/member": member
4565345653
"/batch:v1/Binding/role": role
45654+
"/batch:v1/CancelJobRequest": cancel_job_request
45655+
"/batch:v1/CancelJobRequest/requestId": request_id
4565445656
"/batch:v1/CancelOperationRequest": cancel_operation_request
4565545657
"/batch:v1/CloudLoggingOption": cloud_logging_option
4565645658
"/batch:v1/CloudLoggingOption/useGenericTaskMonitoredResource": use_generic_task_monitored_resource
@@ -45915,6 +45917,8 @@
4591545917
"/batch:v1/Volume/nfs": nfs
4591645918
"/batch:v1/batch.projects.locations.get": get_project_location
4591745919
"/batch:v1/batch.projects.locations.get/name": name
45920+
"/batch:v1/batch.projects.locations.jobs.cancel": cancel_job
45921+
"/batch:v1/batch.projects.locations.jobs.cancel/name": name
4591845922
"/batch:v1/batch.projects.locations.jobs.create": create_project_location_job
4591945923
"/batch:v1/batch.projects.locations.jobs.create/jobId": job_id
4592045924
"/batch:v1/batch.projects.locations.jobs.create/parent": parent

generated/google-apis-batch_v1/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Release history for google-apis-batch_v1
22

3+
### v0.49.0 (2025-02-26)
4+
5+
* Regenerated from discovery document revision 20250122
6+
* Regenerated using generator version 0.16.0
7+
38
### v0.48.0 (2024-12-15)
49

510
* Regenerated from discovery document revision 20241204

generated/google-apis-batch_v1/lib/google/apis/batch_v1/classes.rb

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -760,6 +760,34 @@ def update!(**args)
760760
end
761761
end
762762

763+
# CancelJob Request.
764+
class CancelJobRequest
765+
include Google::Apis::Core::Hashable
766+
767+
# Optional. An optional request ID to identify requests. Specify a unique
768+
# request ID so that if you must retry your request, the server will know to
769+
# ignore the request if it has already been completed. The server will guarantee
770+
# that for at least 60 minutes after the first request. For example, consider a
771+
# situation where you make an initial request and the request times out. If you
772+
# make the request again with the same request ID, the server can check if
773+
# original operation with the same request ID was received, and if so, will
774+
# ignore the second request. This prevents clients from accidentally creating
775+
# duplicate commitments. The request ID must be a valid UUID with the exception
776+
# that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
777+
# Corresponds to the JSON property `requestId`
778+
# @return [String]
779+
attr_accessor :request_id
780+
781+
def initialize(**args)
782+
update!(**args)
783+
end
784+
785+
# Update properties of this object
786+
def update!(**args)
787+
@request_id = args[:request_id] if args.key?(:request_id)
788+
end
789+
end
790+
763791
# The request message for Operations.CancelOperation.
764792
class CancelOperationRequest
765793
include Google::Apis::Core::Hashable

generated/google-apis-batch_v1/lib/google/apis/batch_v1/gem_version.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ module Google
1616
module Apis
1717
module BatchV1
1818
# Version of the google-apis-batch_v1 gem
19-
GEM_VERSION = "0.48.0"
19+
GEM_VERSION = "0.49.0"
2020

2121
# Version of the code generator used to generate this client
22-
GENERATOR_VERSION = "0.15.1"
22+
GENERATOR_VERSION = "0.16.0"
2323

2424
# Revision of the discovery document this client was generated from
25-
REVISION = "20241204"
25+
REVISION = "20250122"
2626
end
2727
end
2828
end

generated/google-apis-batch_v1/lib/google/apis/batch_v1/representations.rb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,12 @@ class Representation < Google::Apis::Core::JsonRepresentation; end
130130
include Google::Apis::Core::JsonObjectSupport
131131
end
132132

133+
class CancelJobRequest
134+
class Representation < Google::Apis::Core::JsonRepresentation; end
135+
136+
include Google::Apis::Core::JsonObjectSupport
137+
end
138+
133139
class CancelOperationRequest
134140
class Representation < Google::Apis::Core::JsonRepresentation; end
135141

@@ -592,6 +598,13 @@ class Representation < Google::Apis::Core::JsonRepresentation
592598
end
593599
end
594600

601+
class CancelJobRequest
602+
# @private
603+
class Representation < Google::Apis::Core::JsonRepresentation
604+
property :request_id, as: 'requestId'
605+
end
606+
end
607+
595608
class CancelOperationRequest
596609
# @private
597610
class Representation < Google::Apis::Core::JsonRepresentation

generated/google-apis-batch_v1/lib/google/apis/batch_v1/service.rb

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,39 @@ def list_project_locations(name, filter: nil, page_size: nil, page_token: nil, f
124124
execute_or_queue_command(command, &block)
125125
end
126126

127+
# Cancel a Job.
128+
# @param [String] name
129+
# Required. Job name.
130+
# @param [Google::Apis::BatchV1::CancelJobRequest] cancel_job_request_object
131+
# @param [String] fields
132+
# Selector specifying which fields to include in a partial response.
133+
# @param [String] quota_user
134+
# Available to use for quota purposes for server-side applications. Can be any
135+
# arbitrary string assigned to a user, but should not exceed 40 characters.
136+
# @param [Google::Apis::RequestOptions] options
137+
# Request-specific options
138+
#
139+
# @yield [result, err] Result & error if block supplied
140+
# @yieldparam result [Google::Apis::BatchV1::Operation] parsed result object
141+
# @yieldparam err [StandardError] error object if request failed
142+
#
143+
# @return [Google::Apis::BatchV1::Operation]
144+
#
145+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
146+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
147+
# @raise [Google::Apis::AuthorizationError] Authorization is required
148+
def cancel_job(name, cancel_job_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
149+
command = make_simple_command(:post, 'v1/{+name}:cancel', options)
150+
command.request_representation = Google::Apis::BatchV1::CancelJobRequest::Representation
151+
command.request_object = cancel_job_request_object
152+
command.response_representation = Google::Apis::BatchV1::Operation::Representation
153+
command.response_class = Google::Apis::BatchV1::Operation
154+
command.params['name'] = name unless name.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+
127160
# Create a Job.
128161
# @param [String] parent
129162
# Required. The parent resource name where the Job will be created. Pattern: "

0 commit comments

Comments
 (0)