Skip to content

Commit

Permalink
feat!: [Batch] added StatusEvent.task_state (#5915)
Browse files Browse the repository at this point in the history
feat: added StatusEvent.task_state
docs: updated comments
PiperOrigin-RevId: 513426000
Source-Link: googleapis/googleapis@3f95ea2
Source-Link: googleapis/googleapis-gen@b191b40
Copy-Tag: eyJwIjoiQmF0Y2gvLk93bEJvdC55YW1sIiwiaCI6ImIxOTFiNDBiOTVlNDJlZWVhOGQwYmNjZjkxZGQxZDFiYThhNjFmYjEifQ==
  • Loading branch information
gcf-owl-bot[bot] authored Mar 6, 2023
1 parent f78bcf0 commit 4366506
Show file tree
Hide file tree
Showing 14 changed files with 141 additions and 516 deletions.
5 changes: 3 additions & 2 deletions Batch/metadata/V1/Batch.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified Batch/metadata/V1/Task.php
Binary file not shown.
16 changes: 8 additions & 8 deletions Batch/src/V1/CreateJobRequest.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions Batch/src/V1/DeleteJobRequest.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

211 changes: 4 additions & 207 deletions Batch/src/V1/Gapic/BatchServiceGapicClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,11 @@
use Google\Cloud\Batch\V1\ListTasksRequest;
use Google\Cloud\Batch\V1\ListTasksResponse;
use Google\Cloud\Batch\V1\Task;
use Google\Cloud\Iam\V1\GetIamPolicyRequest;
use Google\Cloud\Iam\V1\GetPolicyOptions;
use Google\Cloud\Iam\V1\Policy;
use Google\Cloud\Iam\V1\SetIamPolicyRequest;
use Google\Cloud\Iam\V1\TestIamPermissionsRequest;
use Google\Cloud\Iam\V1\TestIamPermissionsResponse;
use Google\Cloud\Location\GetLocationRequest;
use Google\Cloud\Location\ListLocationsRequest;
use Google\Cloud\Location\ListLocationsResponse;
use Google\Cloud\Location\Location;
use Google\LongRunning\Operation;
use Google\Protobuf\FieldMask;

/**
* Service Description: Google Batch Service.
Expand Down Expand Up @@ -465,8 +458,8 @@ public function __construct(array $options = [])
* ignore the request if it has already been completed. The server will
* guarantee that for at least 60 minutes since the first request.
*
* For example, consider a situation where you make an initial request and t
* he request times out. If you make the request again with the same request
* For example, consider a situation where you make an initial request and
* the request times out. If you make the request again with the same request
* ID, the server can check if original operation with the same request ID
* was received, and if so, will ignore the second request. This prevents
* clients from accidentally creating duplicate commitments.
Expand Down Expand Up @@ -561,8 +554,8 @@ public function createJob($parent, $job, array $optionalArgs = [])
* ignore the request if it has already been completed. The server will
* guarantee that for at least 60 minutes after the first request.
*
* For example, consider a situation where you make an initial request and t
* he request times out. If you make the request again with the same request
* For example, consider a situation where you make an initial request and
* the request times out. If you make the request again with the same request
* ID, the server can check if original operation with the same request ID
* was received, and if so, will ignore the second request. This prevents
* clients from accidentally creating duplicate commitments.
Expand Down Expand Up @@ -1018,200 +1011,4 @@ public function listLocations(array $optionalArgs = [])
'google.cloud.location.Locations'
);
}

/**
* Gets the access control policy for a resource. Returns an empty policy
if the resource exists and does not have a policy set.
*
* Sample code:
* ```
* $batchServiceClient = new BatchServiceClient();
* try {
* $resource = 'resource';
* $response = $batchServiceClient->getIamPolicy($resource);
* } finally {
* $batchServiceClient->close();
* }
* ```
*
* @param string $resource REQUIRED: The resource for which the policy is being requested.
* See the operation documentation for the appropriate value for this field.
* @param array $optionalArgs {
* Optional.
*
* @type GetPolicyOptions $options
* OPTIONAL: A `GetPolicyOptions` object for specifying options to
* `GetIamPolicy`.
* @type RetrySettings|array $retrySettings
* Retry settings to use for this call. Can be a {@see RetrySettings} object, or an
* associative array of retry settings parameters. See the documentation on
* {@see RetrySettings} for example usage.
* }
*
* @return \Google\Cloud\Iam\V1\Policy
*
* @throws ApiException if the remote call fails
*/
public function getIamPolicy($resource, array $optionalArgs = [])
{
$request = new GetIamPolicyRequest();
$requestParamHeaders = [];
$request->setResource($resource);
$requestParamHeaders['resource'] = $resource;
if (isset($optionalArgs['options'])) {
$request->setOptions($optionalArgs['options']);
}

$requestParams = new RequestParamsHeaderDescriptor(
$requestParamHeaders
);
$optionalArgs['headers'] = isset($optionalArgs['headers'])
? array_merge($requestParams->getHeader(), $optionalArgs['headers'])
: $requestParams->getHeader();
return $this->startCall(
'GetIamPolicy',
Policy::class,
$optionalArgs,
$request,
Call::UNARY_CALL,
'google.iam.v1.IAMPolicy'
)->wait();
}

/**
* Sets the access control policy on the specified resource. Replaces
any existing policy.
Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
errors.
*
* Sample code:
* ```
* $batchServiceClient = new BatchServiceClient();
* try {
* $resource = 'resource';
* $policy = new Policy();
* $response = $batchServiceClient->setIamPolicy($resource, $policy);
* } finally {
* $batchServiceClient->close();
* }
* ```
*
* @param string $resource REQUIRED: The resource for which the policy is being specified.
* See the operation documentation for the appropriate value for this field.
* @param Policy $policy REQUIRED: The complete policy to be applied to the `resource`. The size of
* the policy is limited to a few 10s of KB. An empty policy is a
* valid policy but certain Cloud Platform services (such as Projects)
* might reject them.
* @param array $optionalArgs {
* Optional.
*
* @type FieldMask $updateMask
* OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only
* the fields in the mask will be modified. If no mask is provided, the
* following default mask is used:
*
* `paths: "bindings, etag"`
* @type RetrySettings|array $retrySettings
* Retry settings to use for this call. Can be a {@see RetrySettings} object, or an
* associative array of retry settings parameters. See the documentation on
* {@see RetrySettings} for example usage.
* }
*
* @return \Google\Cloud\Iam\V1\Policy
*
* @throws ApiException if the remote call fails
*/
public function setIamPolicy($resource, $policy, array $optionalArgs = [])
{
$request = new SetIamPolicyRequest();
$requestParamHeaders = [];
$request->setResource($resource);
$request->setPolicy($policy);
$requestParamHeaders['resource'] = $resource;
if (isset($optionalArgs['updateMask'])) {
$request->setUpdateMask($optionalArgs['updateMask']);
}

$requestParams = new RequestParamsHeaderDescriptor(
$requestParamHeaders
);
$optionalArgs['headers'] = isset($optionalArgs['headers'])
? array_merge($requestParams->getHeader(), $optionalArgs['headers'])
: $requestParams->getHeader();
return $this->startCall(
'SetIamPolicy',
Policy::class,
$optionalArgs,
$request,
Call::UNARY_CALL,
'google.iam.v1.IAMPolicy'
)->wait();
}

/**
* Returns permissions that a caller has on the specified resource. If the
resource does not exist, this will return an empty set of
permissions, not a `NOT_FOUND` error.
Note: This operation is designed to be used for building
permission-aware UIs and command-line tools, not for authorization
checking. This operation may "fail open" without warning.
*
* Sample code:
* ```
* $batchServiceClient = new BatchServiceClient();
* try {
* $resource = 'resource';
* $permissions = [];
* $response = $batchServiceClient->testIamPermissions($resource, $permissions);
* } finally {
* $batchServiceClient->close();
* }
* ```
*
* @param string $resource REQUIRED: The resource for which the policy detail is being requested.
* See the operation documentation for the appropriate value for this field.
* @param string[] $permissions The set of permissions to check for the `resource`. Permissions with
* wildcards (such as '*' or 'storage.*') are not allowed. For more
* information see
* [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
* @param array $optionalArgs {
* Optional.
*
* @type RetrySettings|array $retrySettings
* Retry settings to use for this call. Can be a {@see RetrySettings} object, or an
* associative array of retry settings parameters. See the documentation on
* {@see RetrySettings} for example usage.
* }
*
* @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse
*
* @throws ApiException if the remote call fails
*/
public function testIamPermissions(
$resource,
$permissions,
array $optionalArgs = []
) {
$request = new TestIamPermissionsRequest();
$requestParamHeaders = [];
$request->setResource($resource);
$request->setPermissions($permissions);
$requestParamHeaders['resource'] = $resource;
$requestParams = new RequestParamsHeaderDescriptor(
$requestParamHeaders
);
$optionalArgs['headers'] = isset($optionalArgs['headers'])
? array_merge($requestParams->getHeader(), $optionalArgs['headers'])
: $requestParams->getHeader();
return $this->startCall(
'TestIamPermissions',
TestIamPermissionsResponse::class,
$optionalArgs,
$request,
Call::UNARY_CALL,
'google.iam.v1.IAMPolicy'
)->wait();
}
}
Loading

0 comments on commit 4366506

Please sign in to comment.