Secure Source Manager API v1 - Package cloud.google.com/go/securesourcemanager/apiv1 (v1.3.3)

Package securesourcemanager is an auto-generated package for the Secure Source Manager API.

Regionally deployed, single-tenant managed source code repository hosted on Google Cloud.

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/securesourcemanager/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 
  
 := 
  
 securesourcemanager 
 . 
 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 
  
 := 
  
& securesourcemanagerpb 
 . 
 CreateBranchRuleRequest 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/cloud.google.com/go/securesourcemanager/apiv1/securesourcemanagerpb#CreateBranchRuleRequest. 
 } 
 op 
 , 
  
 err 
  
 := 
  
 c 
 . 
 CreateBranchRule 
 ( 
 ctx 
 , 
  
 req 
 ) 
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
 } 
 resp 
 , 
  
 err 
  
 := 
  
 op 
 . 
 Wait 
 ( 
 ctx 
 ) 
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
 } 
 // TODO: Use resp. 
 _ 
  
 = 
  
 resp 

Use of Context

The ctx passed to NewClient 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.

BranchRuleIterator

  type 
  
 BranchRuleIterator 
  
 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 
  
 [] 
 * 
  securesourcemanagerpb 
 
 . 
  BranchRule 
 
 , 
  
 nextPageToken 
  
  string 
 
 , 
  
 err 
  
  error 
 
 ) 
  
 // contains filtered or unexported fields 
 } 
 

BranchRuleIterator manages a stream of *securesourcemanagerpb.BranchRule.

func (*BranchRuleIterator) All

  func 
  
 ( 
 it 
  
 * 
  BranchRuleIterator 
 
 ) 
  
 All 
 () 
  
 iter 
 . 
 Seq2 
 [ 
 * 
 securesourcemanagerpb 
 . 
 BranchRule 
 , 
  
 error 
 ] 
 

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

func (*BranchRuleIterator) 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 (*BranchRuleIterator) PageInfo

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

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

CallOptions

  type 
  
 CallOptions 
  
 struct 
  
 { 
  
 ListInstances 
  
 [] 
  gax 
 
 . 
  CallOption 
 
  
 GetInstance 
  
 [] 
  gax 
 
 . 
  CallOption 
 
  
 CreateInstance 
  
 [] 
  gax 
 
 . 
  CallOption 
 
  
 DeleteInstance 
  
 [] 
  gax 
 
 . 
  CallOption 
 
  
 ListRepositories 
  
 [] 
  gax 
 
 . 
  CallOption 
 
  
 GetRepository 
  
 [] 
  gax 
 
 . 
  CallOption 
 
  
 CreateRepository 
  
 [] 
  gax 
 
 . 
  CallOption 
 
  
 DeleteRepository 
  
 [] 
  gax 
 
 . 
  CallOption 
 
  
 GetIamPolicyRepo 
  
 [] 
  gax 
 
 . 
  CallOption 
 
  
 SetIamPolicyRepo 
  
 [] 
  gax 
 
 . 
  CallOption 
 
  
 TestIamPermissionsRepo 
  
 [] 
  gax 
 
 . 
  CallOption 
 
  
 CreateBranchRule 
  
 [] 
  gax 
 
 . 
  CallOption 
 
  
 ListBranchRules 
  
 [] 
  gax 
 
 . 
  CallOption 
 
  
 GetBranchRule 
  
 [] 
  gax 
 
 . 
  CallOption 
 
  
 UpdateBranchRule 
  
 [] 
  gax 
 
 . 
  CallOption 
 
  
 DeleteBranchRule 
  
 [] 
  gax 
 
 . 
  CallOption 
 
  
 GetLocation 
  
 [] 
  gax 
 
 . 
  CallOption 
 
  
 ListLocations 
  
 [] 
  gax 
 
 . 
  CallOption 
 
  
 GetIamPolicy 
  
 [] 
  gax 
 
 . 
  CallOption 
 
  
 SetIamPolicy 
  
 [] 
  gax 
 
 . 
  CallOption 
 
  
 TestIamPermissions 
  
 [] 
  gax 
 
 . 
  CallOption 
 
  
 CancelOperation 
  
 [] 
  gax 
 
 . 
  CallOption 
 
  
 DeleteOperation 
  
 [] 
  gax 
 
 . 
  CallOption 
 
  
 GetOperation 
  
 [] 
  gax 
 
 . 
  CallOption 
 
  
 ListOperations 
  
 [] 
  gax 
 
 . 
  CallOption 
 
 } 
 

