Privileged Access Manager API v1 - Package cloud.google.com/go/privilegedaccessmanager/apiv1 (v0.3.1)

Beta

This library is covered by thePre-GA Offerings Terms of the Terms of Service. Pre-GA libraries might have limited support, and changes to pre-GA libraries might not be compatible with other pre-GA versions. For more information, see thelaunch stage descriptions.

Note: To get more information about this package, such as access to older versions, viewthis package on pkg.go.dev.

Package privilegedaccessmanager is an auto-generated package for thePrivileged Access Manager API.

Privileged Access Manager (PAM) helps you on your journey towards leastprivilege and helps mitigate risks tied to privileged access misuse orabuse. PAM allows you to shift from always-on standing privileges towardson-demand access with just-in-time, time-bound, and approval-based accesselevations. PAM allows IAM administrators to create entitlements that cangrant just-in-time, temporary access to any resource scope. Requesters canexplore eligible entitlements and request the access needed for theirtask. Approvers are notified when approvals await their decision.Streamlined workflows facilitated by using PAM can support various usecases, including emergency access for incident responders, time-boxedaccess for developers for critical deployment or maintenance, temporaryaccess for operators for data ingestion and audits, JIT access to serviceaccounts for automated tasks, and more.

NOTE:Thispackageisinbeta.Itisnotstable,andmaybesubjecttochanges.

General documentation

For information that is relevant for all client libraries please referencehttps://pkg.go.dev/cloud.google.com/go#pkg-overview. Some information on thispage includes:

Example usage

To get started with this package, create a client.

// go get cloud.google.com/go/privilegedaccessmanager/apiv1@latestctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in://   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=privilegedaccessmanager.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()

The client will use your default application credentials. Clients should be reused instead of created as needed.The methods of Client are safe for concurrent use by multiple goroutines.The returned client must be Closed when it is done being used.

Using the Client

The following is an example of making an API call with the newly created client, mentioned above.

req:=&privilegedaccessmanagerpb.ApproveGrantRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/privilegedaccessmanager/apiv1/privilegedaccessmanagerpb#ApproveGrantRequest.}resp,err:=c.ApproveGrant(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp

Use of Context

The ctx passed to NewClient is used for authentication requests andfor creating the underlying connection, but is not used for subsequent calls.Individual methods on the client use the ctx given to them.

To close the open connection, use the Close() method.

Functions

func DefaultAuthScopes

funcDefaultAuthScopes()[]string

DefaultAuthScopes reports the default set of authentication scopes to use with this package.

CallOptions

typeCallOptionsstruct{CheckOnboardingStatus[]gax.CallOptionListEntitlements[]gax.CallOptionSearchEntitlements[]gax.CallOptionGetEntitlement[]gax.CallOptionCreateEntitlement[]gax.CallOptionDeleteEntitlement[]gax.CallOptionUpdateEntitlement[]gax.CallOptionListGrants[]gax.CallOptionSearchGrants[]gax.CallOptionGetGrant[]gax.CallOptionCreateGrant[]gax.CallOptionApproveGrant[]gax.CallOptionDenyGrant[]gax.CallOptionRevokeGrant[]gax.CallOptionGetLocation[]gax.CallOptionListLocations[]gax.CallOptionDeleteOperation[]gax.CallOptionGetOperation[]gax.CallOptionListOperations[]gax.CallOption}

CallOptions contains the retry settings for each method of Client.

Client

