Cloud Controls Partner API v1 - Package cloud.google.com/go/cloudcontrolspartner/apiv1 (v1.4.0)

Package cloudcontrolspartner is an auto-generated package for the Cloud Controls Partner API.

Provides insights about your customers and their Assured Workloads based on your Sovereign Controls by Partners offering.

General documentation

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

Example usage

To get started with this package, create a client.

 // go get cloud.google.com/go/cloudcontrolspartner/apiv1@latest 
 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_Options 
 c 
 , 
  
 err 
  
 := 
  
 cloudcontrolspartner 
 . 
 NewCloudControlsPartnerCoreClient 
 ( 
 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 
  
 := 
  
& cloudcontrolspartnerpb 
 . 
 CreateCustomerRequest 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/cloud.google.com/go/cloudcontrolspartner/apiv1/cloudcontrolspartnerpb#CreateCustomerRequest. 
 } 
 resp 
 , 
  
 err 
  
 := 
  
 c 
 . 
 CreateCustomer 
 ( 
 ctx 
 , 
  
 req 
 ) 
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
 } 
 // TODO: Use resp. 
 _ 
  
 = 
  
 resp 

Use of Context

The ctx passed to NewCloudControlsPartnerCoreClient is used for authentication requests and for 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

  func 
  
 DefaultAuthScopes 
 () 
  
 [] 
  string 
 
 

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

AccessApprovalRequestIterator

  type 
  
 AccessApprovalRequestIterator 
  
 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 
 ( 
 pageSize 
  
  int 
 
 , 
  
 pageToken 
  
  string 
 
 ) 
  
 ( 
 results 
  
 [] 
 * 
  cloudcontrolspartnerpb 
 
 . 
  AccessApprovalRequest 
 
 , 
  
 nextPageToken 
  
  string 
 
 , 
  
 err 
  
  error 
 
 ) 
  
 // contains filtered or unexported fields 
 } 
 

AccessApprovalRequestIterator manages a stream of *cloudcontrolspartnerpb.AccessApprovalRequest.

func (*AccessApprovalRequestIterator) All

  func 
  
 ( 
 it 
  
 * 
  AccessApprovalRequestIterator 
 
 ) 
  
 All 
 () 
  
 iter 
 . 
 Seq2 
 [ 
 * 
 cloudcontrolspartnerpb 
 . 
 AccessApprovalRequest 
 , 
  
 error 
 ] 
 

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

func (*AccessApprovalRequestIterator) Next

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

func (*AccessApprovalRequestIterator) PageInfo

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

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

CloudControlsPartnerCoreCallOptions

  type 
  
 CloudControlsPartnerCoreCallOptions 
  
 struct 
  
 { 
  
 GetWorkload 
  
 [] 
  gax 
 
 . 
  CallOption 
 
  
 ListWorkloads 
  
 [] 
  gax 
 
 . 
  CallOption 
 
  
 GetCustomer 
  
 [] 
  gax 
 
 . 
  CallOption 
 
  
 ListCustomers 
  
 [] 
  gax 
 
 . 
  CallOption 
 
  
 GetEkmConnections 
  
 [] 
  gax 
 
 . 
  CallOption 
 
  
 GetPartnerPermissions 
  
 [] 
  gax 
 
 . 
  CallOption 
 
  
 ListAccessApprovalRequests 
  
 [] 
  gax 
 
 . 
  CallOption 
 
  
 GetPartner 
  
 [] 
  gax 
 
 . 
  CallOption 
 
  
 CreateCustomer 
  
 [] 
  gax 
 
 . 
  CallOption 
 
  
 UpdateCustomer 
  
 [] 
  gax 
 
 . 
  CallOption 
 
  
 DeleteCustomer 
  
 [] 
  gax 
 
 . 
  CallOption 
 
 } 
 

CloudControlsPartnerCoreCallOptions contains the retry settings for each method of CloudControlsPartnerCoreClient.