CallOptions contains the retry settings for each method of Client.

Client

  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 Secure Source Manager API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

Secure Source Manager API

Access Secure Source Manager instances, resources, and repositories.

This API is split across two servers: the Control Plane and the Data Plane.

Data Plane endpoints are hosted directly by your Secure Source Manager instance, so you must connect to your instance’s API hostname to access them. The API hostname looks like the following:

For example,

Data Plane endpoints are denoted with Host: Data Plane.

All other endpoints are found in the normal Cloud API location, namely, securcesourcemanager.googleapis.com.

func NewClient

  func 
  
 NewClient 
 ( 
 ctx 
  
  context 
 
 . 
  Context 
 
 , 
  
 opts 
  
 ... 
 option 
 . 
 ClientOption 
 ) 
  
 ( 
 * 
  Client 
 
 , 
  
  error 
 
 ) 
 

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

Secure Source Manager API

Access Secure Source Manager instances, resources, and repositories.

This API is split across two servers: the Control Plane and the Data Plane.

Data Plane endpoints are hosted directly by your Secure Source Manager instance, so you must connect to your instance’s API hostname to access them. The API hostname looks like the following:

For example,

Data Plane endpoints are denoted with Host: Data Plane.

All other endpoints are found in the normal Cloud API location, namely, securcesourcemanager.googleapis.com.

Example

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

func NewRESTClient

  func 
  
 NewRESTClient 
 ( 
 ctx 
  
  context 
 
 . 
  Context 
 
 , 
  
 opts 
  
 ... 
 option 
 . 
 ClientOption 
 ) 
  
 ( 
 * 
  Client 
 
 , 
  
  error 
 
 ) 
 

NewRESTClient creates a new secure source manager rest client.

Secure Source Manager API

Access Secure Source Manager instances, resources, and repositories.

This API is split across two servers: the Control Plane and the Data Plane.

Data Plane endpoints are hosted directly by your Secure Source Manager instance, so you must connect to your instance’s API hostname to access them. The API hostname looks like the following:

For example,

Data Plane endpoints are denoted with Host: Data Plane.

All other endpoints are found in the normal Cloud API location, namely, securcesourcemanager.googleapis.com.

Example

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

func (*Client) CancelOperation

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

Example

  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 longrunningpb 
  
 "cloud.google.com/go/longrunning/autogen/longrunningpb" 
  
 securesourcemanager 
  
 "cloud.google.com/go/securesourcemanager/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 
  
 := 
  
 securesourcemanager 
 . 
  NewClient 
 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
  Close 
 
 () 
  
 req 
  
 := 
  
& longrunningpb 
 . 
  CancelOperationRequest 
 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest. 
  
 } 
  
 err 
  
 = 
  
 c 
 . 
 CancelOperation 
 ( 
 ctx 
 , 
  
 req 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
 } 
 

func (*Client) Close

  func 
  
 ( 
 c 
  
 * 
  Client 
 
 ) 
  
 Close 
 () 
  
  error 
 
 

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

func (*Client) Connection (deprecated)

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

Connection returns a connection to the API service.

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

func (*Client) CreateBranchRule

CreateBranchRule createBranchRule creates a branch rule in a given repository.