typeClientstruct{// The call options for this service.CallOptions*CallOptions// LROClient is used internally to handle long-running operations.// It is exposed so that its CallOptions can be modified if required.// Users should not Close this client.LROClient*lroauto.OperationsClient// contains filtered or unexported fields}

Client is a client for interacting with Privileged Access Manager API.Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

This API allows customers to manage temporary, request based privilegedaccess to their resources.

It defines the following resource model:

A collection of Entitlement resources. An entitlement allows configuring(among other things):  Some kind of privileged access that users can request.  A set of users called requesters who can request this access.  A maximum duration for which the access can be requested.  An optional approval workflow which must be satisfied before access is  granted.A collection of Grant resources. A grant is a request by a requester toget the privileged access specified in an entitlement for some duration.

After the approval workflow as specified in the entitlement is satisfied,

the specified access is given to the requester. The access is automaticallytaken back after the requested duration is over.

func NewClient

funcNewClient(ctxcontext.Context,opts...option.ClientOption)(*Client,error)

NewClient creates a new privileged access manager client based on gRPC.The returned client must be Closed when it is done being used to clean up its underlying connections.

This API allows customers to manage temporary, request based privilegedaccess to their resources.

It defines the following resource model:

A collection of Entitlement resources. An entitlement allows configuring(among other things):  Some kind of privileged access that users can request.  A set of users called requesters who can request this access.  A maximum duration for which the access can be requested.  An optional approval workflow which must be satisfied before access is  granted.A collection of Grant resources. A grant is a request by a requester toget the privileged access specified in an entitlement for some duration.

After the approval workflow as specified in the entitlement is satisfied,

the specified access is given to the requester. The access is automaticallytaken back after the requested duration is over.

Example

packagemainimport("context"privilegedaccessmanager"cloud.google.com/go/privilegedaccessmanager/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in://   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=privilegedaccessmanager.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}

func NewRESTClient

funcNewRESTClient(ctxcontext.Context,opts...option.ClientOption)(*Client,error)

NewRESTClient creates a new privileged access manager rest client.

This API allows customers to manage temporary, request based privilegedaccess to their resources.

It defines the following resource model:

A collection of Entitlement resources. An entitlement allows configuring(among other things):  Some kind of privileged access that users can request.  A set of users called requesters who can request this access.  A maximum duration for which the access can be requested.  An optional approval workflow which must be satisfied before access is  granted.A collection of Grant resources. A grant is a request by a requester toget the privileged access specified in an entitlement for some duration.

After the approval workflow as specified in the entitlement is satisfied,

the specified access is given to the requester. The access is automaticallytaken back after the requested duration is over.

Example

packagemainimport("context"privilegedaccessmanager"cloud.google.com/go/privilegedaccessmanager/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in://   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=privilegedaccessmanager.NewRESTClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}

func (*Client) ApproveGrant

ApproveGrant ApproveGrant is used to approve a grant. This method can only be calledon a grant when it’s in the APPROVAL_AWAITED state. This operation can’tbe undone.

Example

packagemainimport("context"privilegedaccessmanager"cloud.google.com/go/privilegedaccessmanager/apiv1"privilegedaccessmanagerpb"cloud.google.com/go/privilegedaccessmanager/apiv1/privilegedaccessmanagerpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in://   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=privilegedaccessmanager.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&privilegedaccessmanagerpb.ApproveGrantRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/privilegedaccessmanager/apiv1/privilegedaccessmanagerpb#ApproveGrantRequest.}resp,err:=c.ApproveGrant(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

func (*Client) CheckOnboardingStatus

CheckOnboardingStatus CheckOnboardingStatus reports the onboarding status for aproject/folder/organization. Any findings reported by this API need to befixed before PAM can be used on the resource.

Example

packagemainimport("context"privilegedaccessmanager"cloud.google.com/go/privilegedaccessmanager/apiv1"privilegedaccessmanagerpb"cloud.google.com/go/privilegedaccessmanager/apiv1/privilegedaccessmanagerpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in://   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=privilegedaccessmanager.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&privilegedaccessmanagerpb.CheckOnboardingStatusRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/privilegedaccessmanager/apiv1/privilegedaccessmanagerpb#CheckOnboardingStatusRequest.}resp,err:=c.CheckOnboardingStatus(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

func (*Client) Close

func(c*Client)Close()error

Close closes the connection to the API service. The user should invoke this whenthe client is no longer required.

func (*Client) Connection (deprecated)

func(c*Client)Connection()*grpc.ClientConn

Connection returns a connection to the API service.

Deprecated: Connections are now pooled so this method does not alwaysreturn the same resource.

func (*Client) CreateEntitlement

CreateEntitlement creates a new entitlement in a given project/folder/organization andlocation.

Example

packagemainimport("context"privilegedaccessmanager"cloud.google.com/go/privilegedaccessmanager/apiv1"privilegedaccessmanagerpb"cloud.google.com/go/privilegedaccessmanager/apiv1/privilegedaccessmanagerpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in://   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=privilegedaccessmanager.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&privilegedaccessmanagerpb.CreateEntitlementRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/privilegedaccessmanager/apiv1/privilegedaccessmanagerpb#CreateEntitlementRequest.}op,err:=c.CreateEntitlement(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

func (*Client) CreateEntitlementOperation

func(c*Client)CreateEntitlementOperation(namestring)*CreateEntitlementOperation

CreateEntitlementOperation returns a new CreateEntitlementOperation from a given name.The name must be that of a previously created CreateEntitlementOperation, possibly from a different process.

func (*Client) CreateGrant

CreateGrant creates a new grant in a given project/folder/organization andlocation.

Example

packagemainimport("context"privilegedaccessmanager"cloud.google.com/go/privilegedaccessmanager/apiv1"privilegedaccessmanagerpb"cloud.google.com/go/privilegedaccessmanager/apiv1/privilegedaccessmanagerpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in://   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=privilegedaccessmanager.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&privilegedaccessmanagerpb.CreateGrantRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/privilegedaccessmanager/apiv1/privilegedaccessmanagerpb#CreateGrantRequest.}resp,err:=c.CreateGrant(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

func (*Client) DeleteEntitlement

DeleteEntitlement deletes a single entitlement. This method can only be called when thereare no in-progress (ACTIVE/ACTIVATING/REVOKING) grants under theentitlement.

Example

packagemainimport("context"privilegedaccessmanager"cloud.google.com/go/privilegedaccessmanager/apiv1"privilegedaccessmanagerpb"cloud.google.com/go/privilegedaccessmanager/apiv1/privilegedaccessmanagerpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in://   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=privilegedaccessmanager.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&privilegedaccessmanagerpb.DeleteEntitlementRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/privilegedaccessmanager/apiv1/privilegedaccessmanagerpb#DeleteEntitlementRequest.}op,err:=c.DeleteEntitlement(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

func (*Client) DeleteEntitlementOperation

func(c*Client)DeleteEntitlementOperation(namestring)*DeleteEntitlementOperation

DeleteEntitlementOperation returns a new DeleteEntitlementOperation from a given name.The name must be that of a previously created DeleteEntitlementOperation, possibly from a different process.

func (*Client) DeleteOperation

DeleteOperation is a utility method from google.longrunning.Operations.

Example

packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"privilegedaccessmanager"cloud.google.com/go/privilegedaccessmanager/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in://   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=privilegedaccessmanager.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.DeleteOperationRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#DeleteOperationRequest.}err=c.DeleteOperation(ctx,req)iferr!=nil{// TODO: Handle error.}}

func (*Client) DenyGrant

DenyGrant DenyGrant is used to deny a grant. This method can only be called on agrant when it’s in the APPROVAL_AWAITED state. This operation can’t beundone.

Example

packagemainimport("context"privilegedaccessmanager"cloud.google.com/go/privilegedaccessmanager/apiv1"privilegedaccessmanagerpb"cloud.google.com/go/privilegedaccessmanager/apiv1/privilegedaccessmanagerpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in://   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=privilegedaccessmanager.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&privilegedaccessmanagerpb.DenyGrantRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/privilegedaccessmanager/apiv1/privilegedaccessmanagerpb#DenyGrantRequest.}resp,err:=c.DenyGrant(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

func (*Client) GetEntitlement

GetEntitlement gets details of a single entitlement.

Example

packagemainimport("context"privilegedaccessmanager"cloud.google.com/go/privilegedaccessmanager/apiv1"privilegedaccessmanagerpb"cloud.google.com/go/privilegedaccessmanager/apiv1/privilegedaccessmanagerpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in://   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=privilegedaccessmanager.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&privilegedaccessmanagerpb.GetEntitlementRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/privilegedaccessmanager/apiv1/privilegedaccessmanagerpb#GetEntitlementRequest.}resp,err:=c.GetEntitlement(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

func (*Client) GetGrant

GetGrant get details of a single grant.

Example

packagemainimport("context"privilegedaccessmanager"cloud.google.com/go/privilegedaccessmanager/apiv1"privilegedaccessmanagerpb"cloud.google.com/go/privilegedaccessmanager/apiv1/privilegedaccessmanagerpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in://   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=privilegedaccessmanager.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&privilegedaccessmanagerpb.GetGrantRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/privilegedaccessmanager/apiv1/privilegedaccessmanagerpb#GetGrantRequest.}resp,err:=c.GetGrant(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

func (*Client) GetLocation

GetLocation gets information about a location.

Example

packagemainimport("context"privilegedaccessmanager"cloud.google.com/go/privilegedaccessmanager/apiv1"locationpb"google.golang.org/genproto/googleapis/cloud/location")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in://   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=privilegedaccessmanager.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&locationpb.GetLocationRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#GetLocationRequest.}resp,err:=c.GetLocation(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

func (*Client) GetOperation

GetOperation is a utility method from google.longrunning.Operations.

Example

packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"privilegedaccessmanager"cloud.google.com/go/privilegedaccessmanager/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in://   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=privilegedaccessmanager.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.GetOperationRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.}resp,err:=c.GetOperation(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

func (*Client) ListEntitlements

ListEntitlements lists entitlements in a given project/folder/organization and location.

Examples

packagemainimport("context"privilegedaccessmanager"cloud.google.com/go/privilegedaccessmanager/apiv1"privilegedaccessmanagerpb"cloud.google.com/go/privilegedaccessmanager/apiv1/privilegedaccessmanagerpb""google.golang.org/api/iterator")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in://   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=privilegedaccessmanager.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&privilegedaccessmanagerpb.ListEntitlementsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/privilegedaccessmanager/apiv1/privilegedaccessmanagerpb#ListEntitlementsRequest.}it:=c.ListEntitlements(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp// If you need to access the underlying RPC response,// you can do so by casting the `Response` as below.// Otherwise, remove this line. Only populated after// first call to Next(). Not safe for concurrent access._=it.Response.(*privilegedaccessmanagerpb.ListEntitlementsResponse)}}
all
packagemainimport("context"privilegedaccessmanager"cloud.google.com/go/privilegedaccessmanager/apiv1"privilegedaccessmanagerpb"cloud.google.com/go/privilegedaccessmanager/apiv1/privilegedaccessmanagerpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in://   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=privilegedaccessmanager.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&privilegedaccessmanagerpb.ListEntitlementsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/privilegedaccessmanager/apiv1/privilegedaccessmanagerpb#ListEntitlementsRequest.}forresp,err:=rangec.ListEntitlements(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}

func (*Client) ListGrants

ListGrants lists grants for a given entitlement.

Examples

packagemainimport("context"privilegedaccessmanager"cloud.google.com/go/privilegedaccessmanager/apiv1"privilegedaccessmanagerpb"cloud.google.com/go/privilegedaccessmanager/apiv1/privilegedaccessmanagerpb""google.golang.org/api/iterator")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in://   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=privilegedaccessmanager.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&privilegedaccessmanagerpb.ListGrantsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/privilegedaccessmanager/apiv1/privilegedaccessmanagerpb#ListGrantsRequest.}it:=c.ListGrants(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp// If you need to access the underlying RPC response,// you can do so by casting the `Response` as below.// Otherwise, remove this line. Only populated after// first call to Next(). Not safe for concurrent access._=it.Response.(*privilegedaccessmanagerpb.ListGrantsResponse)}}
all
packagemainimport("context"privilegedaccessmanager"cloud.google.com/go/privilegedaccessmanager/apiv1"privilegedaccessmanagerpb"cloud.google.com/go/privilegedaccessmanager/apiv1/privilegedaccessmanagerpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in://   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=privilegedaccessmanager.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&privilegedaccessmanagerpb.ListGrantsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/privilegedaccessmanager/apiv1/privilegedaccessmanagerpb#ListGrantsRequest.}forresp,err:=rangec.ListGrants(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}

func (*Client) ListLocations

ListLocations lists information about the supported locations for this service.

Examples

packagemainimport("context"privilegedaccessmanager"cloud.google.com/go/privilegedaccessmanager/apiv1""google.golang.org/api/iterator"locationpb"google.golang.org/genproto/googleapis/cloud/location")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in://   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=privilegedaccessmanager.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&locationpb.ListLocationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.}it:=c.ListLocations(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp// If you need to access the underlying RPC response,// you can do so by casting the `Response` as below.// Otherwise, remove this line. Only populated after// first call to Next(). Not safe for concurrent access._=it.Response.(*locationpb.ListLocationsResponse)}}
all
packagemainimport("context"privilegedaccessmanager"cloud.google.com/go/privilegedaccessmanager/apiv1"locationpb"google.golang.org/genproto/googleapis/cloud/location")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in://   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=privilegedaccessmanager.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&locationpb.ListLocationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.}forresp,err:=rangec.ListLocations(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}

func (*Client) ListOperations

ListOperations is a utility method from google.longrunning.Operations.

Examples

packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"privilegedaccessmanager"cloud.google.com/go/privilegedaccessmanager/apiv1""google.golang.org/api/iterator")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in://   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=privilegedaccessmanager.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.ListOperationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.}it:=c.ListOperations(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp// If you need to access the underlying RPC response,// you can do so by casting the `Response` as below.// Otherwise, remove this line. Only populated after// first call to Next(). Not safe for concurrent access._=it.Response.(*longrunningpb.ListOperationsResponse)}}
all
packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"privilegedaccessmanager"cloud.google.com/go/privilegedaccessmanager/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in://   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=privilegedaccessmanager.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.ListOperationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.}forresp,err:=rangec.ListOperations(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}

func (*Client) RevokeGrant

RevokeGrant RevokeGrant is used to immediately revoke access for a grant. This methodcan be called when the grant is in a non-terminal state.

Example

packagemainimport("context"privilegedaccessmanager"cloud.google.com/go/privilegedaccessmanager/apiv1"privilegedaccessmanagerpb"cloud.google.com/go/privilegedaccessmanager/apiv1/privilegedaccessmanagerpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in://   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=privilegedaccessmanager.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&privilegedaccessmanagerpb.RevokeGrantRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/privilegedaccessmanager/apiv1/privilegedaccessmanagerpb#RevokeGrantRequest.}op,err:=c.RevokeGrant(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

func (*Client) RevokeGrantOperation

func(c*Client)RevokeGrantOperation(namestring)*RevokeGrantOperation

RevokeGrantOperation returns a new RevokeGrantOperation from a given name.The name must be that of a previously created RevokeGrantOperation, possibly from a different process.

func (*Client) SearchEntitlements

SearchEntitlements SearchEntitlements returns entitlements on which the caller has thespecified access.

Examples

packagemainimport("context"privilegedaccessmanager"cloud.google.com/go/privilegedaccessmanager/apiv1"privilegedaccessmanagerpb"cloud.google.com/go/privilegedaccessmanager/apiv1/privilegedaccessmanagerpb""google.golang.org/api/iterator")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in://   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=privilegedaccessmanager.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&privilegedaccessmanagerpb.SearchEntitlementsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/privilegedaccessmanager/apiv1/privilegedaccessmanagerpb#SearchEntitlementsRequest.}it:=c.SearchEntitlements(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp// If you need to access the underlying RPC response,// you can do so by casting the `Response` as below.// Otherwise, remove this line. Only populated after// first call to Next(). Not safe for concurrent access._=it.Response.(*privilegedaccessmanagerpb.SearchEntitlementsResponse)}}
all
packagemainimport("context"privilegedaccessmanager"cloud.google.com/go/privilegedaccessmanager/apiv1"privilegedaccessmanagerpb"cloud.google.com/go/privilegedaccessmanager/apiv1/privilegedaccessmanagerpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in://   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=privilegedaccessmanager.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&privilegedaccessmanagerpb.SearchEntitlementsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/privilegedaccessmanager/apiv1/privilegedaccessmanagerpb#SearchEntitlementsRequest.}forresp,err:=rangec.SearchEntitlements(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}

func (*Client) SearchGrants

SearchGrants SearchGrants returns grants that are related to the calling user in thespecified way.

Examples

packagemainimport("context"privilegedaccessmanager"cloud.google.com/go/privilegedaccessmanager/apiv1"privilegedaccessmanagerpb"cloud.google.com/go/privilegedaccessmanager/apiv1/privilegedaccessmanagerpb""google.golang.org/api/iterator")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in://   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=privilegedaccessmanager.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&privilegedaccessmanagerpb.SearchGrantsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/privilegedaccessmanager/apiv1/privilegedaccessmanagerpb#SearchGrantsRequest.}it:=c.SearchGrants(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp// If you need to access the underlying RPC response,// you can do so by casting the `Response` as below.// Otherwise, remove this line. Only populated after// first call to Next(). Not safe for concurrent access._=it.Response.(*privilegedaccessmanagerpb.SearchGrantsResponse)}}
all
packagemainimport("context"privilegedaccessmanager"cloud.google.com/go/privilegedaccessmanager/apiv1"privilegedaccessmanagerpb"cloud.google.com/go/privilegedaccessmanager/apiv1/privilegedaccessmanagerpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in://   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=privilegedaccessmanager.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&privilegedaccessmanagerpb.SearchGrantsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/privilegedaccessmanager/apiv1/privilegedaccessmanagerpb#SearchGrantsRequest.}forresp,err:=rangec.SearchGrants(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}

func (*Client) UpdateEntitlement

UpdateEntitlement updates the entitlement specified in the request. Updated fields in theentitlement need to be specified in an update mask. The changes made to anentitlement are applicable only on future grants of the entitlement.However, if new approvers are added or existing approvers are removed fromthe approval workflow, the changes are effective on existing grants.

The following fields are not supported for updates:

All immutable fieldsEntitlement nameResource nameResource typeAdding an approval workflow in an entitlement which previously had noapproval workflow.Deleting the approval workflow from an entitlement.Adding or deleting a step in the approval workflow (only one step issupported)

Note that updates are allowed on the list of approvers in an approvalworkflow step.

Example

packagemainimport("context"privilegedaccessmanager"cloud.google.com/go/privilegedaccessmanager/apiv1"privilegedaccessmanagerpb"cloud.google.com/go/privilegedaccessmanager/apiv1/privilegedaccessmanagerpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in://   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=privilegedaccessmanager.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&privilegedaccessmanagerpb.UpdateEntitlementRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/privilegedaccessmanager/apiv1/privilegedaccessmanagerpb#UpdateEntitlementRequest.}op,err:=c.UpdateEntitlement(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

func (*Client) UpdateEntitlementOperation

func(c*Client)UpdateEntitlementOperation(namestring)*UpdateEntitlementOperation

UpdateEntitlementOperation returns a new UpdateEntitlementOperation from a given name.The name must be that of a previously created UpdateEntitlementOperation, possibly from a different process.

CreateEntitlementOperation

typeCreateEntitlementOperationstruct{// contains filtered or unexported fields}

CreateEntitlementOperation manages a long-running operation from CreateEntitlement.

func (*CreateEntitlementOperation) Done

Done reports whether the long-running operation has completed.

func (*CreateEntitlementOperation) Metadata

Metadata returns metadata associated with the long-running operation.Metadata itself does not contact the server, but Poll does.To get the latest metadata, call this method after a successful call to Poll.If the metadata is not available, the returned metadata and error are both nil.

func (*CreateEntitlementOperation) Name

Name returns the name of the long-running operation.The name is assigned by the server and is unique within the service from which the operation is created.

func (*CreateEntitlementOperation) Poll

Poll fetches the latest state of the long-running operation.

Poll also fetches the latest metadata, which can be retrieved by Metadata.

If Poll fails, the error is returned and op is unmodified. If Poll succeeds andthe operation has completed with failure, the error is returned and op.Done will return true.If Poll succeeds and the operation has completed successfully,op.Done will return true, and the response of the operation is returned.If Poll succeeds and the operation has not completed, the returned response and error are both nil.

func (*CreateEntitlementOperation) Wait

Wait blocks until the long-running operation is completed, returning the response and any errors encountered.

See documentation of Poll for error-handling information.

DeleteEntitlementOperation

typeDeleteEntitlementOperationstruct{// contains filtered or unexported fields}

DeleteEntitlementOperation manages a long-running operation from DeleteEntitlement.

func (*DeleteEntitlementOperation) Done

Done reports whether the long-running operation has completed.

func (*DeleteEntitlementOperation) Metadata

Metadata returns metadata associated with the long-running operation.Metadata itself does not contact the server, but Poll does.To get the latest metadata, call this method after a successful call to Poll.If the metadata is not available, the returned metadata and error are both nil.

func (*DeleteEntitlementOperation) Name

Name returns the name of the long-running operation.The name is assigned by the server and is unique within the service from which the operation is created.

func (*DeleteEntitlementOperation) Poll

Poll fetches the latest state of the long-running operation.

Poll also fetches the latest metadata, which can be retrieved by Metadata.

If Poll fails, the error is returned and op is unmodified. If Poll succeeds andthe operation has completed with failure, the error is returned and op.Done will return true.If Poll succeeds and the operation has completed successfully,op.Done will return true, and the response of the operation is returned.If Poll succeeds and the operation has not completed, the returned response and error are both nil.

func (*DeleteEntitlementOperation) Wait

Wait blocks until the long-running operation is completed, returning the response and any errors encountered.

See documentation of Poll for error-handling information.

EntitlementIterator

typeEntitlementIteratorstruct{// Response is the raw response for the current page.// It must be cast to the RPC response type.// Calling Next() or InternalFetch() updates this value.Responseinterface{}// InternalFetch is for use by the Google Cloud Libraries only.// It is not part of the stable interface of this package.//// InternalFetch returns results from a single call to the underlying RPC.// The number of results is no greater than pageSize.// If there are no more results, nextPageToken is empty and err is nil.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*privilegedaccessmanagerpb.Entitlement,nextPageTokenstring,errerror)// contains filtered or unexported fields}

EntitlementIterator manages a stream of *privilegedaccessmanagerpb.Entitlement.

func (*EntitlementIterator) All

func(it*EntitlementIterator)All()iter.Seq2[*privilegedaccessmanagerpb.Entitlement,error]

All returns an iterator. If an error is returned by the iterator, theiterator will stop after that iteration.

func (*EntitlementIterator) Next

Next returns the next result. Its second return value is iterator.Done if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.

func (*EntitlementIterator) PageInfo

func(it*EntitlementIterator)PageInfo()*iterator.PageInfo

PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.

GrantIterator

typeGrantIteratorstruct{// Response is the raw response for the current page.// It must be cast to the RPC response type.// Calling Next() or InternalFetch() updates this value.Responseinterface{}// InternalFetch is for use by the Google Cloud Libraries only.// It is not part of the stable interface of this package.//// InternalFetch returns results from a single call to the underlying RPC.// The number of results is no greater than pageSize.// If there are no more results, nextPageToken is empty and err is nil.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*privilegedaccessmanagerpb.Grant,nextPageTokenstring,errerror)// contains filtered or unexported fields}

GrantIterator manages a stream of *privilegedaccessmanagerpb.Grant.

func (*GrantIterator) All

func(it*GrantIterator)All()iter.Seq2[*privilegedaccessmanagerpb.Grant,error]

All returns an iterator. If an error is returned by the iterator, theiterator will stop after that iteration.

func (*GrantIterator) Next

Next returns the next result. Its second return value is iterator.Done if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.

func (*GrantIterator) PageInfo

func(it*GrantIterator)PageInfo()*iterator.PageInfo

PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.

LocationIterator

typeLocationIteratorstruct{// Response is the raw response for the current page.// It must be cast to the RPC response type.// Calling Next() or InternalFetch() updates this value.Responseinterface{}// InternalFetch is for use by the Google Cloud Libraries only.// It is not part of the stable interface of this package.//// InternalFetch returns results from a single call to the underlying RPC.// The number of results is no greater than pageSize.// If there are no more results, nextPageToken is empty and err is nil.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*locationpb.Location,nextPageTokenstring,errerror)// contains filtered or unexported fields}

LocationIterator manages a stream of *locationpb.Location.

func (*LocationIterator) All

func(it*LocationIterator)All()iter.Seq2[*locationpb.Location,error]

All returns an iterator. If an error is returned by the iterator, theiterator will stop after that iteration.

func (*LocationIterator) Next

Next returns the next result. Its second return value is iterator.Done if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.

func (*LocationIterator) PageInfo

func(it*LocationIterator)PageInfo()*iterator.PageInfo

PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.

OperationIterator

typeOperationIteratorstruct{// Response is the raw response for the current page.// It must be cast to the RPC response type.// Calling Next() or InternalFetch() updates this value.Responseinterface{}// InternalFetch is for use by the Google Cloud Libraries only.// It is not part of the stable interface of this package.//// InternalFetch returns results from a single call to the underlying RPC.// The number of results is no greater than pageSize.// If there are no more results, nextPageToken is empty and err is nil.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*longrunningpb.Operation,nextPageTokenstring,errerror)// contains filtered or unexported fields}

OperationIterator manages a stream of *longrunningpb.Operation.

func (*OperationIterator) All

func(it*OperationIterator)All()iter.Seq2[*longrunningpb.Operation,error]

All returns an iterator. If an error is returned by the iterator, theiterator will stop after that iteration.

func (*OperationIterator) Next

Next returns the next result. Its second return value is iterator.Done if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.

func (*OperationIterator) PageInfo

func(it*OperationIterator)PageInfo()*iterator.PageInfo

PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.

RevokeGrantOperation

typeRevokeGrantOperationstruct{// contains filtered or unexported fields}

RevokeGrantOperation manages a long-running operation from RevokeGrant.

func (*RevokeGrantOperation) Done

Done reports whether the long-running operation has completed.

func (*RevokeGrantOperation) Metadata

Metadata returns metadata associated with the long-running operation.Metadata itself does not contact the server, but Poll does.To get the latest metadata, call this method after a successful call to Poll.If the metadata is not available, the returned metadata and error are both nil.

func (*RevokeGrantOperation) Name

Name returns the name of the long-running operation.The name is assigned by the server and is unique within the service from which the operation is created.

func (*RevokeGrantOperation) Poll

Poll fetches the latest state of the long-running operation.

Poll also fetches the latest metadata, which can be retrieved by Metadata.

If Poll fails, the error is returned and op is unmodified. If Poll succeeds andthe operation has completed with failure, the error is returned and op.Done will return true.If Poll succeeds and the operation has completed successfully,op.Done will return true, and the response of the operation is returned.If Poll succeeds and the operation has not completed, the returned response and error are both nil.

func (*RevokeGrantOperation) Wait

Wait blocks until the long-running operation is completed, returning the response and any errors encountered.

See documentation of Poll for error-handling information.

UpdateEntitlementOperation

typeUpdateEntitlementOperationstruct{// contains filtered or unexported fields}

UpdateEntitlementOperation manages a long-running operation from UpdateEntitlement.

func (*UpdateEntitlementOperation) Done

Done reports whether the long-running operation has completed.

func (*UpdateEntitlementOperation) Metadata

Metadata returns metadata associated with the long-running operation.Metadata itself does not contact the server, but Poll does.To get the latest metadata, call this method after a successful call to Poll.If the metadata is not available, the returned metadata and error are both nil.

func (*UpdateEntitlementOperation) Name

Name returns the name of the long-running operation.The name is assigned by the server and is unique within the service from which the operation is created.

func (*UpdateEntitlementOperation) Poll

Poll fetches the latest state of the long-running operation.

Poll also fetches the latest metadata, which can be retrieved by Metadata.

If Poll fails, the error is returned and op is unmodified. If Poll succeeds andthe operation has completed with failure, the error is returned and op.Done will return true.If Poll succeeds and the operation has completed successfully,op.Done will return true, and the response of the operation is returned.If Poll succeeds and the operation has not completed, the returned response and error are both nil.

func (*UpdateEntitlementOperation) Wait

Wait blocks until the long-running operation is completed, returning the response and any errors encountered.

See documentation of Poll for error-handling information.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-10-30 UTC.