Skip to content

Commit

Permalink
build: [baremetalsolution] include IAMPolicy mixin (#4529)
Browse files Browse the repository at this point in the history
* build: include IAMPolicy mixin

PiperOrigin-RevId: 555373976

Source-Link: googleapis/googleapis@177b508

Source-Link: googleapis/googleapis-gen@7ccb4be
Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJhcmVtZXRhbHNvbHV0aW9uLy5Pd2xCb3QueWFtbCIsImgiOiI3Y2NiNGJlOWMxNDgxZDU3MGMwZDQ5ZDViNDRjNzIyOTgwNzI0MmI0In0=

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored Aug 11, 2023
1 parent 79da1cb commit f19cf8f
Show file tree
Hide file tree
Showing 2 changed files with 469 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ import type {
LROperation,
PaginationCallback,
GaxCall,
IamClient,
IamProtos,
LocationsClient,
LocationProtos,
} from 'google-gax';
Expand Down Expand Up @@ -70,6 +72,7 @@ export class BareMetalSolutionClient {
};
warn: (code: string, message: string, warnType?: string) => void;
innerApiCalls: {[name: string]: Function};
iamClient: IamClient;
locationsClient: LocationsClient;
pathTemplates: {[name: string]: gax.PathTemplate};
operationsClient: gax.OperationsClient;
Expand Down Expand Up @@ -168,6 +171,8 @@ export class BareMetalSolutionClient {
if (servicePath === staticMembers.servicePath) {
this.auth.defaultScopes = staticMembers.scopes;
}
this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts);

this.locationsClient = new this._gaxModule.LocationsClient(
this._gaxGrpc,
opts
Expand Down Expand Up @@ -6499,6 +6504,144 @@ export class BareMetalSolutionClient {
callSettings
) as AsyncIterable<protos.google.cloud.baremetalsolution.v2.IOSImage>;
}
/**
* Gets the access control policy for a resource. Returns an empty policy
* if the resource exists and does not have a policy set.
*
* @param {Object} request
* The request object that will be sent.
* @param {string} request.resource
* REQUIRED: The resource for which the policy is being requested.
* See the operation documentation for the appropriate value for this field.
* @param {Object} [request.options]
* OPTIONAL: A `GetPolicyOptions` object for specifying options to
* `GetIamPolicy`. This field is only used by Cloud IAM.
*
* This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}.
* @param {Object} [options]
* Optional parameters. You can override the default settings for this call, e.g, timeout,
* retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details.
* @param {function(?Error, ?Object)} [callback]
* The function which will be called with the result of the API call.
*
* The second parameter to the callback is an object representing {@link google.iam.v1.Policy | Policy}.
* @returns {Promise} - The promise which resolves to an array.
* The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}.
* The promise has a method named "cancel" which cancels the ongoing API call.
*/
getIamPolicy(
request: IamProtos.google.iam.v1.GetIamPolicyRequest,
options?:
| gax.CallOptions
| Callback<
IamProtos.google.iam.v1.Policy,
IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined,
{} | null | undefined
>,
callback?: Callback<
IamProtos.google.iam.v1.Policy,
IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined,
{} | null | undefined
>
): Promise<[IamProtos.google.iam.v1.Policy]> {
return this.iamClient.getIamPolicy(request, options, callback);
}

/**
* 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.
*
* @param {Object} request
* The request object that will be sent.
* @param {string} request.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[]} request.permissions
* The set of permissions to check for the `resource`. Permissions with
* wildcards (such as '*' or 'storage.*') are not allowed. For more
* information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }.
* @param {Object} [options]
* Optional parameters. You can override the default settings for this call, e.g, timeout,
* retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details.
* @param {function(?Error, ?Object)} [callback]
* The function which will be called with the result of the API call.
*
* The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}.
* @returns {Promise} - The promise which resolves to an array.
* The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}.
* The promise has a method named "cancel" which cancels the ongoing API call.
*/
setIamPolicy(
request: IamProtos.google.iam.v1.SetIamPolicyRequest,
options?:
| gax.CallOptions
| Callback<
IamProtos.google.iam.v1.Policy,
IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined,
{} | null | undefined
>,
callback?: Callback<
IamProtos.google.iam.v1.Policy,
IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined,
{} | null | undefined
>
): Promise<[IamProtos.google.iam.v1.Policy]> {
return this.iamClient.setIamPolicy(request, options, callback);
}

/**
* 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.
*
* @param {Object} request
* The request object that will be sent.
* @param {string} request.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[]} request.permissions
* The set of permissions to check for the `resource`. Permissions with
* wildcards (such as '*' or 'storage.*') are not allowed. For more
* information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }.
* @param {Object} [options]
* Optional parameters. You can override the default settings for this call, e.g, timeout,
* retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details.
* @param {function(?Error, ?Object)} [callback]
* The function which will be called with the result of the API call.
*
* The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}.
* @returns {Promise} - The promise which resolves to an array.
* The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}.
* The promise has a method named "cancel" which cancels the ongoing API call.
*
*/
testIamPermissions(
request: IamProtos.google.iam.v1.TestIamPermissionsRequest,
options?:
| gax.CallOptions
| Callback<
IamProtos.google.iam.v1.TestIamPermissionsResponse,
IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined,
{} | null | undefined
>,
callback?: Callback<
IamProtos.google.iam.v1.TestIamPermissionsResponse,
IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined,
{} | null | undefined
>
): Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> {
return this.iamClient.testIamPermissions(request, options, callback);
}

/**
* Gets information about a location.
*
Expand Down Expand Up @@ -7599,6 +7742,7 @@ export class BareMetalSolutionClient {
return this.bareMetalSolutionStub.then(stub => {
this._terminated = true;
stub.close();
this.iamClient.close();
this.locationsClient.close();
this.operationsClient.close();
});
Expand Down
Loading

0 comments on commit f19cf8f

Please sign in to comment.