CloudControlsPartnerCoreClient

  type 
  
 CloudControlsPartnerCoreClient 
  
 struct 
  
 { 
  
 // The call options for this service. 
  
 CallOptions 
  
 * 
  CloudControlsPartnerCoreCallOptions 
 
  
 // contains filtered or unexported fields 
 } 
 

CloudControlsPartnerCoreClient is a client for interacting with Cloud Controls Partner API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

Service describing handlers for resources

func NewCloudControlsPartnerCoreClient

  func 
  
 NewCloudControlsPartnerCoreClient 
 ( 
 ctx 
  
  context 
 
 . 
  Context 
 
 , 
  
 opts 
  
 ... 
 option 
 . 
 ClientOption 
 ) 
  
 ( 
 * 
  CloudControlsPartnerCoreClient 
 
 , 
  
  error 
 
 ) 
 

NewCloudControlsPartnerCoreClient creates a new cloud controls partner core client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.

Service describing handlers for resources

Example

  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 cloudcontrolspartner 
  
 "cloud.google.com/go/cloudcontrolspartner/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_Options 
  
 c 
 , 
  
 err 
  
 := 
  
 cloudcontrolspartner 
 . 
 NewCloudControlsPartnerCoreClient 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
 Close 
 () 
  
 // TODO: Use client. 
  
 _ 
  
 = 
  
 c 
 } 
 

func NewCloudControlsPartnerCoreRESTClient

  func 
  
 NewCloudControlsPartnerCoreRESTClient 
 ( 
 ctx 
  
  context 
 
 . 
  Context 
 
 , 
  
 opts 
  
 ... 
 option 
 . 
 ClientOption 
 ) 
  
 ( 
 * 
  CloudControlsPartnerCoreClient 
 
 , 
  
  error 
 
 ) 
 

NewCloudControlsPartnerCoreRESTClient creates a new cloud controls partner core rest client.

Service describing handlers for resources

Example

  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 cloudcontrolspartner 
  
 "cloud.google.com/go/cloudcontrolspartner/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_Options 
  
 c 
 , 
  
 err 
  
 := 
  
 cloudcontrolspartner 
 . 
  NewCloudControlsPartnerCoreRESTClient 
 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
 Close 
 () 
  
 // TODO: Use client. 
  
 _ 
  
 = 
  
 c 
 } 
 

func (*CloudControlsPartnerCoreClient) Close

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

func (*CloudControlsPartnerCoreClient) Connection (deprecated)

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

Connection returns a connection to the API service.

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

func (*CloudControlsPartnerCoreClient) CreateCustomer

CreateCustomer creates a new customer.

Example

  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 cloudcontrolspartner 
  
 "cloud.google.com/go/cloudcontrolspartner/apiv1" 
  
 cloudcontrolspartnerpb 
  
 "cloud.google.com/go/cloudcontrolspartner/apiv1/cloudcontrolspartnerpb" 
 ) 
 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_Options 
  
 c 
 , 
  
 err 
  
 := 
  
 cloudcontrolspartner 
 . 
 NewCloudControlsPartnerCoreClient 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
 Close 
 () 
  
 req 
  
 := 
  
& cloudcontrolspartnerpb 
 . 
  CreateCustomerRequest 
 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/cloud.google.com/go/cloudcontrolspartner/apiv1/cloudcontrolspartnerpb#CreateCustomerRequest. 
  
 } 
  
 resp 
 , 
  
 err 
  
 := 
  
 c 
 . 
 CreateCustomer 
 ( 
 ctx 
 , 
  
 req 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 // TODO: Use resp. 
  
 _ 
  
 = 
  
 resp 
 } 
 

func (*CloudControlsPartnerCoreClient) DeleteCustomer

DeleteCustomer delete details of a single customer

Example

  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 cloudcontrolspartner 
  
 "cloud.google.com/go/cloudcontrolspartner/apiv1" 
  
 cloudcontrolspartnerpb 
  
 "cloud.google.com/go/cloudcontrolspartner/apiv1/cloudcontrolspartnerpb" 
 ) 
 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_Options 
  
 c 
 , 
  
 err 
  
 := 
  
 cloudcontrolspartner 
 . 
 NewCloudControlsPartnerCoreClient 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
 Close 
 () 
  
 req 
  
 := 
  
