Package iap is an auto-generated package for the Cloud Identity-Aware Proxy API.
Controls access to cloud applications running on Google Cloud Platform.
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 := & iampb . SetIamPolicyRequest { // TODO: Fill request struct fields. // See https://pkg.go.dev/google.golang.org/genproto/googleapis/iam/v1#SetIamPolicyRequest. } resp , err := c . SetIamPolicy ( 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.
For information about setting deadlines, reusing contexts, and more please visit https://pkg.go.dev/cloud.google.com/go .
Functions
func DefaultAuthScopes
func
DefaultAuthScopes
()
[]
string
DefaultAuthScopes reports the default set of authentication scopes to use with this package.
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.
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
}
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
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
"google.golang.org/genproto/googleapis/cloud/iap/v1"
)
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/google.golang.org/genproto/googleapis/cloud/iap/v1#CreateTunnelDestGroupRequest.
}
resp
,
err
:=
c
.
CreateTunnelDestGroup
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
func (*IdentityAwareProxyAdminClient) DeleteTunnelDestGroup
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
"google.golang.org/genproto/googleapis/cloud/iap/v1"
)
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/google.golang.org/genproto/googleapis/cloud/iap/v1#DeleteTunnelDestGroupRequest.
}
err
=
c
.
DeleteTunnelDestGroup
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
}
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"
iap
"cloud.google.com/go/iap/apiv1"
iampb
"google.golang.org/genproto/googleapis/iam/v1"
)
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/google.golang.org/genproto/googleapis/iam/v1#GetIamPolicyRequest.
}
resp
,
err
:=
c
.
GetIamPolicy
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
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
"google.golang.org/genproto/googleapis/cloud/iap/v1"
)
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/google.golang.org/genproto/googleapis/cloud/iap/v1#GetIapSettingsRequest.
}
resp
,
err
:=
c
.
GetIapSettings
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
func (*IdentityAwareProxyAdminClient) GetTunnelDestGroup
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
"google.golang.org/genproto/googleapis/cloud/iap/v1"
)
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/google.golang.org/genproto/googleapis/cloud/iap/v1#GetTunnelDestGroupRequest.
}
resp
,
err
:=
c
.
GetTunnelDestGroup
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
func (*IdentityAwareProxyAdminClient) ListTunnelDestGroups
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"
"google.golang.org/api/iterator"
iappb
"google.golang.org/genproto/googleapis/cloud/iap/v1"
)
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/google.golang.org/genproto/googleapis/cloud/iap/v1#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
}
}
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"
iap
"cloud.google.com/go/iap/apiv1"
iampb
"google.golang.org/genproto/googleapis/iam/v1"
)
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/google.golang.org/genproto/googleapis/iam/v1#SetIamPolicyRequest.
}
resp
,
err
:=
c
.
SetIamPolicy
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
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"
iap
"cloud.google.com/go/iap/apiv1"
iampb
"google.golang.org/genproto/googleapis/iam/v1"
)
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/google.golang.org/genproto/googleapis/iam/v1#TestIamPermissionsRequest.
}
resp
,
err
:=
c
.
TestIamPermissions
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
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
"google.golang.org/genproto/googleapis/cloud/iap/v1"
)
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/google.golang.org/genproto/googleapis/cloud/iap/v1#UpdateIapSettingsRequest.
}
resp
,
err
:=
c
.
UpdateIapSettings
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
func (*IdentityAwareProxyAdminClient) UpdateTunnelDestGroup
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
"google.golang.org/genproto/googleapis/cloud/iap/v1"
)
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/google.golang.org/genproto/googleapis/cloud/iap/v1#UpdateTunnelDestGroupRequest.
}
resp
,
err
:=
c
.
UpdateTunnelDestGroup
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
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.
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.
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
}
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
"google.golang.org/genproto/googleapis/cloud/iap/v1"
)
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/google.golang.org/genproto/googleapis/cloud/iap/v1#CreateBrandRequest.
}
resp
,
err
:=
c
.
CreateBrand
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
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
"google.golang.org/genproto/googleapis/cloud/iap/v1"
)
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/google.golang.org/genproto/googleapis/cloud/iap/v1#CreateIdentityAwareProxyClientRequest.
}
resp
,
err
:=
c
.
CreateIdentityAwareProxyClient
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
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
"google.golang.org/genproto/googleapis/cloud/iap/v1"
)
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/google.golang.org/genproto/googleapis/cloud/iap/v1#DeleteIdentityAwareProxyClientRequest.
}
err
=
c
.
DeleteIdentityAwareProxyClient
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
}
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
"google.golang.org/genproto/googleapis/cloud/iap/v1"
)
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/google.golang.org/genproto/googleapis/cloud/iap/v1#GetBrandRequest.
}
resp
,
err
:=
c
.
GetBrand
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
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
"google.golang.org/genproto/googleapis/cloud/iap/v1"
)
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/google.golang.org/genproto/googleapis/cloud/iap/v1#GetIdentityAwareProxyClientRequest.
}
resp
,
err
:=
c
.
GetIdentityAwareProxyClient
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
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
"google.golang.org/genproto/googleapis/cloud/iap/v1"
)
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/google.golang.org/genproto/googleapis/cloud/iap/v1#ListBrandsRequest.
}
resp
,
err
:=
c
.
ListBrands
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
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"
"google.golang.org/api/iterator"
iappb
"google.golang.org/genproto/googleapis/cloud/iap/v1"
)
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/google.golang.org/genproto/googleapis/cloud/iap/v1#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
}
}
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
"google.golang.org/genproto/googleapis/cloud/iap/v1"
)
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/google.golang.org/genproto/googleapis/cloud/iap/v1#ResetIdentityAwareProxyClientSecretRequest.
}
resp
,
err
:=
c
.
ResetIdentityAwareProxyClientSecret
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
TunnelDestGroupIterator
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
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
func
(
it
*
TunnelDestGroupIterator
)
PageInfo
()
*
iterator
.
PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.