privilegedaccessmanager
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Overview¶
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: This package is in beta. It is not stable, and may be subject to changes.
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:
- Authentication and Authorization
- Timeouts and Cancellation
- Testing against Client Libraries
- Debugging Client Libraries
- Inspecting errors
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)if err != nil {// TODO: Handle error.}defer c.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)if err != nil {// TODO: Handle error.}// TODO: Use resp._ = respUse 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.
Index¶
- func DefaultAuthScopes() []string
- type CallOptions
- type Client
- func (c *Client) ApproveGrant(ctx context.Context, req *privilegedaccessmanagerpb.ApproveGrantRequest, ...) (*privilegedaccessmanagerpb.Grant, error)
- func (c *Client) CheckOnboardingStatus(ctx context.Context, ...) (*privilegedaccessmanagerpb.CheckOnboardingStatusResponse, error)
- func (c *Client) Close() error
- func (c *Client) Connection() *grpc.ClientConndeprecated
- func (c *Client) CreateEntitlement(ctx context.Context, req *privilegedaccessmanagerpb.CreateEntitlementRequest, ...) (*CreateEntitlementOperation, error)
- func (c *Client) CreateEntitlementOperation(name string) *CreateEntitlementOperation
- func (c *Client) CreateGrant(ctx context.Context, req *privilegedaccessmanagerpb.CreateGrantRequest, ...) (*privilegedaccessmanagerpb.Grant, error)
- func (c *Client) DeleteEntitlement(ctx context.Context, req *privilegedaccessmanagerpb.DeleteEntitlementRequest, ...) (*DeleteEntitlementOperation, error)
- func (c *Client) DeleteEntitlementOperation(name string) *DeleteEntitlementOperation
- func (c *Client) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, ...) error
- func (c *Client) DenyGrant(ctx context.Context, req *privilegedaccessmanagerpb.DenyGrantRequest, ...) (*privilegedaccessmanagerpb.Grant, error)
- func (c *Client) GetEntitlement(ctx context.Context, req *privilegedaccessmanagerpb.GetEntitlementRequest, ...) (*privilegedaccessmanagerpb.Entitlement, error)
- func (c *Client) GetGrant(ctx context.Context, req *privilegedaccessmanagerpb.GetGrantRequest, ...) (*privilegedaccessmanagerpb.Grant, error)
- func (c *Client) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, ...) (*locationpb.Location, error)
- func (c *Client) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, ...) (*longrunningpb.Operation, error)
- func (c *Client) ListEntitlements(ctx context.Context, req *privilegedaccessmanagerpb.ListEntitlementsRequest, ...) *EntitlementIterator
- func (c *Client) ListGrants(ctx context.Context, req *privilegedaccessmanagerpb.ListGrantsRequest, ...) *GrantIterator
- func (c *Client) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, ...) *LocationIterator
- func (c *Client) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, ...) *OperationIterator
- func (c *Client) RevokeGrant(ctx context.Context, req *privilegedaccessmanagerpb.RevokeGrantRequest, ...) (*RevokeGrantOperation, error)
- func (c *Client) RevokeGrantOperation(name string) *RevokeGrantOperation
- func (c *Client) SearchEntitlements(ctx context.Context, req *privilegedaccessmanagerpb.SearchEntitlementsRequest, ...) *EntitlementIterator
- func (c *Client) SearchGrants(ctx context.Context, req *privilegedaccessmanagerpb.SearchGrantsRequest, ...) *GrantIterator
- func (c *Client) UpdateEntitlement(ctx context.Context, req *privilegedaccessmanagerpb.UpdateEntitlementRequest, ...) (*UpdateEntitlementOperation, error)
- func (c *Client) UpdateEntitlementOperation(name string) *UpdateEntitlementOperation
- type CreateEntitlementOperation
- func (op *CreateEntitlementOperation) Done() bool
- func (op *CreateEntitlementOperation) Metadata() (*privilegedaccessmanagerpb.OperationMetadata, error)
- func (op *CreateEntitlementOperation) Name() string
- func (op *CreateEntitlementOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*privilegedaccessmanagerpb.Entitlement, error)
- func (op *CreateEntitlementOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*privilegedaccessmanagerpb.Entitlement, error)
- type DeleteEntitlementOperation
- func (op *DeleteEntitlementOperation) Done() bool
- func (op *DeleteEntitlementOperation) Metadata() (*privilegedaccessmanagerpb.OperationMetadata, error)
- func (op *DeleteEntitlementOperation) Name() string
- func (op *DeleteEntitlementOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*privilegedaccessmanagerpb.Entitlement, error)
- func (op *DeleteEntitlementOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*privilegedaccessmanagerpb.Entitlement, error)
- type EntitlementIterator
- type GrantIterator
- type LocationIterator
- type OperationIterator
- type RevokeGrantOperation
- func (op *RevokeGrantOperation) Done() bool
- func (op *RevokeGrantOperation) Metadata() (*privilegedaccessmanagerpb.OperationMetadata, error)
- func (op *RevokeGrantOperation) Name() string
- func (op *RevokeGrantOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*privilegedaccessmanagerpb.Grant, error)
- func (op *RevokeGrantOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*privilegedaccessmanagerpb.Grant, error)
- type UpdateEntitlementOperation
- func (op *UpdateEntitlementOperation) Done() bool
- func (op *UpdateEntitlementOperation) Metadata() (*privilegedaccessmanagerpb.OperationMetadata, error)
- func (op *UpdateEntitlementOperation) Name() string
- func (op *UpdateEntitlementOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*privilegedaccessmanagerpb.Entitlement, error)
- func (op *UpdateEntitlementOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*privilegedaccessmanagerpb.Entitlement, error)
Examples¶
- Client.ApproveGrant
- Client.CheckOnboardingStatus
- Client.CreateEntitlement
- Client.CreateGrant
- Client.DeleteEntitlement
- Client.DeleteOperation
- Client.DenyGrant
- Client.GetEntitlement
- Client.GetGrant
- Client.GetLocation
- Client.GetOperation
- Client.ListEntitlements
- Client.ListEntitlements (All)
- Client.ListGrants
- Client.ListGrants (All)
- Client.ListLocations
- Client.ListLocations (All)
- Client.ListOperations
- Client.ListOperations (All)
- Client.RevokeGrant
- Client.SearchEntitlements
- Client.SearchEntitlements (All)
- Client.SearchGrants
- Client.SearchGrants (All)
- Client.UpdateEntitlement
- NewClient
- NewRESTClient
Constants¶
This section is empty.
Variables¶
This section is empty.
Functions¶
funcDefaultAuthScopes¶
func DefaultAuthScopes() []string
DefaultAuthScopes reports the default set of authentication scopes to use with this package.
Types¶
typeCallOptions¶
type CallOptions struct {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.
typeClient¶
type Client struct {// 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.
funcNewClient¶
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¶
package mainimport ("context"privilegedaccessmanager "cloud.google.com/go/privilegedaccessmanager/apiv1")func main() {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)if err != nil {// TODO: Handle error.}defer c.Close()// TODO: Use client._ = c}funcNewRESTClient¶
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¶
package mainimport ("context"privilegedaccessmanager "cloud.google.com/go/privilegedaccessmanager/apiv1")func main() {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)if err != nil {// TODO: Handle error.}defer c.Close()// TODO: Use client._ = c}func (*Client)ApproveGrant¶
func (c *Client) ApproveGrant(ctxcontext.Context, req *privilegedaccessmanagerpb.ApproveGrantRequest, opts ...gax.CallOption) (*privilegedaccessmanagerpb.Grant,error)
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¶
package mainimport ("context"privilegedaccessmanager "cloud.google.com/go/privilegedaccessmanager/apiv1"privilegedaccessmanagerpb "cloud.google.com/go/privilegedaccessmanager/apiv1/privilegedaccessmanagerpb")func main() {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)if err != nil {// TODO: Handle error.}defer c.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)if err != nil {// TODO: Handle error.}// TODO: Use resp._ = resp}func (*Client)CheckOnboardingStatus¶
func (c *Client) CheckOnboardingStatus(ctxcontext.Context, req *privilegedaccessmanagerpb.CheckOnboardingStatusRequest, opts ...gax.CallOption) (*privilegedaccessmanagerpb.CheckOnboardingStatusResponse,error)
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¶
package mainimport ("context"privilegedaccessmanager "cloud.google.com/go/privilegedaccessmanager/apiv1"privilegedaccessmanagerpb "cloud.google.com/go/privilegedaccessmanager/apiv1/privilegedaccessmanagerpb")func main() {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)if err != nil {// TODO: Handle error.}defer c.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)if err != nil {// TODO: Handle error.}// TODO: Use resp._ = resp}func (*Client)Close¶
Close closes the connection to the API service. The user should invoke this whenthe client is no longer required.
func (*Client)Connectiondeprecated
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¶
func (c *Client) CreateEntitlement(ctxcontext.Context, req *privilegedaccessmanagerpb.CreateEntitlementRequest, opts ...gax.CallOption) (*CreateEntitlementOperation,error)
CreateEntitlement creates a new entitlement in a given project/folder/organization andlocation.
Example¶
package mainimport ("context"privilegedaccessmanager "cloud.google.com/go/privilegedaccessmanager/apiv1"privilegedaccessmanagerpb "cloud.google.com/go/privilegedaccessmanager/apiv1/privilegedaccessmanagerpb")func main() {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)if err != nil {// TODO: Handle error.}defer c.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)if err != nil {// TODO: Handle error.}resp, err := op.Wait(ctx)if err != 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¶
func (c *Client) CreateGrant(ctxcontext.Context, req *privilegedaccessmanagerpb.CreateGrantRequest, opts ...gax.CallOption) (*privilegedaccessmanagerpb.Grant,error)
CreateGrant creates a new grant in a given project/folder/organization andlocation.
Example¶
package mainimport ("context"privilegedaccessmanager "cloud.google.com/go/privilegedaccessmanager/apiv1"privilegedaccessmanagerpb "cloud.google.com/go/privilegedaccessmanager/apiv1/privilegedaccessmanagerpb")func main() {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)if err != nil {// TODO: Handle error.}defer c.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)if err != nil {// TODO: Handle error.}// TODO: Use resp._ = resp}func (*Client)DeleteEntitlement¶
func (c *Client) DeleteEntitlement(ctxcontext.Context, req *privilegedaccessmanagerpb.DeleteEntitlementRequest, opts ...gax.CallOption) (*DeleteEntitlementOperation,error)
DeleteEntitlement deletes a single entitlement. This method can only be called when thereare no in-progress (ACTIVE/ACTIVATING/REVOKING) grants under theentitlement.
Example¶
package mainimport ("context"privilegedaccessmanager "cloud.google.com/go/privilegedaccessmanager/apiv1"privilegedaccessmanagerpb "cloud.google.com/go/privilegedaccessmanager/apiv1/privilegedaccessmanagerpb")func main() {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)if err != nil {// TODO: Handle error.}defer c.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)if err != nil {// TODO: Handle error.}resp, err := op.Wait(ctx)if err != 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¶
func (c *Client) DeleteOperation(ctxcontext.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption)error
DeleteOperation is a utility method from google.longrunning.Operations.
Example¶
package mainimport ("context"longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"privilegedaccessmanager "cloud.google.com/go/privilegedaccessmanager/apiv1")func main() {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)if err != nil {// TODO: Handle error.}defer c.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)if err != nil {// TODO: Handle error.}}func (*Client)DenyGrant¶
func (c *Client) DenyGrant(ctxcontext.Context, req *privilegedaccessmanagerpb.DenyGrantRequest, opts ...gax.CallOption) (*privilegedaccessmanagerpb.Grant,error)
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¶
package mainimport ("context"privilegedaccessmanager "cloud.google.com/go/privilegedaccessmanager/apiv1"privilegedaccessmanagerpb "cloud.google.com/go/privilegedaccessmanager/apiv1/privilegedaccessmanagerpb")func main() {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)if err != nil {// TODO: Handle error.}defer c.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)if err != nil {// TODO: Handle error.}// TODO: Use resp._ = resp}func (*Client)GetEntitlement¶
func (c *Client) GetEntitlement(ctxcontext.Context, req *privilegedaccessmanagerpb.GetEntitlementRequest, opts ...gax.CallOption) (*privilegedaccessmanagerpb.Entitlement,error)
GetEntitlement gets details of a single entitlement.
Example¶
package mainimport ("context"privilegedaccessmanager "cloud.google.com/go/privilegedaccessmanager/apiv1"privilegedaccessmanagerpb "cloud.google.com/go/privilegedaccessmanager/apiv1/privilegedaccessmanagerpb")func main() {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)if err != nil {// TODO: Handle error.}defer c.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)if err != nil {// TODO: Handle error.}// TODO: Use resp._ = resp}func (*Client)GetGrant¶
func (c *Client) GetGrant(ctxcontext.Context, req *privilegedaccessmanagerpb.GetGrantRequest, opts ...gax.CallOption) (*privilegedaccessmanagerpb.Grant,error)
GetGrant get details of a single grant.
Example¶
package mainimport ("context"privilegedaccessmanager "cloud.google.com/go/privilegedaccessmanager/apiv1"privilegedaccessmanagerpb "cloud.google.com/go/privilegedaccessmanager/apiv1/privilegedaccessmanagerpb")func main() {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)if err != nil {// TODO: Handle error.}defer c.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)if err != nil {// TODO: Handle error.}// TODO: Use resp._ = resp}func (*Client)GetLocation¶
func (c *Client) GetLocation(ctxcontext.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location,error)
GetLocation gets information about a location.
Example¶
package mainimport ("context"privilegedaccessmanager "cloud.google.com/go/privilegedaccessmanager/apiv1"locationpb "google.golang.org/genproto/googleapis/cloud/location")func main() {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)if err != nil {// TODO: Handle error.}defer c.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)if err != nil {// TODO: Handle error.}// TODO: Use resp._ = resp}func (*Client)GetOperation¶
func (c *Client) GetOperation(ctxcontext.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation,error)
GetOperation is a utility method from google.longrunning.Operations.
Example¶
package mainimport ("context"longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"privilegedaccessmanager "cloud.google.com/go/privilegedaccessmanager/apiv1")func main() {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)if err != nil {// TODO: Handle error.}defer c.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)if err != nil {// TODO: Handle error.}// TODO: Use resp._ = resp}func (*Client)ListEntitlements¶
func (c *Client) ListEntitlements(ctxcontext.Context, req *privilegedaccessmanagerpb.ListEntitlementsRequest, opts ...gax.CallOption) *EntitlementIterator
ListEntitlements lists entitlements in a given project/folder/organization and location.
Example¶
package mainimport ("context"privilegedaccessmanager "cloud.google.com/go/privilegedaccessmanager/apiv1"privilegedaccessmanagerpb "cloud.google.com/go/privilegedaccessmanager/apiv1/privilegedaccessmanagerpb""google.golang.org/api/iterator")func main() {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)if err != nil {// TODO: Handle error.}defer c.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()if err == iterator.Done {break}if err != 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)}}Example (All)¶
package mainimport ("context"privilegedaccessmanager "cloud.google.com/go/privilegedaccessmanager/apiv1"privilegedaccessmanagerpb "cloud.google.com/go/privilegedaccessmanager/apiv1/privilegedaccessmanagerpb")func main() {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)if err != nil {// TODO: Handle error.}defer c.Close()req := &privilegedaccessmanagerpb.ListEntitlementsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/privilegedaccessmanager/apiv1/privilegedaccessmanagerpb#ListEntitlementsRequest.}for resp, err := range c.ListEntitlements(ctx, req).All() {if err != nil {// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._ = resp}}func (*Client)ListGrants¶
func (c *Client) ListGrants(ctxcontext.Context, req *privilegedaccessmanagerpb.ListGrantsRequest, opts ...gax.CallOption) *GrantIterator
ListGrants lists grants for a given entitlement.
Example¶
package mainimport ("context"privilegedaccessmanager "cloud.google.com/go/privilegedaccessmanager/apiv1"privilegedaccessmanagerpb "cloud.google.com/go/privilegedaccessmanager/apiv1/privilegedaccessmanagerpb""google.golang.org/api/iterator")func main() {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)if err != nil {// TODO: Handle error.}defer c.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()if err == iterator.Done {break}if err != 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)}}Example (All)¶
package mainimport ("context"privilegedaccessmanager "cloud.google.com/go/privilegedaccessmanager/apiv1"privilegedaccessmanagerpb "cloud.google.com/go/privilegedaccessmanager/apiv1/privilegedaccessmanagerpb")func main() {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)if err != nil {// TODO: Handle error.}defer c.Close()req := &privilegedaccessmanagerpb.ListGrantsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/privilegedaccessmanager/apiv1/privilegedaccessmanagerpb#ListGrantsRequest.}for resp, err := range c.ListGrants(ctx, req).All() {if err != nil {// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._ = resp}}func (*Client)ListLocations¶
func (c *Client) ListLocations(ctxcontext.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator
ListLocations lists information about the supported locations for this service.
Example¶
package mainimport ("context"privilegedaccessmanager "cloud.google.com/go/privilegedaccessmanager/apiv1""google.golang.org/api/iterator"locationpb "google.golang.org/genproto/googleapis/cloud/location")func main() {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)if err != nil {// TODO: Handle error.}defer c.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()if err == iterator.Done {break}if err != 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)}}Example (All)¶
package mainimport ("context"privilegedaccessmanager "cloud.google.com/go/privilegedaccessmanager/apiv1"locationpb "google.golang.org/genproto/googleapis/cloud/location")func main() {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)if err != nil {// TODO: Handle error.}defer c.Close()req := &locationpb.ListLocationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.}for resp, err := range c.ListLocations(ctx, req).All() {if err != nil {// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._ = resp}}func (*Client)ListOperations¶
func (c *Client) ListOperations(ctxcontext.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
ListOperations is a utility method from google.longrunning.Operations.
Example¶
package mainimport ("context"longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"privilegedaccessmanager "cloud.google.com/go/privilegedaccessmanager/apiv1""google.golang.org/api/iterator")func main() {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)if err != nil {// TODO: Handle error.}defer c.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()if err == iterator.Done {break}if err != 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)}}Example (All)¶
package mainimport ("context"longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"privilegedaccessmanager "cloud.google.com/go/privilegedaccessmanager/apiv1")func main() {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)if err != nil {// TODO: Handle error.}defer c.Close()req := &longrunningpb.ListOperationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.}for resp, err := range c.ListOperations(ctx, req).All() {if err != nil {// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._ = resp}}func (*Client)RevokeGrant¶
func (c *Client) RevokeGrant(ctxcontext.Context, req *privilegedaccessmanagerpb.RevokeGrantRequest, opts ...gax.CallOption) (*RevokeGrantOperation,error)
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¶
package mainimport ("context"privilegedaccessmanager "cloud.google.com/go/privilegedaccessmanager/apiv1"privilegedaccessmanagerpb "cloud.google.com/go/privilegedaccessmanager/apiv1/privilegedaccessmanagerpb")func main() {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)if err != nil {// TODO: Handle error.}defer c.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)if err != nil {// TODO: Handle error.}resp, err := op.Wait(ctx)if err != 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¶
func (c *Client) SearchEntitlements(ctxcontext.Context, req *privilegedaccessmanagerpb.SearchEntitlementsRequest, opts ...gax.CallOption) *EntitlementIterator
SearchEntitlements SearchEntitlements returns entitlements on which the caller has thespecified access.
Example¶
package mainimport ("context"privilegedaccessmanager "cloud.google.com/go/privilegedaccessmanager/apiv1"privilegedaccessmanagerpb "cloud.google.com/go/privilegedaccessmanager/apiv1/privilegedaccessmanagerpb""google.golang.org/api/iterator")func main() {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)if err != nil {// TODO: Handle error.}defer c.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()if err == iterator.Done {break}if err != 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)}}Example (All)¶
package mainimport ("context"privilegedaccessmanager "cloud.google.com/go/privilegedaccessmanager/apiv1"privilegedaccessmanagerpb "cloud.google.com/go/privilegedaccessmanager/apiv1/privilegedaccessmanagerpb")func main() {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)if err != nil {// TODO: Handle error.}defer c.Close()req := &privilegedaccessmanagerpb.SearchEntitlementsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/privilegedaccessmanager/apiv1/privilegedaccessmanagerpb#SearchEntitlementsRequest.}for resp, err := range c.SearchEntitlements(ctx, req).All() {if err != nil {// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._ = resp}}func (*Client)SearchGrants¶
func (c *Client) SearchGrants(ctxcontext.Context, req *privilegedaccessmanagerpb.SearchGrantsRequest, opts ...gax.CallOption) *GrantIterator
SearchGrants SearchGrants returns grants that are related to the calling user in thespecified way.
Example¶
package mainimport ("context"privilegedaccessmanager "cloud.google.com/go/privilegedaccessmanager/apiv1"privilegedaccessmanagerpb "cloud.google.com/go/privilegedaccessmanager/apiv1/privilegedaccessmanagerpb""google.golang.org/api/iterator")func main() {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)if err != nil {// TODO: Handle error.}defer c.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()if err == iterator.Done {break}if err != 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)}}Example (All)¶
package mainimport ("context"privilegedaccessmanager "cloud.google.com/go/privilegedaccessmanager/apiv1"privilegedaccessmanagerpb "cloud.google.com/go/privilegedaccessmanager/apiv1/privilegedaccessmanagerpb")func main() {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)if err != nil {// TODO: Handle error.}defer c.Close()req := &privilegedaccessmanagerpb.SearchGrantsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/privilegedaccessmanager/apiv1/privilegedaccessmanagerpb#SearchGrantsRequest.}for resp, err := range c.SearchGrants(ctx, req).All() {if err != nil {// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._ = resp}}func (*Client)UpdateEntitlement¶
func (c *Client) UpdateEntitlement(ctxcontext.Context, req *privilegedaccessmanagerpb.UpdateEntitlementRequest, opts ...gax.CallOption) (*UpdateEntitlementOperation,error)
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¶
package mainimport ("context"privilegedaccessmanager "cloud.google.com/go/privilegedaccessmanager/apiv1"privilegedaccessmanagerpb "cloud.google.com/go/privilegedaccessmanager/apiv1/privilegedaccessmanagerpb")func main() {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)if err != nil {// TODO: Handle error.}defer c.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)if err != nil {// TODO: Handle error.}resp, err := op.Wait(ctx)if err != 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.
typeCreateEntitlementOperation¶
type CreateEntitlementOperation struct {// contains filtered or unexported fields}CreateEntitlementOperation manages a long-running operation from CreateEntitlement.
func (*CreateEntitlementOperation)Done¶
func (op *CreateEntitlementOperation) Done()bool
Done reports whether the long-running operation has completed.
func (*CreateEntitlementOperation)Metadata¶
func (op *CreateEntitlementOperation) Metadata() (*privilegedaccessmanagerpb.OperationMetadata,error)
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¶
func (op *CreateEntitlementOperation) Name()string
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¶
func (op *CreateEntitlementOperation) Poll(ctxcontext.Context, opts ...gax.CallOption) (*privilegedaccessmanagerpb.Entitlement,error)
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¶
func (op *CreateEntitlementOperation) Wait(ctxcontext.Context, opts ...gax.CallOption) (*privilegedaccessmanagerpb.Entitlement,error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
typeDeleteEntitlementOperation¶
type DeleteEntitlementOperation struct {// contains filtered or unexported fields}DeleteEntitlementOperation manages a long-running operation from DeleteEntitlement.
func (*DeleteEntitlementOperation)Done¶
func (op *DeleteEntitlementOperation) Done()bool
Done reports whether the long-running operation has completed.
func (*DeleteEntitlementOperation)Metadata¶
func (op *DeleteEntitlementOperation) Metadata() (*privilegedaccessmanagerpb.OperationMetadata,error)
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¶
func (op *DeleteEntitlementOperation) Name()string
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¶
func (op *DeleteEntitlementOperation) Poll(ctxcontext.Context, opts ...gax.CallOption) (*privilegedaccessmanagerpb.Entitlement,error)
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¶
func (op *DeleteEntitlementOperation) Wait(ctxcontext.Context, opts ...gax.CallOption) (*privilegedaccessmanagerpb.Entitlement,error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
typeEntitlementIterator¶
type EntitlementIterator struct {// 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.Response interface{}// 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.InternalFetch func(pageSizeint, pageTokenstring) (results []*privilegedaccessmanagerpb.Entitlement, nextPageTokenstring, errerror)// contains filtered or unexported fields}EntitlementIterator manages a stream of *privilegedaccessmanagerpb.Entitlement.
func (*EntitlementIterator)All¶added inv0.2.0
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¶
func (it *EntitlementIterator) Next() (*privilegedaccessmanagerpb.Entitlement,error)
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 thegoogle.golang.org/api/iterator package for details.
typeGrantIterator¶
type GrantIterator struct {// 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.Response interface{}// 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.InternalFetch func(pageSizeint, pageTokenstring) (results []*privilegedaccessmanagerpb.Grant, nextPageTokenstring, errerror)// contains filtered or unexported fields}GrantIterator manages a stream of *privilegedaccessmanagerpb.Grant.
func (*GrantIterator)All¶added inv0.2.0
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¶
func (it *GrantIterator) Next() (*privilegedaccessmanagerpb.Grant,error)
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 thegoogle.golang.org/api/iterator package for details.
typeLocationIterator¶
type LocationIterator struct {// 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.Response interface{}// 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.InternalFetch func(pageSizeint, pageTokenstring) (results []*locationpb.Location, nextPageTokenstring, errerror)// contains filtered or unexported fields}LocationIterator manages a stream of *locationpb.Location.
func (*LocationIterator)All¶added inv0.2.0
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¶
func (it *LocationIterator) Next() (*locationpb.Location,error)
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 thegoogle.golang.org/api/iterator package for details.
typeOperationIterator¶
type OperationIterator struct {// 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.Response interface{}// 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.InternalFetch func(pageSizeint, pageTokenstring) (results []*longrunningpb.Operation, nextPageTokenstring, errerror)// contains filtered or unexported fields}OperationIterator manages a stream of *longrunningpb.Operation.
func (*OperationIterator)All¶added inv0.2.0
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¶
func (it *OperationIterator) Next() (*longrunningpb.Operation,error)
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 thegoogle.golang.org/api/iterator package for details.
typeRevokeGrantOperation¶
type RevokeGrantOperation struct {// contains filtered or unexported fields}RevokeGrantOperation manages a long-running operation from RevokeGrant.
func (*RevokeGrantOperation)Done¶
func (op *RevokeGrantOperation) Done()bool
Done reports whether the long-running operation has completed.
func (*RevokeGrantOperation)Metadata¶
func (op *RevokeGrantOperation) Metadata() (*privilegedaccessmanagerpb.OperationMetadata,error)
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¶
func (op *RevokeGrantOperation) Name()string
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¶
func (op *RevokeGrantOperation) Poll(ctxcontext.Context, opts ...gax.CallOption) (*privilegedaccessmanagerpb.Grant,error)
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¶
func (op *RevokeGrantOperation) Wait(ctxcontext.Context, opts ...gax.CallOption) (*privilegedaccessmanagerpb.Grant,error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
typeUpdateEntitlementOperation¶
type UpdateEntitlementOperation struct {// contains filtered or unexported fields}UpdateEntitlementOperation manages a long-running operation from UpdateEntitlement.
func (*UpdateEntitlementOperation)Done¶
func (op *UpdateEntitlementOperation) Done()bool
Done reports whether the long-running operation has completed.
func (*UpdateEntitlementOperation)Metadata¶
func (op *UpdateEntitlementOperation) Metadata() (*privilegedaccessmanagerpb.OperationMetadata,error)
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¶
func (op *UpdateEntitlementOperation) Name()string
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¶
func (op *UpdateEntitlementOperation) Poll(ctxcontext.Context, opts ...gax.CallOption) (*privilegedaccessmanagerpb.Entitlement,error)
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¶
func (op *UpdateEntitlementOperation) Wait(ctxcontext.Context, opts ...gax.CallOption) (*privilegedaccessmanagerpb.Entitlement,error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.