& cloudcontrolspartnerpb 
 . 
  DeleteCustomerRequest 
 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/cloud.google.com/go/cloudcontrolspartner/apiv1/cloudcontrolspartnerpb#DeleteCustomerRequest. 
  
 } 
  
 err 
  
 = 
  
 c 
 . 
 DeleteCustomer 
 ( 
 ctx 
 , 
  
 req 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
 } 
 

func (*CloudControlsPartnerCoreClient) GetCustomer

GetCustomer gets details of a single customer

Example

  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 cloudcontrolspartner 
  
 "cloud.google.com/go/cloudcontrolspartner/apiv1" 
  
 cloudcontrolspartnerpb 
  
 "cloud.google.com/go/cloudcontrolspartner/apiv1/cloudcontrolspartnerpb" 
 ) 
 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_Options 
  
 c 
 , 
  
 err 
  
 := 
  
 cloudcontrolspartner 
 . 
 NewCloudControlsPartnerCoreClient 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
 Close 
 () 
  
 req 
  
 := 
  
& cloudcontrolspartnerpb 
 . 
 GetCustomerRequest 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/cloud.google.com/go/cloudcontrolspartner/apiv1/cloudcontrolspartnerpb#GetCustomerRequest. 
  
 } 
  
 resp 
 , 
  
 err 
  
 := 
  
 c 
 . 
 GetCustomer 
 ( 
 ctx 
 , 
  
 req 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 // TODO: Use resp. 
  
 _ 
  
 = 
  
 resp 
 } 
 

func (*CloudControlsPartnerCoreClient) GetEkmConnections

GetEkmConnections gets the EKM connections associated with a workload

Example

  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 cloudcontrolspartner 
  
 "cloud.google.com/go/cloudcontrolspartner/apiv1" 
  
 cloudcontrolspartnerpb 
  
 "cloud.google.com/go/cloudcontrolspartner/apiv1/cloudcontrolspartnerpb" 
 ) 
 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_Options 
  
 c 
 , 
  
 err 
  
 := 
  
 cloudcontrolspartner 
 . 
 NewCloudControlsPartnerCoreClient 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
 Close 
 () 
  
 req 
  
 := 
  
& cloudcontrolspartnerpb 
 . 
 GetEkmConnectionsRequest 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/cloud.google.com/go/cloudcontrolspartner/apiv1/cloudcontrolspartnerpb#GetEkmConnectionsRequest. 
  
 } 
  
 resp 
 , 
  
 err 
  
 := 
  
 c 
 . 
 GetEkmConnections 
 ( 
 ctx 
 , 
  
 req 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 // TODO: Use resp. 
  
 _ 
  
 = 
  
 resp 
 } 
 

func (*CloudControlsPartnerCoreClient) GetPartner

GetPartner get details of a Partner.

Example

  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 cloudcontrolspartner 
  
 "cloud.google.com/go/cloudcontrolspartner/apiv1" 
  
 cloudcontrolspartnerpb 
  
 "cloud.google.com/go/cloudcontrolspartner/apiv1/cloudcontrolspartnerpb" 
 ) 
 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_Options 
  
 c 
 , 
  
 err 
  
 := 
  
 cloudcontrolspartner 
 . 
 NewCloudControlsPartnerCoreClient 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
 Close 
 () 
  
 req 
  
 := 
  
& cloudcontrolspartnerpb 
 . 
 GetPartnerRequest 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/cloud.google.com/go/cloudcontrolspartner/apiv1/cloudcontrolspartnerpb#GetPartnerRequest. 
  
 } 
  
 resp 
 , 
  
 err 
  
 := 
  
 c 
 . 
 GetPartner 
 ( 
 ctx 
 , 
  
 req 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 // TODO: Use resp. 
  
 _ 
  
 = 
  
 resp 
 } 
 

func (*CloudControlsPartnerCoreClient) GetPartnerPermissions

GetPartnerPermissions gets the partner permissions granted for a workload

Example

  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 cloudcontrolspartner 
  
 "cloud.google.com/go/cloudcontrolspartner/apiv1" 
  
 cloudcontrolspartnerpb 
  
 "cloud.google.com/go/cloudcontrolspartner/apiv1/cloudcontrolspartnerpb" 
 ) 
 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_Options 
  
 c 
 , 
  
 err 
  
 := 
  
 cloudcontrolspartner 
 . 
 NewCloudControlsPartnerCoreClient 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
 Close 
 () 
  
 req 
  
 := 
  
& cloudcontrolspartnerpb 
 . 
 GetPartnerPermissionsRequest 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/cloud.google.com/go/cloudcontrolspartner/apiv1/cloudcontrolspartnerpb#GetPartnerPermissionsRequest. 
  
 } 
  
 resp 
 , 
  
 err 
  
 := 
  
 c 
 . 
 GetPartnerPermissions 
 ( 
 ctx 
 , 
  
 req 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 // TODO: Use resp. 
  
 _ 
  
 = 
  
 resp 
 } 
 

func (*CloudControlsPartnerCoreClient) GetWorkload

GetWorkload gets details of a single workload

Example

  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 cloudcontrolspartner 
  
 "cloud.google.com/go/cloudcontrolspartner/apiv1" 
  
 cloudcontrolspartnerpb 
  
 "cloud.google.com/go/cloudcontrolspartner/apiv1/cloudcontrolspartnerpb" 
 ) 
 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_Options 
  
 c 
 , 
  
 err 
  
 := 
  
 cloudcontrolspartner 
 . 
 NewCloudControlsPartnerCoreClient 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
 Close 
 () 
  
 req 
  
 := 
  
& cloudcontrolspartnerpb 
 . 
 GetWorkloadRequest 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/cloud.google.com/go/cloudcontrolspartner/apiv1/cloudcontrolspartnerpb#GetWorkloadRequest. 
  
 } 
  
 resp 
 , 
  
 err 
  
 := 
  
 c 
 . 
 GetWorkload 
 ( 
 ctx 
 , 
  
 req 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 // TODO: Use resp. 
  
 _ 
  
 = 
  
 resp 
 } 
 

func (*CloudControlsPartnerCoreClient) ListAccessApprovalRequests (deprecated)

ListAccessApprovalRequests deprecated: Only returns access approval requests directly associated with an assured workload folder.

Deprecated: ListAccessApprovalRequests may be removed in a future version.

Examples

  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 cloudcontrolspartner 
  
 "cloud.google.com/go/cloudcontrolspartner/apiv1" 
  
 cloudcontrolspartnerpb 
  
 "cloud.google.com/go/cloudcontrolspartner/apiv1/cloudcontrolspartnerpb" 
  
 "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_Options 
  
 c 
 , 
  
 err 
  
 := 
  
 cloudcontrolspartner 
 . 
 NewCloudControlsPartnerCoreClient 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
 Close 
 () 
  
 req 
  
 := 
  
& cloudcontrolspartnerpb 
 . 
 ListAccessApprovalRequestsRequest 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/cloud.google.com/go/cloudcontrolspartner/apiv1/cloudcontrolspartnerpb#ListAccessApprovalRequestsRequest. 
  
 } 
  
 it 
  
 := 
  
 c 
 . 
 ListAccessApprovalRequests 
 ( 
 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 
 .( 
 * 
 cloudcontrolspartnerpb 
 . 
 ListAccessApprovalRequestsResponse 
 ) 
  
 } 
 } 
 
all
  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 cloudcontrolspartner 
  
 "cloud.google.com/go/cloudcontrolspartner/apiv1" 
  
 cloudcontrolspartnerpb 
  
 "cloud.google.com/go/cloudcontrolspartner/apiv1/cloudcontrolspartnerpb" 
 ) 
 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_Options 
  
 c 
 , 
  
 err 
  
 := 
  
 cloudcontrolspartner 
 . 
 NewCloudControlsPartnerCoreClient 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
 Close 
 () 
  
 req 
  
 := 
  
& cloudcontrolspartnerpb 
 . 
 ListAccessApprovalRequestsRequest 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/cloud.google.com/go/cloudcontrolspartner/apiv1/cloudcontrolspartnerpb#ListAccessApprovalRequestsRequest. 
  
 } 
  
 for 
  
 resp 
 , 
  
 err 
  
 := 
  
 range 
  
 c 
 . 
 ListAccessApprovalRequests 
 ( 
 ctx 
 , 
  
 req 
 ). 
 All 
 () 
  
 { 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error and break/return/continue. Iteration will stop after any error. 
  
 } 
  
 // TODO: Use resp. 
  
 _ 
  
 = 
  
 resp 
  
 } 
 } 
 

func (*CloudControlsPartnerCoreClient) ListCustomers

ListCustomers lists customers of a partner identified by its Google Cloud organization ID

Examples

  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 cloudcontrolspartner 
  
 "cloud.google.com/go/cloudcontrolspartner/apiv1" 
  
 cloudcontrolspartnerpb 
  
 "cloud.google.com/go/cloudcontrolspartner/apiv1/cloudcontrolspartnerpb" 
  
 "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_Options 
  
 c 
 , 
  
 err 
  
 := 
  
 cloudcontrolspartner 
 . 
 NewCloudControlsPartnerCoreClient 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
 Close 
 () 
  
 req 
  
 := 
  
& cloudcontrolspartnerpb 
 . 
 ListCustomersRequest 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/cloud.google.com/go/cloudcontrolspartner/apiv1/cloudcontrolspartnerpb#ListCustomersRequest. 
  
 } 
  
 it 
  
 := 
  
 c 
 . 
 ListCustomers 
 ( 
 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 
 .( 
 * 
 cloudcontrolspartnerpb 
 . 
 ListCustomersResponse 
 ) 
  
 } 
 } 
 
all
  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 cloudcontrolspartner 
  
 "cloud.google.com/go/cloudcontrolspartner/apiv1" 
  
 cloudcontrolspartnerpb 
  
 "cloud.google.com/go/cloudcontrolspartner/apiv1/cloudcontrolspartnerpb" 
 ) 
 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_Options 
  
 c 
 , 
  
 err 
  
 := 
  
 cloudcontrolspartner 
 . 
 NewCloudControlsPartnerCoreClient 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
 Close 
 () 
  
 req 
  
 := 
  
& cloudcontrolspartnerpb 
 . 
 ListCustomersRequest 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/cloud.google.com/go/cloudcontrolspartner/apiv1/cloudcontrolspartnerpb#ListCustomersRequest. 
  
 } 
  
 for 
  
 resp 
 , 
  
 err 
  
 := 
  
 range 
  
 c 
 . 
 ListCustomers 
 ( 
 ctx 
 , 
  
 req 
 ). 
 All 
 () 
  
 { 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error and break/return/continue. Iteration will stop after any error. 
  
 } 
  
 // TODO: Use resp. 
  
 _ 
  
 = 
  
 resp 
  
 } 
 } 
 

func (*CloudControlsPartnerCoreClient) ListWorkloads

ListWorkloads lists customer workloads for a given customer org id

Examples

  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 cloudcontrolspartner 
  
 "cloud.google.com/go/cloudcontrolspartner/apiv1" 
  
 cloudcontrolspartnerpb 
  
 "cloud.google.com/go/cloudcontrolspartner/apiv1/cloudcontrolspartnerpb" 
  
 "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_Options 
  
 c 
 , 
  
 err 
  
 := 
  
 cloudcontrolspartner 
 . 
 NewCloudControlsPartnerCoreClient 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
 Close 
 () 
  
 req 
  
 := 
  
& cloudcontrolspartnerpb 
 . 
 ListWorkloadsRequest 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/cloud.google.com/go/cloudcontrolspartner/apiv1/cloudcontrolspartnerpb#ListWorkloadsRequest. 
  
 } 
  
 it 
  
 := 
  
 c 
 . 
 ListWorkloads 
 ( 
 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 
 .( 
 * 
 cloudcontrolspartnerpb 
 . 
 ListWorkloadsResponse 
 ) 
  
 } 
 } 
 