Example

  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 securesourcemanager 
  
 "cloud.google.com/go/securesourcemanager/apiv1" 
  
 securesourcemanagerpb 
  
 "cloud.google.com/go/securesourcemanager/apiv1/securesourcemanagerpb" 
 ) 
 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 
  
 := 
  
 securesourcemanager 
 . 
  NewClient 
 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
  Close 
 
 () 
  
 req 
  
 := 
  
& securesourcemanagerpb 
 . 
 CreateBranchRuleRequest 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/cloud.google.com/go/securesourcemanager/apiv1/securesourcemanagerpb#CreateBranchRuleRequest. 
  
 } 
  
 op 
 , 
  
 err 
  
 := 
  
 c 
 . 
 CreateBranchRule 
 ( 
 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) CreateBranchRuleOperation

  func 
  
 ( 
 c 
  
 * 
  Client 
 
 ) 
  
 CreateBranchRuleOperation 
 ( 
 name 
  
  string 
 
 ) 
  
 * 
  CreateBranchRuleOperation 
 
 

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

func (*Client) CreateInstance

CreateInstance creates a new instance in a given project and location.

Example

  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 securesourcemanager 
  
 "cloud.google.com/go/securesourcemanager/apiv1" 
  
 securesourcemanagerpb 
  
 "cloud.google.com/go/securesourcemanager/apiv1/securesourcemanagerpb" 
 ) 
 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 
  
 := 
  
 securesourcemanager 
 . 
  NewClient 
 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
  Close 
 
 () 
  
 req 
  
 := 
  
& securesourcemanagerpb 
 . 
 CreateInstanceRequest 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/cloud.google.com/go/securesourcemanager/apiv1/securesourcemanagerpb#CreateInstanceRequest. 
  
 } 
  
 op 
 , 
  
 err 
  
 := 
  
 c 
 . 
 CreateInstance 
 ( 
 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) CreateInstanceOperation

  func 
  
 ( 
 c 
  
 * 
  Client 
 
 ) 
  
 CreateInstanceOperation 
 ( 
 name 
  
  string 
 
 ) 
  
 * 
  CreateInstanceOperation 
 
 

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

func (*Client) CreateRepository

CreateRepository creates a new repository in a given project and location.

Host: Data Plane

Example

  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 securesourcemanager 
  
 "cloud.google.com/go/securesourcemanager/apiv1" 
  
 securesourcemanagerpb 
  
 "cloud.google.com/go/securesourcemanager/apiv1/securesourcemanagerpb" 
 ) 
 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 
  
 := 
  
 securesourcemanager 
 . 
  NewClient 
 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
  Close 
 
 () 
  
 req 
  
 := 
  
& securesourcemanagerpb 
 . 
 CreateRepositoryRequest 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/cloud.google.com/go/securesourcemanager/apiv1/securesourcemanagerpb#CreateRepositoryRequest. 
  
 } 
  
 op 
 , 
  
 err 
  
 := 
  
 c 
 . 
 CreateRepository 
 ( 
 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) CreateRepositoryOperation

  func 
  
 ( 
 c 
  
 * 
  Client 
 
 ) 
  
 CreateRepositoryOperation 
 ( 
 name 
  
  string 
 
 ) 
  
 * 
  CreateRepositoryOperation 
 
 

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

func (*Client) DeleteBranchRule

DeleteBranchRule deleteBranchRule deletes a branch rule.

Example

  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 securesourcemanager 
  
 "cloud.google.com/go/securesourcemanager/apiv1" 
  
 securesourcemanagerpb 
  
 "cloud.google.com/go/securesourcemanager/apiv1/securesourcemanagerpb" 
 ) 
 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 
  
 := 
  
 securesourcemanager 
 . 
  NewClient 
 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
  Close 
 
 () 
  
 req 
  
 := 
  
& securesourcemanagerpb 
 . 
 DeleteBranchRuleRequest 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/cloud.google.com/go/securesourcemanager/apiv1/securesourcemanagerpb#DeleteBranchRuleRequest. 
  
 } 
  
 op 
 , 
  
 err 
  
 := 
  
 c 
 . 
 DeleteBranchRule 
 ( 
 ctx 
 , 
  
 req 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 err 
  
 = 
  
 op 
 . 
 Wait 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
 } 
 

func (*Client) DeleteBranchRuleOperation

  func 
  
 ( 
 c 
  
 * 
  Client 
 
 ) 
  
 DeleteBranchRuleOperation 
 ( 
 name 
  
  string 
 
 ) 
  
 * 
  DeleteBranchRuleOperation 
 
 

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

func (*Client) DeleteInstance

DeleteInstance deletes a single instance.

Example

  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 securesourcemanager 
  
 "cloud.google.com/go/securesourcemanager/apiv1" 
  
 securesourcemanagerpb 
  
 "cloud.google.com/go/securesourcemanager/apiv1/securesourcemanagerpb" 
 ) 
 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 
  
 := 
  
 securesourcemanager 
 . 
  NewClient 
 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
  Close 
 
 () 
  
 req 
  
 := 
  
& securesourcemanagerpb 
 . 
 DeleteInstanceRequest 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/cloud.google.com/go/securesourcemanager/apiv1/securesourcemanagerpb#DeleteInstanceRequest. 
  
 } 
  
 op 
 , 
  
 err 
  
 := 
  
 c 
 . 
 DeleteInstance 
 ( 
 ctx 
 , 
  
 req 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 err 
  
 = 
  
 op 
 . 
 Wait 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
 } 
 

func (*Client) DeleteInstanceOperation

  func 
  
 ( 
 c 
  
 * 
  Client 
 
 ) 
  
 DeleteInstanceOperation 
 ( 
 name 
  
  string 
 
 ) 
  
 * 
  DeleteInstanceOperation 
 
 

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

func (*Client) DeleteOperation

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

Example

  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 longrunningpb 
  
 "cloud.google.com/go/longrunning/autogen/longrunningpb" 
  
 securesourcemanager 
  
 "cloud.google.com/go/securesourcemanager/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 
  
 := 
  
 securesourcemanager 
 . 
  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) DeleteRepository

DeleteRepository deletes a Repository.

Host: Data Plane

Example

  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 securesourcemanager 
  
 "cloud.google.com/go/securesourcemanager/apiv1" 
  
 securesourcemanagerpb 
  
 "cloud.google.com/go/securesourcemanager/apiv1/securesourcemanagerpb" 
 ) 
 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 
  
 := 
  
 securesourcemanager 
 . 
  NewClient 
 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
  Close 
 
 () 
  
 req 
  
 := 
  
& securesourcemanagerpb 
 . 
 DeleteRepositoryRequest 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/cloud.google.com/go/securesourcemanager/apiv1/securesourcemanagerpb#DeleteRepositoryRequest. 
  
 } 
  
 op 
 , 
  
 err 
  
 := 
  
 c 
 . 
 DeleteRepository 
 ( 
 ctx 
 , 
  
 req 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 err 
  
 = 
  
 op 
 . 
 Wait 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
 } 
 

func (*Client) DeleteRepositoryOperation

  func 
  
 ( 
 c 
  
 * 
  Client 
 
 ) 
  
 DeleteRepositoryOperation 
 ( 
 name 
  
  string 
 
 ) 
  
 * 
  DeleteRepositoryOperation 
 
 

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

func (*Client) GetBranchRule

GetBranchRule getBranchRule gets a branch rule.

Example

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

func (*Client) GetIamPolicy

GetIamPolicy gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.

Example

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

func (*Client) GetIamPolicyRepo

  func 
  
 ( 
 c 
  
 * 
  Client 
 
 ) 
  
 GetIamPolicyRepo 
 ( 
 ctx 
  
  context 
 
 . 
  Context 
 
 , 
  
 req 
  
 * 
  iampb 
 
 . 
  GetIamPolicyRequest 
 
 , 
  
 opts 
  
 ... 
  gax 
 
 . 
  CallOption 
 
 ) 
  
 ( 
 * 
  iampb 
 
 . 
  Policy 
 
 , 
  
  error 
 
 ) 
 

GetIamPolicyRepo get IAM policy for a repository.

Example

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

func (*Client) GetInstance

GetInstance gets details of a single instance.

Example

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

func (*Client) GetLocation

GetLocation gets information about a location.

Example

  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 securesourcemanager 
  
 "cloud.google.com/go/securesourcemanager/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_Options 
  
 c 
 , 
  
 err 
  
 := 
  
 securesourcemanager 
 . 
  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

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

Example

  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 longrunningpb 
  
 "cloud.google.com/go/longrunning/autogen/longrunningpb" 
  
 securesourcemanager 
  
 "cloud.google.com/go/securesourcemanager/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 
  
 := 
  
 securesourcemanager 
 . 
  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) GetRepository

GetRepository gets metadata of a repository.

Host: Data Plane

Example

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

func (*Client) ListBranchRules

ListBranchRules listBranchRules lists branch rules in a given repository.

Examples

  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 securesourcemanager 
  
 "cloud.google.com/go/securesourcemanager/apiv1" 
  
 securesourcemanagerpb 
  
 "cloud.google.com/go/securesourcemanager/apiv1/securesourcemanagerpb" 
  
 "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 
  
 := 
  
 securesourcemanager 
 . 
  NewClient 
 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
  Close 
 
 () 
  
 req 
  
 := 
  
& securesourcemanagerpb 
 . 
 ListBranchRulesRequest 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/cloud.google.com/go/securesourcemanager/apiv1/securesourcemanagerpb#ListBranchRulesRequest. 
  
 } 
  
 it 
  
 := 
  
 c 
 . 
 ListBranchRules 
 ( 
 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 
 .( 
 * 
 securesourcemanagerpb 
 . 
 ListBranchRulesResponse 
 ) 
  
 } 
 } 
 
all
  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 securesourcemanager 
  
 "cloud.google.com/go/securesourcemanager/apiv1" 
  
 securesourcemanagerpb 
  
 "cloud.google.com/go/securesourcemanager/apiv1/securesourcemanagerpb" 
 ) 
 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 
  
 := 
  
 securesourcemanager 
 . 
  NewClient 
 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
  Close 
 
 () 
  
 req 
  
 := 
  
& securesourcemanagerpb 
 . 
 ListBranchRulesRequest 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/cloud.google.com/go/securesourcemanager/apiv1/securesourcemanagerpb#ListBranchRulesRequest. 
  
 } 
  
 for 
  
 resp 
 , 
  
 err 
  
 := 
  
 range 
  
 c 
 . 
 ListBranchRules 
 ( 
 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) ListInstances

ListInstances lists Instances in a given project and location.

Examples

  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 securesourcemanager 
  
 "cloud.google.com/go/securesourcemanager/apiv1" 
  
 securesourcemanagerpb 
  
 "cloud.google.com/go/securesourcemanager/apiv1/securesourcemanagerpb" 
  
 "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 
  
 := 
  
 securesourcemanager 
 . 
  NewClient 
 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
  Close 
 
 () 
  
 req 
  
 := 
  
& securesourcemanagerpb 
 . 
 ListInstancesRequest 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/cloud.google.com/go/securesourcemanager/apiv1/securesourcemanagerpb#ListInstancesRequest. 
  
 } 
  
 it 
  
 := 
  
 c 
 . 
 ListInstances 
 ( 
 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 
 .( 
 * 
 securesourcemanagerpb 
 . 
 ListInstancesResponse 
 ) 
  
 } 
 } 
 
all
  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 securesourcemanager 
  
 "cloud.google.com/go/securesourcemanager/apiv1" 
  
 securesourcemanagerpb 
  
 "cloud.google.com/go/securesourcemanager/apiv1/securesourcemanagerpb" 
 ) 
 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 
  
 := 
  
 securesourcemanager 
 . 
  NewClient 
 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
  Close 
 
 () 
  
 req 
  
 := 
  
& securesourcemanagerpb 
 . 
 ListInstancesRequest 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/cloud.google.com/go/securesourcemanager/apiv1/securesourcemanagerpb#ListInstancesRequest. 
  
 } 
  
 for 
  
 resp 
 , 
  
 err 
  
 := 
  
 range 
  
 c 
 . 
 ListInstances 
 ( 
 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

ListLocations lists information about the supported locations for this service.

Examples

  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 securesourcemanager 
  
 "cloud.google.com/go/securesourcemanager/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_Options 
  
 c 
 , 
  
 err 
  
 := 
  
 securesourcemanager 
 . 
  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 
 ) 
  
 } 
 } 
 
all
  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 securesourcemanager 
  
 "cloud.google.com/go/securesourcemanager/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_Options 
  
 c 
 , 
  
 err 
  
 := 
  
 securesourcemanager 
 . 
  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

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

Examples

  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 longrunningpb 
  
 "cloud.google.com/go/longrunning/autogen/longrunningpb" 
  
 securesourcemanager 
  
 "cloud.google.com/go/securesourcemanager/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_Options 
  
 c 
 , 
  
 err 
  
 := 
  
 securesourcemanager 
 . 
  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 
 
 ) 
  
 } 
 } 
 
all
  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 longrunningpb 
  
 "cloud.google.com/go/longrunning/autogen/longrunningpb" 
  
 securesourcemanager 
  
 "cloud.google.com/go/securesourcemanager/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 
  
 := 
  
 securesourcemanager 
 . 
  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) ListRepositories

ListRepositories lists Repositories in a given project and location.

Host: Data Plane

Examples

  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 securesourcemanager 
  
 "cloud.google.com/go/securesourcemanager/apiv1" 
  
 securesourcemanagerpb 
  
 "cloud.google.com/go/securesourcemanager/apiv1/securesourcemanagerpb" 
  
 "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 
  
 := 
  
 securesourcemanager 
 . 
  NewClient 
 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
  Close 
 
 () 
  
 req 
  
 := 
  
& securesourcemanagerpb 
 . 
 ListRepositoriesRequest 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/cloud.google.com/go/securesourcemanager/apiv1/securesourcemanagerpb#ListRepositoriesRequest. 
  
 } 
  
 it 
  
 := 
  
 c 
 . 
 ListRepositories 
 ( 
 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 
 .( 
 * 
 securesourcemanagerpb 
 . 
 ListRepositoriesResponse 
 ) 
  
 } 
 } 
 
all
  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 securesourcemanager 
  
 "cloud.google.com/go/securesourcemanager/apiv1" 
  
 securesourcemanagerpb 
  
 "cloud.google.com/go/securesourcemanager/apiv1/securesourcemanagerpb" 
 ) 
 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 
  
 := 
  
 securesourcemanager 
 . 
  NewClient 
 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
  Close 
 
 () 
  
 req 
  
 := 
  
& securesourcemanagerpb 
 . 
 ListRepositoriesRequest 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/cloud.google.com/go/securesourcemanager/apiv1/securesourcemanagerpb#ListRepositoriesRequest. 
  
 } 
  
 for 
  
 resp 
 , 
  
 err 
  
 := 
  
 range 
  
 c 
 . 
 ListRepositories 
 ( 
 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) SetIamPolicy

SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy.

Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED errors.

Example

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

func (*Client) SetIamPolicyRepo

  func 
  
 ( 
 c 
  
 * 
  Client 
 
 ) 
  
 SetIamPolicyRepo 
 ( 
 ctx 
  
  context 
 
 . 
  Context 
 
 , 
  
 req 
  
 * 
  iampb 
 
 . 
  SetIamPolicyRequest 
 
 , 
  
 opts 
  
 ... 
  gax 
 
 . 
  CallOption 
 
 ) 
  
 ( 
 * 
  iampb 
 
 . 
  Policy 
 
 , 
  
  error 
 
 ) 
 

SetIamPolicyRepo set IAM policy on a repository.

Example

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

func (*Client) TestIamPermissions

TestIamPermissions returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.

Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may “fail open” without warning.

Example

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

func (*Client) TestIamPermissionsRepo

TestIamPermissionsRepo test IAM permissions on a repository. IAM permission checks are not required on this method.

Example

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

func (*Client) UpdateBranchRule

UpdateBranchRule updateBranchRule updates a branch rule.

Example

  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 securesourcemanager 
  
 "cloud.google.com/go/securesourcemanager/apiv1" 
  
 securesourcemanagerpb 
  
 "cloud.google.com/go/securesourcemanager/apiv1/securesourcemanagerpb" 
 ) 
 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 
  
 := 
  
 securesourcemanager 
 . 
  NewClient 
 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
  Close 
 
 () 
  
 req 
  
 := 
  
& securesourcemanagerpb 
 . 
 UpdateBranchRuleRequest 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/cloud.google.com/go/securesourcemanager/apiv1/securesourcemanagerpb#UpdateBranchRuleRequest. 
  
 } 
  
 op 
 , 
  
 err 
  
 := 
  
 c 
 . 
 UpdateBranchRule 
 ( 
 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) UpdateBranchRuleOperation

  func 
  
 ( 
 c 
  
 * 
  Client 
 
 ) 
  
 UpdateBranchRuleOperation 
 ( 
 name 
  
  string 
 
 ) 
  
 * 
  UpdateBranchRuleOperation 
 
 

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

CreateBranchRuleOperation

  type 
  
 CreateBranchRuleOperation 
  
 struct 
  
 { 
  
 // contains filtered or unexported fields 
 } 
 

CreateBranchRuleOperation manages a long-running operation from CreateBranchRule.

func (*CreateBranchRuleOperation) Done

Done reports whether the long-running operation has completed.

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 (*CreateBranchRuleOperation) Name

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

func (*CreateBranchRuleOperation) Poll

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

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

If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the 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 (*CreateBranchRuleOperation) Wait

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

See documentation of Poll for error-handling information.

CreateInstanceOperation

  type 
  
 CreateInstanceOperation 
  
 struct 
  
 { 
  
 // contains filtered or unexported fields 
 } 
 

CreateInstanceOperation manages a long-running operation from CreateInstance.

func (*CreateInstanceOperation) Done

  func 
  
 ( 
 op 
  
 * 
  CreateInstanceOperation 
 
 ) 
  
 Done 
 () 
  
  bool 
 
 

Done reports whether the long-running operation has completed.

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 (*CreateInstanceOperation) Name

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

func (*CreateInstanceOperation) Poll

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

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

If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the 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 (*CreateInstanceOperation) Wait

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

See documentation of Poll for error-handling information.

CreateRepositoryOperation

  type 
  
 CreateRepositoryOperation 
  
 struct 
  
 { 
  
 // contains filtered or unexported fields 
 } 
 

CreateRepositoryOperation manages a long-running operation from CreateRepository.

func (*CreateRepositoryOperation) Done

Done reports whether the long-running operation has completed.

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 (*CreateRepositoryOperation) Name

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

func (*CreateRepositoryOperation) Poll

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

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

If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the 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 (*CreateRepositoryOperation) Wait

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

See documentation of Poll for error-handling information.

DeleteBranchRuleOperation

  type 
  
 DeleteBranchRuleOperation 
  
 struct 
  
 { 
  
 // contains filtered or unexported fields 
 } 
 

DeleteBranchRuleOperation manages a long-running operation from DeleteBranchRule.

func (*DeleteBranchRuleOperation) Done

Done reports whether the long-running operation has completed.

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 (*DeleteBranchRuleOperation) Name

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

func (*DeleteBranchRuleOperation) Poll

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

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

If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the 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 (*DeleteBranchRuleOperation) Wait

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

See documentation of Poll for error-handling information.

DeleteInstanceOperation

  type 
  
 DeleteInstanceOperation 
  
 struct 
  
 { 
  
 // contains filtered or unexported fields 
 } 
 

DeleteInstanceOperation manages a long-running operation from DeleteInstance.

func (*DeleteInstanceOperation) Done

  func 
  
 ( 
 op 
  
 * 
  DeleteInstanceOperation 
 
 ) 
  
 Done 
 () 
  
  bool 
 
 

Done reports whether the long-running operation has completed.

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 (*DeleteInstanceOperation) Name

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

func (*DeleteInstanceOperation) Poll

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

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

If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the 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 (*DeleteInstanceOperation) Wait

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

See documentation of Poll for error-handling information.

DeleteRepositoryOperation

  type 
  
 DeleteRepositoryOperation 
  
 struct 
  
 { 
  
 // contains filtered or unexported fields 
 } 
 

DeleteRepositoryOperation manages a long-running operation from DeleteRepository.

func (*DeleteRepositoryOperation) Done

Done reports whether the long-running operation has completed.

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 (*DeleteRepositoryOperation) Name

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

func (*DeleteRepositoryOperation) Poll

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

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

If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the 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 (*DeleteRepositoryOperation) Wait

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

See documentation of Poll for error-handling information.

InstanceIterator

  type 
  
 InstanceIterator 
  
 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 
  
 [] 
 * 
  securesourcemanagerpb 
 
 . 
  Instance 
 
 , 
  
 nextPageToken 
  
  string 
 
 , 
  
 err 
  
  error 
 
 ) 
  
 // contains filtered or unexported fields 
 } 
 

InstanceIterator manages a stream of *securesourcemanagerpb.Instance.

func (*InstanceIterator) All

  func 
  
 ( 
 it 
  
 * 
  InstanceIterator 
 
 ) 
  
 All 
 () 
  
 iter 
 . 
 Seq2 
 [ 
 * 
 securesourcemanagerpb 
 . 
 Instance 
 , 
  
 error 
 ] 
 

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

func (*InstanceIterator) 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 (*InstanceIterator) PageInfo

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

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

LocationIterator

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

LocationIterator manages a stream of *locationpb.Location.

func (*LocationIterator) All

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

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

func (*LocationIterator) 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 (*LocationIterator) PageInfo

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

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

OperationIterator

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

OperationIterator manages a stream of *longrunningpb.Operation.

func (*OperationIterator) All

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

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

func (*OperationIterator) 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 (*OperationIterator) PageInfo

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

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

RepositoryIterator

  type 
  
 RepositoryIterator 
  
 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 
  
 [] 
 * 
  securesourcemanagerpb 
 
 . 
  Repository 
 
 , 
  
 nextPageToken 
  
  string 
 
 , 
  
 err 
  
  error 
 
 ) 
  
 // contains filtered or unexported fields 
 } 
 

RepositoryIterator manages a stream of *securesourcemanagerpb.Repository.

func (*RepositoryIterator) All

  func 
  
 ( 
 it 
  
 * 
  RepositoryIterator 
 
 ) 
  
 All 
 () 
  
 iter 
 . 
 Seq2 
 [ 
 * 
 securesourcemanagerpb 
 . 
 Repository 
 , 
  
 error 
 ] 
 

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

func (*RepositoryIterator) 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 (*RepositoryIterator) PageInfo

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

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

UpdateBranchRuleOperation

  type 
  
 UpdateBranchRuleOperation 
  
 struct 
  
 { 
  
 // contains filtered or unexported fields 
 } 
 

UpdateBranchRuleOperation manages a long-running operation from UpdateBranchRule.

func (*UpdateBranchRuleOperation) Done

Done reports whether the long-running operation has completed.

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 (*UpdateBranchRuleOperation) Name

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

func (*UpdateBranchRuleOperation) Poll

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

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

If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the 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 (*UpdateBranchRuleOperation) Wait

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

See documentation of Poll for error-handling information.

Design a Mobile Site
View Site in Mobile | Classic
Share by: