Documentation ¶
Overview ¶
Package iap is an auto-generated package for the Cloud Identity-Aware Proxy API.
Controls access to cloud applications running on Google Cloud Platform.
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:
- Authentication and Authorization
- Timeouts and Cancellation
- Testing against Client Libraries
- Debugging Client Libraries
- Inspecting errors
Example usage ¶
To get started with this package, create a client.
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 := iap.NewIdentityAwareProxyAdminClient(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.
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 := iap.NewIdentityAwareProxyAdminClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &iappb.CreateTunnelDestGroupRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/iap/apiv1/iappb#CreateTunnelDestGroupRequest. } resp, err := c.CreateTunnelDestGroup(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp
Use of Context ¶
The ctx passed to NewIdentityAwareProxyAdminClient 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.
Index ¶
- func DefaultAuthScopes() []string
- type IdentityAwareProxyAdminCallOptions
- type IdentityAwareProxyAdminClient
- func (c *IdentityAwareProxyAdminClient) Close() error
- func (c *IdentityAwareProxyAdminClient) Connection() *grpc.ClientConndeprecated
- func (c *IdentityAwareProxyAdminClient) CreateTunnelDestGroup(ctx context.Context, req *iappb.CreateTunnelDestGroupRequest, ...) (*iappb.TunnelDestGroup, error)
- func (c *IdentityAwareProxyAdminClient) DeleteTunnelDestGroup(ctx context.Context, req *iappb.DeleteTunnelDestGroupRequest, ...) error
- func (c *IdentityAwareProxyAdminClient) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)
- func (c *IdentityAwareProxyAdminClient) GetIapSettings(ctx context.Context, req *iappb.GetIapSettingsRequest, opts ...gax.CallOption) (*iappb.IapSettings, error)
- func (c *IdentityAwareProxyAdminClient) GetTunnelDestGroup(ctx context.Context, req *iappb.GetTunnelDestGroupRequest, ...) (*iappb.TunnelDestGroup, error)
- func (c *IdentityAwareProxyAdminClient) ListTunnelDestGroups(ctx context.Context, req *iappb.ListTunnelDestGroupsRequest, ...) *TunnelDestGroupIterator
- func (c *IdentityAwareProxyAdminClient) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)
- func (c *IdentityAwareProxyAdminClient) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, ...) (*iampb.TestIamPermissionsResponse, error)
- func (c *IdentityAwareProxyAdminClient) UpdateIapSettings(ctx context.Context, req *iappb.UpdateIapSettingsRequest, ...) (*iappb.IapSettings, error)
- func (c *IdentityAwareProxyAdminClient) UpdateTunnelDestGroup(ctx context.Context, req *iappb.UpdateTunnelDestGroupRequest, ...) (*iappb.TunnelDestGroup, error)
- type IdentityAwareProxyClientIterator
- type IdentityAwareProxyOAuthCallOptions
- type IdentityAwareProxyOAuthClient
- func (c *IdentityAwareProxyOAuthClient) Close() error
- func (c *IdentityAwareProxyOAuthClient) Connection() *grpc.ClientConndeprecated
- func (c *IdentityAwareProxyOAuthClient) CreateBrand(ctx context.Context, req *iappb.CreateBrandRequest, opts ...gax.CallOption) (*iappb.Brand, error)
- func (c *IdentityAwareProxyOAuthClient) CreateIdentityAwareProxyClient(ctx context.Context, req *iappb.CreateIdentityAwareProxyClientRequest, ...) (*iappb.IdentityAwareProxyClient, error)
- func (c *IdentityAwareProxyOAuthClient) DeleteIdentityAwareProxyClient(ctx context.Context, req *iappb.DeleteIdentityAwareProxyClientRequest, ...) error
- func (c *IdentityAwareProxyOAuthClient) GetBrand(ctx context.Context, req *iappb.GetBrandRequest, opts ...gax.CallOption) (*iappb.Brand, error)
- func (c *IdentityAwareProxyOAuthClient) GetIdentityAwareProxyClient(ctx context.Context, req *iappb.GetIdentityAwareProxyClientRequest, ...) (*iappb.IdentityAwareProxyClient, error)
- func (c *IdentityAwareProxyOAuthClient) ListBrands(ctx context.Context, req *iappb.ListBrandsRequest, opts ...gax.CallOption) (*iappb.ListBrandsResponse, error)
- func (c *IdentityAwareProxyOAuthClient) ListIdentityAwareProxyClients(ctx context.Context, req *iappb.ListIdentityAwareProxyClientsRequest, ...) *IdentityAwareProxyClientIterator
- func (c *IdentityAwareProxyOAuthClient) ResetIdentityAwareProxyClientSecret(ctx context.Context, req *iappb.ResetIdentityAwareProxyClientSecretRequest, ...) (*iappb.IdentityAwareProxyClient, error)
- type TunnelDestGroupIterator
Examples ¶
- IdentityAwareProxyAdminClient.CreateTunnelDestGroup
- IdentityAwareProxyAdminClient.DeleteTunnelDestGroup
- IdentityAwareProxyAdminClient.GetIamPolicy
- IdentityAwareProxyAdminClient.GetIapSettings
- IdentityAwareProxyAdminClient.GetTunnelDestGroup
- IdentityAwareProxyAdminClient.ListTunnelDestGroups
- IdentityAwareProxyAdminClient.SetIamPolicy
- IdentityAwareProxyAdminClient.TestIamPermissions
- IdentityAwareProxyAdminClient.UpdateIapSettings
- IdentityAwareProxyAdminClient.UpdateTunnelDestGroup
- IdentityAwareProxyOAuthClient.CreateBrand
- IdentityAwareProxyOAuthClient.CreateIdentityAwareProxyClient
- IdentityAwareProxyOAuthClient.DeleteIdentityAwareProxyClient
- IdentityAwareProxyOAuthClient.GetBrand
- IdentityAwareProxyOAuthClient.GetIdentityAwareProxyClient
- IdentityAwareProxyOAuthClient.ListBrands
- IdentityAwareProxyOAuthClient.ListIdentityAwareProxyClients
- IdentityAwareProxyOAuthClient.ResetIdentityAwareProxyClientSecret
- NewIdentityAwareProxyAdminClient
- NewIdentityAwareProxyAdminRESTClient
- NewIdentityAwareProxyOAuthClient
- NewIdentityAwareProxyOAuthRESTClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultAuthScopes ¶
func DefaultAuthScopes() []string
DefaultAuthScopes reports the default set of authentication scopes to use with this package.
Types ¶
type IdentityAwareProxyAdminCallOptions ¶
type IdentityAwareProxyAdminCallOptions struct { SetIamPolicy []gax.CallOption GetIamPolicy []gax.CallOption TestIamPermissions []gax.CallOption GetIapSettings []gax.CallOption UpdateIapSettings []gax.CallOption ListTunnelDestGroups []gax.CallOption CreateTunnelDestGroup []gax.CallOption GetTunnelDestGroup []gax.CallOption DeleteTunnelDestGroup []gax.CallOption UpdateTunnelDestGroup []gax.CallOption }
IdentityAwareProxyAdminCallOptions contains the retry settings for each method of IdentityAwareProxyAdminClient.
type IdentityAwareProxyAdminClient ¶
type IdentityAwareProxyAdminClient struct { // The call options for this service. CallOptions *IdentityAwareProxyAdminCallOptions // contains filtered or unexported fields }
IdentityAwareProxyAdminClient is a client for interacting with Cloud Identity-Aware Proxy API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
APIs for Identity-Aware Proxy Admin configurations.
func NewIdentityAwareProxyAdminClient ¶
func NewIdentityAwareProxyAdminClient(ctx context.Context, opts ...option.ClientOption) (*IdentityAwareProxyAdminClient, error)
NewIdentityAwareProxyAdminClient creates a new identity aware proxy admin service client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
APIs for Identity-Aware Proxy Admin configurations.
Example ¶
package main import ( "context" iap "cloud.google.com/go/iap/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 := iap.NewIdentityAwareProxyAdminClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func NewIdentityAwareProxyAdminRESTClient ¶ added in v1.6.0
func NewIdentityAwareProxyAdminRESTClient(ctx context.Context, opts ...option.ClientOption) (*IdentityAwareProxyAdminClient, error)
NewIdentityAwareProxyAdminRESTClient creates a new identity aware proxy admin service rest client.
APIs for Identity-Aware Proxy Admin configurations.
Example ¶
package main import ( "context" iap "cloud.google.com/go/iap/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 := iap.NewIdentityAwareProxyAdminRESTClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func (*IdentityAwareProxyAdminClient) Close ¶
func (c *IdentityAwareProxyAdminClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*IdentityAwareProxyAdminClient) Connection
deprecated
func (c *IdentityAwareProxyAdminClient) 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 (*IdentityAwareProxyAdminClient) CreateTunnelDestGroup ¶ added in v1.3.0
func (c *IdentityAwareProxyAdminClient) CreateTunnelDestGroup(ctx context.Context, req *iappb.CreateTunnelDestGroupRequest, opts ...gax.CallOption) (*iappb.TunnelDestGroup, error)
CreateTunnelDestGroup creates a new TunnelDestGroup.
Example ¶
package main import ( "context" iap "cloud.google.com/go/iap/apiv1" iappb "cloud.google.com/go/iap/apiv1/iappb" ) 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 := iap.NewIdentityAwareProxyAdminClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &iappb.CreateTunnelDestGroupRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/iap/apiv1/iappb#CreateTunnelDestGroupRequest. } resp, err := c.CreateTunnelDestGroup(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*IdentityAwareProxyAdminClient) DeleteTunnelDestGroup ¶ added in v1.3.0
func (c *IdentityAwareProxyAdminClient) DeleteTunnelDestGroup(ctx context.Context, req *iappb.DeleteTunnelDestGroupRequest, opts ...gax.CallOption) error
DeleteTunnelDestGroup deletes a TunnelDestGroup.
Example ¶
package main import ( "context" iap "cloud.google.com/go/iap/apiv1" iappb "cloud.google.com/go/iap/apiv1/iappb" ) 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 := iap.NewIdentityAwareProxyAdminClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &iappb.DeleteTunnelDestGroupRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/iap/apiv1/iappb#DeleteTunnelDestGroupRequest. } err = c.DeleteTunnelDestGroup(ctx, req) if err != nil { // TODO: Handle error. } }
Output:
func (*IdentityAwareProxyAdminClient) GetIamPolicy ¶
func (c *IdentityAwareProxyAdminClient) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)
GetIamPolicy gets the access control policy for an Identity-Aware Proxy protected resource. More information about managing access via IAP can be found at: https://cloud.google.com/iap/docs/managing-access#managing_access_via_the_api (at https://cloud.google.com/iap/docs/managing-access#managing_access_via_the_api)
Example ¶
package main import ( "context" iampb "cloud.google.com/go/iam/apiv1/iampb" iap "cloud.google.com/go/iap/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 := iap.NewIdentityAwareProxyAdminClient(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 }
Output:
func (*IdentityAwareProxyAdminClient) GetIapSettings ¶
func (c *IdentityAwareProxyAdminClient) GetIapSettings(ctx context.Context, req *iappb.GetIapSettingsRequest, opts ...gax.CallOption) (*iappb.IapSettings, error)
GetIapSettings gets the IAP settings on a particular IAP protected resource.
Example ¶
package main import ( "context" iap "cloud.google.com/go/iap/apiv1" iappb "cloud.google.com/go/iap/apiv1/iappb" ) 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 := iap.NewIdentityAwareProxyAdminClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &iappb.GetIapSettingsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/iap/apiv1/iappb#GetIapSettingsRequest. } resp, err := c.GetIapSettings(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*IdentityAwareProxyAdminClient) GetTunnelDestGroup ¶ added in v1.3.0
func (c *IdentityAwareProxyAdminClient) GetTunnelDestGroup(ctx context.Context, req *iappb.GetTunnelDestGroupRequest, opts ...gax.CallOption) (*iappb.TunnelDestGroup, error)
GetTunnelDestGroup retrieves an existing TunnelDestGroup.
Example ¶
package main import ( "context" iap "cloud.google.com/go/iap/apiv1" iappb "cloud.google.com/go/iap/apiv1/iappb" ) 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 := iap.NewIdentityAwareProxyAdminClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &iappb.GetTunnelDestGroupRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/iap/apiv1/iappb#GetTunnelDestGroupRequest. } resp, err := c.GetTunnelDestGroup(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*IdentityAwareProxyAdminClient) ListTunnelDestGroups ¶ added in v1.3.0
func (c *IdentityAwareProxyAdminClient) ListTunnelDestGroups(ctx context.Context, req *iappb.ListTunnelDestGroupsRequest, opts ...gax.CallOption) *TunnelDestGroupIterator
ListTunnelDestGroups lists the existing TunnelDestGroups. To group across all locations, use a - as the location ID. For example: /v1/projects/123/iap_tunnel/locations/-/destGroups
Example ¶
package main import ( "context" iap "cloud.google.com/go/iap/apiv1" iappb "cloud.google.com/go/iap/apiv1/iappb" "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 := iap.NewIdentityAwareProxyAdminClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &iappb.ListTunnelDestGroupsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/iap/apiv1/iappb#ListTunnelDestGroupsRequest. } it := c.ListTunnelDestGroups(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.(*iappb.ListTunnelDestGroupsResponse) } }
Output:
func (*IdentityAwareProxyAdminClient) SetIamPolicy ¶
func (c *IdentityAwareProxyAdminClient) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)
SetIamPolicy sets the access control policy for an Identity-Aware Proxy protected resource. Replaces any existing policy. More information about managing access via IAP can be found at: https://cloud.google.com/iap/docs/managing-access#managing_access_via_the_api (at https://cloud.google.com/iap/docs/managing-access#managing_access_via_the_api)
Example ¶
package main import ( "context" iampb "cloud.google.com/go/iam/apiv1/iampb" iap "cloud.google.com/go/iap/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 := iap.NewIdentityAwareProxyAdminClient(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 }
Output:
func (*IdentityAwareProxyAdminClient) TestIamPermissions ¶
func (c *IdentityAwareProxyAdminClient) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, opts ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the Identity-Aware Proxy protected resource. More information about managing access via IAP can be found at: https://cloud.google.com/iap/docs/managing-access#managing_access_via_the_api (at https://cloud.google.com/iap/docs/managing-access#managing_access_via_the_api)
Example ¶
package main import ( "context" iampb "cloud.google.com/go/iam/apiv1/iampb" iap "cloud.google.com/go/iap/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 := iap.NewIdentityAwareProxyAdminClient(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 }
Output:
func (*IdentityAwareProxyAdminClient) UpdateIapSettings ¶
func (c *IdentityAwareProxyAdminClient) UpdateIapSettings(ctx context.Context, req *iappb.UpdateIapSettingsRequest, opts ...gax.CallOption) (*iappb.IapSettings, error)
UpdateIapSettings updates the IAP settings on a particular IAP protected resource. It replaces all fields unless the update_mask is set.
Example ¶
package main import ( "context" iap "cloud.google.com/go/iap/apiv1" iappb "cloud.google.com/go/iap/apiv1/iappb" ) 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 := iap.NewIdentityAwareProxyAdminClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &iappb.UpdateIapSettingsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/iap/apiv1/iappb#UpdateIapSettingsRequest. } resp, err := c.UpdateIapSettings(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*IdentityAwareProxyAdminClient) UpdateTunnelDestGroup ¶ added in v1.3.0
func (c *IdentityAwareProxyAdminClient) UpdateTunnelDestGroup(ctx context.Context, req *iappb.UpdateTunnelDestGroupRequest, opts ...gax.CallOption) (*iappb.TunnelDestGroup, error)
UpdateTunnelDestGroup updates a TunnelDestGroup.
Example ¶
package main import ( "context" iap "cloud.google.com/go/iap/apiv1" iappb "cloud.google.com/go/iap/apiv1/iappb" ) 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 := iap.NewIdentityAwareProxyAdminClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &iappb.UpdateTunnelDestGroupRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/iap/apiv1/iappb#UpdateTunnelDestGroupRequest. } resp, err := c.UpdateTunnelDestGroup(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
type IdentityAwareProxyClientIterator ¶
type IdentityAwareProxyClientIterator 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 []*iappb.IdentityAwareProxyClient, nextPageToken string, err error) // contains filtered or unexported fields }
IdentityAwareProxyClientIterator manages a stream of *iappb.IdentityAwareProxyClient.
func (*IdentityAwareProxyClientIterator) Next ¶
func (it *IdentityAwareProxyClientIterator) Next() (*iappb.IdentityAwareProxyClient, error)
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 (*IdentityAwareProxyClientIterator) PageInfo ¶
func (it *IdentityAwareProxyClientIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type IdentityAwareProxyOAuthCallOptions ¶
type IdentityAwareProxyOAuthCallOptions struct { ListBrands []gax.CallOption CreateBrand []gax.CallOption GetBrand []gax.CallOption CreateIdentityAwareProxyClient []gax.CallOption ListIdentityAwareProxyClients []gax.CallOption GetIdentityAwareProxyClient []gax.CallOption ResetIdentityAwareProxyClientSecret []gax.CallOption DeleteIdentityAwareProxyClient []gax.CallOption }
IdentityAwareProxyOAuthCallOptions contains the retry settings for each method of IdentityAwareProxyOAuthClient.
type IdentityAwareProxyOAuthClient ¶
type IdentityAwareProxyOAuthClient struct { // The call options for this service. CallOptions *IdentityAwareProxyOAuthCallOptions // contains filtered or unexported fields }
IdentityAwareProxyOAuthClient is a client for interacting with Cloud Identity-Aware Proxy API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
API to programmatically create, list and retrieve Identity Aware Proxy (IAP) OAuth brands; and create, retrieve, delete and reset-secret of IAP OAuth clients.
func NewIdentityAwareProxyOAuthClient ¶
func NewIdentityAwareProxyOAuthClient(ctx context.Context, opts ...option.ClientOption) (*IdentityAwareProxyOAuthClient, error)
NewIdentityAwareProxyOAuthClient creates a new identity aware proxyo auth service client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
API to programmatically create, list and retrieve Identity Aware Proxy (IAP) OAuth brands; and create, retrieve, delete and reset-secret of IAP OAuth clients.
Example ¶
package main import ( "context" iap "cloud.google.com/go/iap/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 := iap.NewIdentityAwareProxyOAuthClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func NewIdentityAwareProxyOAuthRESTClient ¶ added in v1.6.0
func NewIdentityAwareProxyOAuthRESTClient(ctx context.Context, opts ...option.ClientOption) (*IdentityAwareProxyOAuthClient, error)
NewIdentityAwareProxyOAuthRESTClient creates a new identity aware proxyo auth service rest client.
API to programmatically create, list and retrieve Identity Aware Proxy (IAP) OAuth brands; and create, retrieve, delete and reset-secret of IAP OAuth clients.
Example ¶
package main import ( "context" iap "cloud.google.com/go/iap/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 := iap.NewIdentityAwareProxyOAuthRESTClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func (*IdentityAwareProxyOAuthClient) Close ¶
func (c *IdentityAwareProxyOAuthClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*IdentityAwareProxyOAuthClient) Connection
deprecated
func (c *IdentityAwareProxyOAuthClient) 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 (*IdentityAwareProxyOAuthClient) CreateBrand ¶
func (c *IdentityAwareProxyOAuthClient) CreateBrand(ctx context.Context, req *iappb.CreateBrandRequest, opts ...gax.CallOption) (*iappb.Brand, error)
CreateBrand constructs a new OAuth brand for the project if one does not exist. The created brand is “internal only”, meaning that OAuth clients created under it only accept requests from users who belong to the same Google Workspace organization as the project. The brand is created in an un-reviewed status. NOTE: The “internal only” status can be manually changed in the Google Cloud Console. Requires that a brand does not already exist for the project, and that the specified support email is owned by the caller.
Example ¶
package main import ( "context" iap "cloud.google.com/go/iap/apiv1" iappb "cloud.google.com/go/iap/apiv1/iappb" ) 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 := iap.NewIdentityAwareProxyOAuthClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &iappb.CreateBrandRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/iap/apiv1/iappb#CreateBrandRequest. } resp, err := c.CreateBrand(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*IdentityAwareProxyOAuthClient) CreateIdentityAwareProxyClient ¶
func (c *IdentityAwareProxyOAuthClient) CreateIdentityAwareProxyClient(ctx context.Context, req *iappb.CreateIdentityAwareProxyClientRequest, opts ...gax.CallOption) (*iappb.IdentityAwareProxyClient, error)
CreateIdentityAwareProxyClient creates an Identity Aware Proxy (IAP) OAuth client. The client is owned by IAP. Requires that the brand for the project exists and that it is set for internal-only use.
Example ¶
package main import ( "context" iap "cloud.google.com/go/iap/apiv1" iappb "cloud.google.com/go/iap/apiv1/iappb" ) 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 := iap.NewIdentityAwareProxyOAuthClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &iappb.CreateIdentityAwareProxyClientRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/iap/apiv1/iappb#CreateIdentityAwareProxyClientRequest. } resp, err := c.CreateIdentityAwareProxyClient(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*IdentityAwareProxyOAuthClient) DeleteIdentityAwareProxyClient ¶
func (c *IdentityAwareProxyOAuthClient) DeleteIdentityAwareProxyClient(ctx context.Context, req *iappb.DeleteIdentityAwareProxyClientRequest, opts ...gax.CallOption) error
DeleteIdentityAwareProxyClient deletes an Identity Aware Proxy (IAP) OAuth client. Useful for removing obsolete clients, managing the number of clients in a given project, and cleaning up after tests. Requires that the client is owned by IAP.
Example ¶
package main import ( "context" iap "cloud.google.com/go/iap/apiv1" iappb "cloud.google.com/go/iap/apiv1/iappb" ) 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 := iap.NewIdentityAwareProxyOAuthClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &iappb.DeleteIdentityAwareProxyClientRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/iap/apiv1/iappb#DeleteIdentityAwareProxyClientRequest. } err = c.DeleteIdentityAwareProxyClient(ctx, req) if err != nil { // TODO: Handle error. } }
Output:
func (*IdentityAwareProxyOAuthClient) GetBrand ¶
func (c *IdentityAwareProxyOAuthClient) GetBrand(ctx context.Context, req *iappb.GetBrandRequest, opts ...gax.CallOption) (*iappb.Brand, error)
GetBrand retrieves the OAuth brand of the project.
Example ¶
package main import ( "context" iap "cloud.google.com/go/iap/apiv1" iappb "cloud.google.com/go/iap/apiv1/iappb" ) 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 := iap.NewIdentityAwareProxyOAuthClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &iappb.GetBrandRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/iap/apiv1/iappb#GetBrandRequest. } resp, err := c.GetBrand(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*IdentityAwareProxyOAuthClient) GetIdentityAwareProxyClient ¶
func (c *IdentityAwareProxyOAuthClient) GetIdentityAwareProxyClient(ctx context.Context, req *iappb.GetIdentityAwareProxyClientRequest, opts ...gax.CallOption) (*iappb.IdentityAwareProxyClient, error)
GetIdentityAwareProxyClient retrieves an Identity Aware Proxy (IAP) OAuth client. Requires that the client is owned by IAP.
Example ¶
package main import ( "context" iap "cloud.google.com/go/iap/apiv1" iappb "cloud.google.com/go/iap/apiv1/iappb" ) 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 := iap.NewIdentityAwareProxyOAuthClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &iappb.GetIdentityAwareProxyClientRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/iap/apiv1/iappb#GetIdentityAwareProxyClientRequest. } resp, err := c.GetIdentityAwareProxyClient(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*IdentityAwareProxyOAuthClient) ListBrands ¶
func (c *IdentityAwareProxyOAuthClient) ListBrands(ctx context.Context, req *iappb.ListBrandsRequest, opts ...gax.CallOption) (*iappb.ListBrandsResponse, error)
ListBrands lists the existing brands for the project.
Example ¶
package main import ( "context" iap "cloud.google.com/go/iap/apiv1" iappb "cloud.google.com/go/iap/apiv1/iappb" ) 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 := iap.NewIdentityAwareProxyOAuthClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &iappb.ListBrandsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/iap/apiv1/iappb#ListBrandsRequest. } resp, err := c.ListBrands(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*IdentityAwareProxyOAuthClient) ListIdentityAwareProxyClients ¶
func (c *IdentityAwareProxyOAuthClient) ListIdentityAwareProxyClients(ctx context.Context, req *iappb.ListIdentityAwareProxyClientsRequest, opts ...gax.CallOption) *IdentityAwareProxyClientIterator
ListIdentityAwareProxyClients lists the existing clients for the brand.
Example ¶
package main import ( "context" iap "cloud.google.com/go/iap/apiv1" iappb "cloud.google.com/go/iap/apiv1/iappb" "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 := iap.NewIdentityAwareProxyOAuthClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &iappb.ListIdentityAwareProxyClientsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/iap/apiv1/iappb#ListIdentityAwareProxyClientsRequest. } it := c.ListIdentityAwareProxyClients(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.(*iappb.ListIdentityAwareProxyClientsResponse) } }
Output:
func (*IdentityAwareProxyOAuthClient) ResetIdentityAwareProxyClientSecret ¶
func (c *IdentityAwareProxyOAuthClient) ResetIdentityAwareProxyClientSecret(ctx context.Context, req *iappb.ResetIdentityAwareProxyClientSecretRequest, opts ...gax.CallOption) (*iappb.IdentityAwareProxyClient, error)
ResetIdentityAwareProxyClientSecret resets an Identity Aware Proxy (IAP) OAuth client secret. Useful if the secret was compromised. Requires that the client is owned by IAP.
Example ¶
package main import ( "context" iap "cloud.google.com/go/iap/apiv1" iappb "cloud.google.com/go/iap/apiv1/iappb" ) 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 := iap.NewIdentityAwareProxyOAuthClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &iappb.ResetIdentityAwareProxyClientSecretRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/iap/apiv1/iappb#ResetIdentityAwareProxyClientSecretRequest. } resp, err := c.ResetIdentityAwareProxyClientSecret(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
type TunnelDestGroupIterator ¶ added in v1.3.0
type TunnelDestGroupIterator 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 []*iappb.TunnelDestGroup, nextPageToken string, err error) // contains filtered or unexported fields }
TunnelDestGroupIterator manages a stream of *iappb.TunnelDestGroup.
func (*TunnelDestGroupIterator) Next ¶ added in v1.3.0
func (it *TunnelDestGroupIterator) Next() (*iappb.TunnelDestGroup, error)
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 (*TunnelDestGroupIterator) PageInfo ¶ added in v1.3.0
func (it *TunnelDestGroupIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.