all
  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 cloudcontrolspartner 
  
 "cloud.google.com/go/cloudcontrolspartner/apiv1" 
  
 cloudcontrolspartnerpb 
  
 "cloud.google.com/go/cloudcontrolspartner/apiv1/cloudcontrolspartnerpb" 
 ) 
 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_Options 
  
 c 
 , 
  
 err 
  
 := 
  
 cloudcontrolspartner 
 . 
 NewCloudControlsPartnerCoreClient 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
 Close 
 () 
  
 req 
  
 := 
  
& cloudcontrolspartnerpb 
 . 
 ListWorkloadsRequest 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/cloud.google.com/go/cloudcontrolspartner/apiv1/cloudcontrolspartnerpb#ListWorkloadsRequest. 
  
 } 
  
 for 
  
 resp 
 , 
  
 err 
  
 := 
  
 range 
  
 c 
 . 
 ListWorkloads 
 ( 
 ctx 
 , 
  
 req 
 ). 
 All 
 () 
  
 { 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error and break/return/continue. Iteration will stop after any error. 
  
 } 
  
 // TODO: Use resp. 
  
 _ 
  
 = 
  
 resp 
  
 } 
 } 
 

func (*CloudControlsPartnerCoreClient) UpdateCustomer

UpdateCustomer update details of a single customer

Example

  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 cloudcontrolspartner 
  
 "cloud.google.com/go/cloudcontrolspartner/apiv1" 
  
 cloudcontrolspartnerpb 
  
 "cloud.google.com/go/cloudcontrolspartner/apiv1/cloudcontrolspartnerpb" 
 ) 
 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_Options 
  
 c 
 , 
  
 err 
  
 := 
  
 cloudcontrolspartner 
 . 
 NewCloudControlsPartnerCoreClient 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
 Close 
 () 
  
 req 
  
 := 
  
& cloudcontrolspartnerpb 
 . 
  UpdateCustomerRequest 
 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/cloud.google.com/go/cloudcontrolspartner/apiv1/cloudcontrolspartnerpb#UpdateCustomerRequest. 
  
 } 
  
 resp 
 , 
  
 err 
  
 := 
  
 c 
 . 
 UpdateCustomer 
 ( 
 ctx 
 , 
  
 req 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 // TODO: Use resp. 
  
 _ 
  
 = 
  
 resp 
 } 
 

CloudControlsPartnerMonitoringCallOptions

  type 
  
 CloudControlsPartnerMonitoringCallOptions 
  
 struct 
  
 { 
  
 ListViolations 
  
 [] 
  gax 
 
 . 
  CallOption 
 
  
 GetViolation 
  
 [] 
  gax 
 
 . 
  CallOption 
 
 } 
 

CloudControlsPartnerMonitoringCallOptions contains the retry settings for each method of CloudControlsPartnerMonitoringClient.

CloudControlsPartnerMonitoringClient

  type 
  
 CloudControlsPartnerMonitoringClient 
  
 struct 
  
 { 
  
 // The call options for this service. 
  
 CallOptions 
  
 * 
  CloudControlsPartnerMonitoringCallOptions 
 
  
 // contains filtered or unexported fields 
 } 
 

CloudControlsPartnerMonitoringClient is a client for interacting with Cloud Controls Partner API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

Service describing handlers for resources

func NewCloudControlsPartnerMonitoringClient

  func 
  
 NewCloudControlsPartnerMonitoringClient 
 ( 
 ctx 
  
  context 
 
 . 
  Context 
 
 , 
  
 opts 
  
 ... 
 option 
 . 
 ClientOption 
 ) 
  
 ( 
 * 
  CloudControlsPartnerMonitoringClient 
 
 , 
  
  error 
 
 ) 
 

NewCloudControlsPartnerMonitoringClient creates a new cloud controls partner monitoring client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.

Service describing handlers for resources

Example

  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 cloudcontrolspartner 
  
 "cloud.google.com/go/cloudcontrolspartner/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_Options 
  
 c 
 , 
  
 err 
  
 := 
  
 cloudcontrolspartner 
 . 
 NewCloudControlsPartnerMonitoringClient 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
 Close 
 () 
  
 // TODO: Use client. 
  
 _ 
  
 = 
  
 c 
 } 
 

func NewCloudControlsPartnerMonitoringRESTClient

  func 
  
 NewCloudControlsPartnerMonitoringRESTClient 
 ( 
 ctx 
  
  context 
 
 . 
  Context 
 
 , 
  
 opts 
  
 ... 
 option 
 . 
 ClientOption 
 ) 
  
 ( 
 * 
  CloudControlsPartnerMonitoringClient 
 
 , 
  
  error 
 
 ) 
 

NewCloudControlsPartnerMonitoringRESTClient creates a new cloud controls partner monitoring rest client.

Service describing handlers for resources

Example

  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 cloudcontrolspartner 
  
 "cloud.google.com/go/cloudcontrolspartner/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_Options 
  
 c 
 , 
  
 err 
  
 := 
  
 cloudcontrolspartner 
 . 
  NewCloudControlsPartnerMonitoringRESTClient 
 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
 Close 
 () 
  
 // TODO: Use client. 
  
 _ 
  
 = 
  
 c 
 } 
 

func (*CloudControlsPartnerMonitoringClient) Close

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

func (*CloudControlsPartnerMonitoringClient) Connection (deprecated)

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

Connection returns a connection to the API service.

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

func (*CloudControlsPartnerMonitoringClient) GetViolation

GetViolation gets details of a single Violation.

Example

  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 cloudcontrolspartner 
  
 "cloud.google.com/go/cloudcontrolspartner/apiv1" 
  
 cloudcontrolspartnerpb 
  
 "cloud.google.com/go/cloudcontrolspartner/apiv1/cloudcontrolspartnerpb" 
 ) 
 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_Options 
  
 c 
 , 
  
 err 
  
 := 
  
 cloudcontrolspartner 
 . 
 NewCloudControlsPartnerMonitoringClient 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
 Close 
 () 
  
 req 
  
 := 
  
& cloudcontrolspartnerpb 
 . 
 GetViolationRequest 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/cloud.google.com/go/cloudcontrolspartner/apiv1/cloudcontrolspartnerpb#GetViolationRequest. 
  
 } 
  
 resp 
 , 
  
 err 
  
 := 
  
 c 
 . 
 GetViolation 
 ( 
 ctx 
 , 
  
 req 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 // TODO: Use resp. 
  
 _ 
  
 = 
  
 resp 
 } 
 

func (*CloudControlsPartnerMonitoringClient) ListViolations

ListViolations lists Violations for a workload Callers may also choose to read across multiple Customers or for a single customer as per AIP-159 (at https://google.aip.dev/159 ) by using ‘-’ (the hyphen or dash character) as a wildcard character instead of {customer} & {workload}. Format: organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}

Examples

  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 cloudcontrolspartner 
  
 "cloud.google.com/go/cloudcontrolspartner/apiv1" 
  
 cloudcontrolspartnerpb 
  
 "cloud.google.com/go/cloudcontrolspartner/apiv1/cloudcontrolspartnerpb" 
  
 "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_Options 
  
 c 
 , 
  
 err 
  
 := 
  
 cloudcontrolspartner 
 . 
 NewCloudControlsPartnerMonitoringClient 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
 Close 
 () 
  
 req 
  
 := 
  
& cloudcontrolspartnerpb 
 . 
 ListViolationsRequest 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/cloud.google.com/go/cloudcontrolspartner/apiv1/cloudcontrolspartnerpb#ListViolationsRequest. 
  
 } 
  
 it 
  
 := 
  
 c 
 . 
 ListViolations 
 ( 
 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 
 .( 
 * 
 cloudcontrolspartnerpb 
 . 
 ListViolationsResponse 
 ) 
  
 } 
 } 
 
all
  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 cloudcontrolspartner 
  
 "cloud.google.com/go/cloudcontrolspartner/apiv1" 
  
 cloudcontrolspartnerpb 
  
 "cloud.google.com/go/cloudcontrolspartner/apiv1/cloudcontrolspartnerpb" 
 ) 
 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_Options 
  
 c 
 , 
  
 err 
  
 := 
  
 cloudcontrolspartner 
 . 
 NewCloudControlsPartnerMonitoringClient 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
 Close 
 () 
  
 req 
  
 := 
  
& cloudcontrolspartnerpb 
 . 
 ListViolationsRequest 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/cloud.google.com/go/cloudcontrolspartner/apiv1/cloudcontrolspartnerpb#ListViolationsRequest. 
  
 } 
  
 for 
  
 resp 
 , 
  
 err 
  
 := 
  
 range 
  
 c 
 . 
 ListViolations 
 ( 
 ctx 
 , 
  
 req 
 ). 
 All 
 () 
  
 { 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error and break/return/continue. Iteration will stop after any error. 
  
 } 
  
 // TODO: Use resp. 
  
 _ 
  
 = 
  
 resp 
  
 } 
 } 
 

CustomerIterator

  type 
  
 CustomerIterator 
  
 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 
 ( 
 pageSize 
  
  int 
 
 , 
  
 pageToken 
  
  string 
 
 ) 
  
 ( 
 results 
  
 [] 
 * 
  cloudcontrolspartnerpb 
 
 . 
  Customer 
 
 , 
  
 nextPageToken 
  
  string 
 
 , 
  
 err 
  
  error 
 
 ) 
  
 // contains filtered or unexported fields 
 } 
 

CustomerIterator manages a stream of *cloudcontrolspartnerpb.Customer.

func (*CustomerIterator) All

  func 
  
 ( 
 it 
  
 * 
  CustomerIterator 
 
 ) 
  
 All 
 () 
  
 iter 
 . 
 Seq2 
 [ 
 * 
 cloudcontrolspartnerpb 
 . 
 Customer 
 , 
  
 error 
 ] 
 

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

func (*CustomerIterator) Next

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

func (*CustomerIterator) PageInfo

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

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

ViolationIterator

  type 
  
 ViolationIterator 
  
 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 
 ( 
 pageSize 
  
  int 
 
 , 
  
 pageToken 
  
  string 
 
 ) 
  
 ( 
 results 
  
 [] 
 * 
  cloudcontrolspartnerpb 
 
 . 
  Violation 
 
 , 
  
 nextPageToken 
  
  string 
 
 , 
  
 err 
  
  error 
 
 ) 
  
 // contains filtered or unexported fields 
 } 
 

ViolationIterator manages a stream of *cloudcontrolspartnerpb.Violation.

func (*ViolationIterator) All

  func 
  
 ( 
 it 
  
 * 
  ViolationIterator 
 
 ) 
  
 All 
 () 
  
 iter 
 . 
 Seq2 
 [ 
 * 
 cloudcontrolspartnerpb 
 . 
 Violation 
 , 
  
 error 
 ] 
 

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

func (*ViolationIterator) Next

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

func (*ViolationIterator) PageInfo

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

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

WorkloadIterator

  type 
  
 WorkloadIterator 
  
 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 
 ( 
 pageSize 
  
  int 
 
 , 
  
 pageToken 
  
  string 
 
 ) 
  
 ( 
 results 
  
 [] 
 * 
  cloudcontrolspartnerpb 
 
 . 
  Workload 
 
 , 
  
 nextPageToken 
  
  string 
 
 , 
  
 err 
  
  error 
 
 ) 
  
 // contains filtered or unexported fields 
 } 
 

WorkloadIterator manages a stream of *cloudcontrolspartnerpb.Workload.

func (*WorkloadIterator) All

  func 
  
 ( 
 it 
  
 * 
  WorkloadIterator 
 
 ) 
  
 All 
 () 
  
 iter 
 . 
 Seq2 
 [ 
 * 
 cloudcontrolspartnerpb 
 . 
 Workload 
 , 
  
 error 
 ] 
 

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

func (*WorkloadIterator) Next

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

func (*WorkloadIterator) PageInfo

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

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

Create a Mobile Website
View Site in Mobile | Classic
Share by: