package networksecurity
import "cloud.google.com/go/networksecurity/apiv1beta1"
Package networksecurity is an auto-generated package for the Network Security API.
NOTE: This package is in beta. It is not stable, and may be subject to changes.
General documentation
For information that is relevant for all client libraries please 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.
// go get cloud.google.com/go/networksecurity/apiv1beta1@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 := networksecurity.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 := &networksecuritypb.CreateAuthorizationPolicyRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/networksecurity/apiv1beta1/networksecuritypb#CreateAuthorizationPolicyRequest. } op, err := c.CreateAuthorizationPolicy(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.
Index ¶
- func DefaultAuthScopes() []string
- type AuthorizationPolicyIterator
- func (it *AuthorizationPolicyIterator) All() iter.Seq2[*networksecuritypb.AuthorizationPolicy, error]
- func (it *AuthorizationPolicyIterator) Next() (*networksecuritypb.AuthorizationPolicy, error)
- func (it *AuthorizationPolicyIterator) PageInfo() *iterator.PageInfo
- type CallOptions
- type Client
- func NewClient(ctx context.Context, opts ...option.ClientOption) (*Client, error)
- func NewRESTClient(ctx context.Context, opts ...option.ClientOption) (*Client, error)
- func (c *Client) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
- func (c *Client) Close() error
- func (c *Client) Connection() *grpc.ClientConn
- func (c *Client) CreateAuthorizationPolicy(ctx context.Context, req *networksecuritypb.CreateAuthorizationPolicyRequest, opts ...gax.CallOption) (*CreateAuthorizationPolicyOperation, error)
- func (c *Client) CreateAuthorizationPolicyOperation(name string) *CreateAuthorizationPolicyOperation
- func (c *Client) CreateClientTlsPolicy(ctx context.Context, req *networksecuritypb.CreateClientTlsPolicyRequest, opts ...gax.CallOption) (*CreateClientTlsPolicyOperation, error)
- func (c *Client) CreateClientTlsPolicyOperation(name string) *CreateClientTlsPolicyOperation
- func (c *Client) CreateServerTlsPolicy(ctx context.Context, req *networksecuritypb.CreateServerTlsPolicyRequest, opts ...gax.CallOption) (*CreateServerTlsPolicyOperation, error)
- func (c *Client) CreateServerTlsPolicyOperation(name string) *CreateServerTlsPolicyOperation
- func (c *Client) DeleteAuthorizationPolicy(ctx context.Context, req *networksecuritypb.DeleteAuthorizationPolicyRequest, opts ...gax.CallOption) (*DeleteAuthorizationPolicyOperation, error)
- func (c *Client) DeleteAuthorizationPolicyOperation(name string) *DeleteAuthorizationPolicyOperation
- func (c *Client) DeleteClientTlsPolicy(ctx context.Context, req *networksecuritypb.DeleteClientTlsPolicyRequest, opts ...gax.CallOption) (*DeleteClientTlsPolicyOperation, error)
- func (c *Client) DeleteClientTlsPolicyOperation(name string) *DeleteClientTlsPolicyOperation
- func (c *Client) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error
- func (c *Client) DeleteServerTlsPolicy(ctx context.Context, req *networksecuritypb.DeleteServerTlsPolicyRequest, opts ...gax.CallOption) (*DeleteServerTlsPolicyOperation, error)
- func (c *Client) DeleteServerTlsPolicyOperation(name string) *DeleteServerTlsPolicyOperation
- func (c *Client) GetAuthorizationPolicy(ctx context.Context, req *networksecuritypb.GetAuthorizationPolicyRequest, opts ...gax.CallOption) (*networksecuritypb.AuthorizationPolicy, error)
- func (c *Client) GetClientTlsPolicy(ctx context.Context, req *networksecuritypb.GetClientTlsPolicyRequest, opts ...gax.CallOption) (*networksecuritypb.ClientTlsPolicy, error)
- func (c *Client) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)
- func (c *Client) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)
- func (c *Client) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
- func (c *Client) GetServerTlsPolicy(ctx context.Context, req *networksecuritypb.GetServerTlsPolicyRequest, opts ...gax.CallOption) (*networksecuritypb.ServerTlsPolicy, error)
- func (c *Client) ListAuthorizationPolicies(ctx context.Context, req *networksecuritypb.ListAuthorizationPoliciesRequest, opts ...gax.CallOption) *AuthorizationPolicyIterator
- func (c *Client) ListClientTlsPolicies(ctx context.Context, req *networksecuritypb.ListClientTlsPoliciesRequest, opts ...gax.CallOption) *ClientTlsPolicyIterator
- func (c *Client) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator
- func (c *Client) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
- func (c *Client) ListServerTlsPolicies(ctx context.Context, req *networksecuritypb.ListServerTlsPoliciesRequest, opts ...gax.CallOption) *ServerTlsPolicyIterator
- func (c *Client) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)
- func (c *Client) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, opts ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error)
- func (c *Client) UpdateAuthorizationPolicy(ctx context.Context, req *networksecuritypb.UpdateAuthorizationPolicyRequest, opts ...gax.CallOption) (*UpdateAuthorizationPolicyOperation, error)
- func (c *Client) UpdateAuthorizationPolicyOperation(name string) *UpdateAuthorizationPolicyOperation
- func (c *Client) UpdateClientTlsPolicy(ctx context.Context, req *networksecuritypb.UpdateClientTlsPolicyRequest, opts ...gax.CallOption) (*UpdateClientTlsPolicyOperation, error)
- func (c *Client) UpdateClientTlsPolicyOperation(name string) *UpdateClientTlsPolicyOperation
- func (c *Client) UpdateServerTlsPolicy(ctx context.Context, req *networksecuritypb.UpdateServerTlsPolicyRequest, opts ...gax.CallOption) (*UpdateServerTlsPolicyOperation, error)
- func (c *Client) UpdateServerTlsPolicyOperation(name string) *UpdateServerTlsPolicyOperation
- type ClientTlsPolicyIterator
- func (it *ClientTlsPolicyIterator) All() iter.Seq2[*networksecuritypb.ClientTlsPolicy, error]
- func (it *ClientTlsPolicyIterator) Next() (*networksecuritypb.ClientTlsPolicy, error)
- func (it *ClientTlsPolicyIterator) PageInfo() *iterator.PageInfo
- type CreateAuthorizationPolicyOperation
- func (op *CreateAuthorizationPolicyOperation) Done() bool
- func (op *CreateAuthorizationPolicyOperation) Metadata() (*networksecuritypb.OperationMetadata, error)
- func (op *CreateAuthorizationPolicyOperation) Name() string
- func (op *CreateAuthorizationPolicyOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*networksecuritypb.AuthorizationPolicy, error)
- func (op *CreateAuthorizationPolicyOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*networksecuritypb.AuthorizationPolicy, error)
- type CreateClientTlsPolicyOperation
- func (op *CreateClientTlsPolicyOperation) Done() bool
- func (op *CreateClientTlsPolicyOperation) Metadata() (*networksecuritypb.OperationMetadata, error)
- func (op *CreateClientTlsPolicyOperation) Name() string
- func (op *CreateClientTlsPolicyOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*networksecuritypb.ClientTlsPolicy, error)
- func (op *CreateClientTlsPolicyOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*networksecuritypb.ClientTlsPolicy, error)
- type CreateServerTlsPolicyOperation
- func (op *CreateServerTlsPolicyOperation) Done() bool
- func (op *CreateServerTlsPolicyOperation) Metadata() (*networksecuritypb.OperationMetadata, error)
- func (op *CreateServerTlsPolicyOperation) Name() string
- func (op *CreateServerTlsPolicyOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*networksecuritypb.ServerTlsPolicy, error)
- func (op *CreateServerTlsPolicyOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*networksecuritypb.ServerTlsPolicy, error)
- type DeleteAuthorizationPolicyOperation
- func (op *DeleteAuthorizationPolicyOperation) Done() bool
- func (op *DeleteAuthorizationPolicyOperation) Metadata() (*networksecuritypb.OperationMetadata, error)
- func (op *DeleteAuthorizationPolicyOperation) Name() string
- func (op *DeleteAuthorizationPolicyOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
- func (op *DeleteAuthorizationPolicyOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
- type DeleteClientTlsPolicyOperation
- func (op *DeleteClientTlsPolicyOperation) Done() bool
- func (op *DeleteClientTlsPolicyOperation) Metadata() (*networksecuritypb.OperationMetadata, error)
- func (op *DeleteClientTlsPolicyOperation) Name() string
- func (op *DeleteClientTlsPolicyOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
- func (op *DeleteClientTlsPolicyOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
- type DeleteServerTlsPolicyOperation
- func (op *DeleteServerTlsPolicyOperation) Done() bool
- func (op *DeleteServerTlsPolicyOperation) Metadata() (*networksecuritypb.OperationMetadata, error)
- func (op *DeleteServerTlsPolicyOperation) Name() string
- func (op *DeleteServerTlsPolicyOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
- func (op *DeleteServerTlsPolicyOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
- type LocationIterator
- func (it *LocationIterator) All() iter.Seq2[*locationpb.Location, error]
- func (it *LocationIterator) Next() (*locationpb.Location, error)
- func (it *LocationIterator) PageInfo() *iterator.PageInfo
- type OperationIterator
- func (it *OperationIterator) All() iter.Seq2[*longrunningpb.Operation, error]
- func (it *OperationIterator) Next() (*longrunningpb.Operation, error)
- func (it *OperationIterator) PageInfo() *iterator.PageInfo
- type ServerTlsPolicyIterator
- func (it *ServerTlsPolicyIterator) All() iter.Seq2[*networksecuritypb.ServerTlsPolicy, error]
- func (it *ServerTlsPolicyIterator) Next() (*networksecuritypb.ServerTlsPolicy, error)
- func (it *ServerTlsPolicyIterator) PageInfo() *iterator.PageInfo
- type UpdateAuthorizationPolicyOperation
- func (op *UpdateAuthorizationPolicyOperation) Done() bool
- func (op *UpdateAuthorizationPolicyOperation) Metadata() (*networksecuritypb.OperationMetadata, error)
- func (op *UpdateAuthorizationPolicyOperation) Name() string
- func (op *UpdateAuthorizationPolicyOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*networksecuritypb.AuthorizationPolicy, error)
- func (op *UpdateAuthorizationPolicyOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*networksecuritypb.AuthorizationPolicy, error)
- type UpdateClientTlsPolicyOperation
- func (op *UpdateClientTlsPolicyOperation) Done() bool
- func (op *UpdateClientTlsPolicyOperation) Metadata() (*networksecuritypb.OperationMetadata, error)
- func (op *UpdateClientTlsPolicyOperation) Name() string
- func (op *UpdateClientTlsPolicyOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*networksecuritypb.ClientTlsPolicy, error)
- func (op *UpdateClientTlsPolicyOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*networksecuritypb.ClientTlsPolicy, error)
- type UpdateServerTlsPolicyOperation
- func (op *UpdateServerTlsPolicyOperation) Done() bool
- func (op *UpdateServerTlsPolicyOperation) Metadata() (*networksecuritypb.OperationMetadata, error)
- func (op *UpdateServerTlsPolicyOperation) Name() string
- func (op *UpdateServerTlsPolicyOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*networksecuritypb.ServerTlsPolicy, error)
- func (op *UpdateServerTlsPolicyOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*networksecuritypb.ServerTlsPolicy, error)
Examples ¶
- Client.CancelOperation
- Client.CreateAuthorizationPolicy
- Client.CreateClientTlsPolicy
- Client.CreateServerTlsPolicy
- Client.DeleteAuthorizationPolicy
- Client.DeleteClientTlsPolicy
- Client.DeleteOperation
- Client.DeleteServerTlsPolicy
- Client.GetAuthorizationPolicy
- Client.GetClientTlsPolicy
- Client.GetIamPolicy
- Client.GetLocation
- Client.GetOperation
- Client.GetServerTlsPolicy
- Client.ListAuthorizationPolicies
- Client.ListAuthorizationPolicies (All)
- Client.ListClientTlsPolicies
- Client.ListClientTlsPolicies (All)
- Client.ListLocations
- Client.ListLocations (All)
- Client.ListOperations
- Client.ListOperations (All)
- Client.ListServerTlsPolicies
- Client.ListServerTlsPolicies (All)
- Client.SetIamPolicy
- Client.TestIamPermissions
- Client.UpdateAuthorizationPolicy
- Client.UpdateClientTlsPolicy
- Client.UpdateServerTlsPolicy
- NewClient
- NewRESTClient
Functions ¶
func DefaultAuthScopes ¶
func DefaultAuthScopes() []string
DefaultAuthScopes reports the default set of authentication scopes to use with this package.
Types ¶
type AuthorizationPolicyIterator ¶
type AuthorizationPolicyIterator 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 []*networksecuritypb.AuthorizationPolicy, nextPageToken string, err error) // contains filtered or unexported fields }
AuthorizationPolicyIterator manages a stream of *networksecuritypb.AuthorizationPolicy.
func (*AuthorizationPolicyIterator) All ¶
func (it *AuthorizationPolicyIterator) All() iter.Seq2[*networksecuritypb.AuthorizationPolicy, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*AuthorizationPolicyIterator) Next ¶
func (it *AuthorizationPolicyIterator) Next() (*networksecuritypb.AuthorizationPolicy, 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 (*AuthorizationPolicyIterator) PageInfo ¶
func (it *AuthorizationPolicyIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type CallOptions ¶
type CallOptions struct { ListAuthorizationPolicies []gax.CallOption GetAuthorizationPolicy []gax.CallOption CreateAuthorizationPolicy []gax.CallOption UpdateAuthorizationPolicy []gax.CallOption DeleteAuthorizationPolicy []gax.CallOption ListServerTlsPolicies []gax.CallOption GetServerTlsPolicy []gax.CallOption CreateServerTlsPolicy []gax.CallOption UpdateServerTlsPolicy []gax.CallOption DeleteServerTlsPolicy []gax.CallOption ListClientTlsPolicies []gax.CallOption GetClientTlsPolicy []gax.CallOption CreateClientTlsPolicy []gax.CallOption UpdateClientTlsPolicy []gax.CallOption DeleteClientTlsPolicy []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.
type 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 Network Security API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Network Security API provides resources to configure authentication and authorization policies. Refer to per API resource documentation for more information.
func NewClient ¶
NewClient creates a new network security client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
Network Security API provides resources to configure authentication and
authorization policies. Refer to per API resource documentation for more
information.
Code:play
Example¶
package main
import (
"context"
networksecurity "cloud.google.com/go/networksecurity/apiv1beta1"
)
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 := networksecurity.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func NewRESTClient ¶
NewRESTClient creates a new network security rest client.
Network Security API provides resources to configure authentication and
authorization policies. Refer to per API resource documentation for more
information.
Code:play
Example¶
package main
import (
"context"
networksecurity "cloud.google.com/go/networksecurity/apiv1beta1"
)
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 := networksecurity.NewRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*Client) CancelOperation ¶
func (c *Client) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
CancelOperation is a utility method from google.longrunning.Operations.
Code:play
Example¶
package main
import (
"context"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
networksecurity "cloud.google.com/go/networksecurity/apiv1beta1"
)
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 := networksecurity.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 ¶
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*Client) Connection ¶
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) CreateAuthorizationPolicy ¶
func (c *Client) CreateAuthorizationPolicy(ctx context.Context, req *networksecuritypb.CreateAuthorizationPolicyRequest, opts ...gax.CallOption) (*CreateAuthorizationPolicyOperation, error)
CreateAuthorizationPolicy creates a new AuthorizationPolicy in a given project and location.
Code:play
Example¶
package main
import (
"context"
networksecurity "cloud.google.com/go/networksecurity/apiv1beta1"
networksecuritypb "cloud.google.com/go/networksecurity/apiv1beta1/networksecuritypb"
)
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 := networksecurity.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networksecuritypb.CreateAuthorizationPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networksecurity/apiv1beta1/networksecuritypb#CreateAuthorizationPolicyRequest.
}
op, err := c.CreateAuthorizationPolicy(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) CreateAuthorizationPolicyOperation ¶
func (c *Client) CreateAuthorizationPolicyOperation(name string) *CreateAuthorizationPolicyOperation
CreateAuthorizationPolicyOperation returns a new CreateAuthorizationPolicyOperation from a given name. The name must be that of a previously created CreateAuthorizationPolicyOperation, possibly from a different process.
func (*Client) CreateClientTlsPolicy ¶
func (c *Client) CreateClientTlsPolicy(ctx context.Context, req *networksecuritypb.CreateClientTlsPolicyRequest, opts ...gax.CallOption) (*CreateClientTlsPolicyOperation, error)
CreateClientTlsPolicy creates a new ClientTlsPolicy in a given project and location.
Code:play
Example¶
package main
import (
"context"
networksecurity "cloud.google.com/go/networksecurity/apiv1beta1"
networksecuritypb "cloud.google.com/go/networksecurity/apiv1beta1/networksecuritypb"
)
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 := networksecurity.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networksecuritypb.CreateClientTlsPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networksecurity/apiv1beta1/networksecuritypb#CreateClientTlsPolicyRequest.
}
op, err := c.CreateClientTlsPolicy(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) CreateClientTlsPolicyOperation ¶
func (c *Client) CreateClientTlsPolicyOperation(name string) *CreateClientTlsPolicyOperation
CreateClientTlsPolicyOperation returns a new CreateClientTlsPolicyOperation from a given name. The name must be that of a previously created CreateClientTlsPolicyOperation, possibly from a different process.
func (*Client) CreateServerTlsPolicy ¶
func (c *Client) CreateServerTlsPolicy(ctx context.Context, req *networksecuritypb.CreateServerTlsPolicyRequest, opts ...gax.CallOption) (*CreateServerTlsPolicyOperation, error)
CreateServerTlsPolicy creates a new ServerTlsPolicy in a given project and location.
Code:play
Example¶
package main
import (
"context"
networksecurity "cloud.google.com/go/networksecurity/apiv1beta1"
networksecuritypb "cloud.google.com/go/networksecurity/apiv1beta1/networksecuritypb"
)
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 := networksecurity.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networksecuritypb.CreateServerTlsPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networksecurity/apiv1beta1/networksecuritypb#CreateServerTlsPolicyRequest.
}
op, err := c.CreateServerTlsPolicy(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) CreateServerTlsPolicyOperation ¶
func (c *Client) CreateServerTlsPolicyOperation(name string) *CreateServerTlsPolicyOperation
CreateServerTlsPolicyOperation returns a new CreateServerTlsPolicyOperation from a given name. The name must be that of a previously created CreateServerTlsPolicyOperation, possibly from a different process.
func (*Client) DeleteAuthorizationPolicy ¶
func (c *Client) DeleteAuthorizationPolicy(ctx context.Context, req *networksecuritypb.DeleteAuthorizationPolicyRequest, opts ...gax.CallOption) (*DeleteAuthorizationPolicyOperation, error)
DeleteAuthorizationPolicy deletes a single AuthorizationPolicy.
Code:play
Example¶
package main
import (
"context"
networksecurity "cloud.google.com/go/networksecurity/apiv1beta1"
networksecuritypb "cloud.google.com/go/networksecurity/apiv1beta1/networksecuritypb"
)
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 := networksecurity.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networksecuritypb.DeleteAuthorizationPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networksecurity/apiv1beta1/networksecuritypb#DeleteAuthorizationPolicyRequest.
}
op, err := c.DeleteAuthorizationPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*Client) DeleteAuthorizationPolicyOperation ¶
func (c *Client) DeleteAuthorizationPolicyOperation(name string) *DeleteAuthorizationPolicyOperation
DeleteAuthorizationPolicyOperation returns a new DeleteAuthorizationPolicyOperation from a given name. The name must be that of a previously created DeleteAuthorizationPolicyOperation, possibly from a different process.
func (*Client) DeleteClientTlsPolicy ¶
func (c *Client) DeleteClientTlsPolicy(ctx context.Context, req *networksecuritypb.DeleteClientTlsPolicyRequest, opts ...gax.CallOption) (*DeleteClientTlsPolicyOperation, error)
DeleteClientTlsPolicy deletes a single ClientTlsPolicy.
Code:play
Example¶
package main
import (
"context"
networksecurity "cloud.google.com/go/networksecurity/apiv1beta1"
networksecuritypb "cloud.google.com/go/networksecurity/apiv1beta1/networksecuritypb"
)
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 := networksecurity.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networksecuritypb.DeleteClientTlsPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networksecurity/apiv1beta1/networksecuritypb#DeleteClientTlsPolicyRequest.
}
op, err := c.DeleteClientTlsPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*Client) DeleteClientTlsPolicyOperation ¶
func (c *Client) DeleteClientTlsPolicyOperation(name string) *DeleteClientTlsPolicyOperation
DeleteClientTlsPolicyOperation returns a new DeleteClientTlsPolicyOperation from a given name. The name must be that of a previously created DeleteClientTlsPolicyOperation, possibly from a different process.
func (*Client) DeleteOperation ¶
func (c *Client) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error
DeleteOperation is a utility method from google.longrunning.Operations.
Code:play
Example¶
package main
import (
"context"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
networksecurity "cloud.google.com/go/networksecurity/apiv1beta1"
)
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 := networksecurity.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) DeleteServerTlsPolicy ¶
func (c *Client) DeleteServerTlsPolicy(ctx context.Context, req *networksecuritypb.DeleteServerTlsPolicyRequest, opts ...gax.CallOption) (*DeleteServerTlsPolicyOperation, error)
DeleteServerTlsPolicy deletes a single ServerTlsPolicy.
Code:play
Example¶
package main
import (
"context"
networksecurity "cloud.google.com/go/networksecurity/apiv1beta1"
networksecuritypb "cloud.google.com/go/networksecurity/apiv1beta1/networksecuritypb"
)
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 := networksecurity.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networksecuritypb.DeleteServerTlsPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networksecurity/apiv1beta1/networksecuritypb#DeleteServerTlsPolicyRequest.
}
op, err := c.DeleteServerTlsPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*Client) DeleteServerTlsPolicyOperation ¶
func (c *Client) DeleteServerTlsPolicyOperation(name string) *DeleteServerTlsPolicyOperation
DeleteServerTlsPolicyOperation returns a new DeleteServerTlsPolicyOperation from a given name. The name must be that of a previously created DeleteServerTlsPolicyOperation, possibly from a different process.
func (*Client) GetAuthorizationPolicy ¶
func (c *Client) GetAuthorizationPolicy(ctx context.Context, req *networksecuritypb.GetAuthorizationPolicyRequest, opts ...gax.CallOption) (*networksecuritypb.AuthorizationPolicy, error)
GetAuthorizationPolicy gets details of a single AuthorizationPolicy.
Code:play
Example¶
package main
import (
"context"
networksecurity "cloud.google.com/go/networksecurity/apiv1beta1"
networksecuritypb "cloud.google.com/go/networksecurity/apiv1beta1/networksecuritypb"
)
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 := networksecurity.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networksecuritypb.GetAuthorizationPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networksecurity/apiv1beta1/networksecuritypb#GetAuthorizationPolicyRequest.
}
resp, err := c.GetAuthorizationPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) GetClientTlsPolicy ¶
func (c *Client) GetClientTlsPolicy(ctx context.Context, req *networksecuritypb.GetClientTlsPolicyRequest, opts ...gax.CallOption) (*networksecuritypb.ClientTlsPolicy, error)
GetClientTlsPolicy gets details of a single ClientTlsPolicy.
Code:play
Example¶
package main
import (
"context"
networksecurity "cloud.google.com/go/networksecurity/apiv1beta1"
networksecuritypb "cloud.google.com/go/networksecurity/apiv1beta1/networksecuritypb"
)
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 := networksecurity.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networksecuritypb.GetClientTlsPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networksecurity/apiv1beta1/networksecuritypb#GetClientTlsPolicyRequest.
}
resp, err := c.GetClientTlsPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) GetIamPolicy ¶
func (c *Client) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)
GetIamPolicy gets the access control policy for a resource. Returns an empty policy
if the resource exists and does not have a policy set.
Code:play
Example¶
package main
import (
"context"
iampb "cloud.google.com/go/iam/apiv1/iampb"
networksecurity "cloud.google.com/go/networksecurity/apiv1beta1"
)
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 := networksecurity.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) GetLocation ¶
func (c *Client) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)
GetLocation gets information about a location.
Code:play
Example¶
package main
import (
"context"
networksecurity "cloud.google.com/go/networksecurity/apiv1beta1"
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 := networksecurity.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &locationpb.GetLocationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#GetLocationRequest.
}
resp, err := c.GetLocation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) GetOperation ¶
func (c *Client) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
GetOperation is a utility method from google.longrunning.Operations.
Code:play
Example¶
package main
import (
"context"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
networksecurity "cloud.google.com/go/networksecurity/apiv1beta1"
)
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 := networksecurity.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) GetServerTlsPolicy ¶
func (c *Client) GetServerTlsPolicy(ctx context.Context, req *networksecuritypb.GetServerTlsPolicyRequest, opts ...gax.CallOption) (*networksecuritypb.ServerTlsPolicy, error)
GetServerTlsPolicy gets details of a single ServerTlsPolicy.
Code:play
Example¶
package main
import (
"context"
networksecurity "cloud.google.com/go/networksecurity/apiv1beta1"
networksecuritypb "cloud.google.com/go/networksecurity/apiv1beta1/networksecuritypb"
)
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 := networksecurity.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networksecuritypb.GetServerTlsPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networksecurity/apiv1beta1/networksecuritypb#GetServerTlsPolicyRequest.
}
resp, err := c.GetServerTlsPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) ListAuthorizationPolicies ¶
func (c *Client) ListAuthorizationPolicies(ctx context.Context, req *networksecuritypb.ListAuthorizationPoliciesRequest, opts ...gax.CallOption) *AuthorizationPolicyIterator
ListAuthorizationPolicies lists AuthorizationPolicies in a given project and location.
Code:play
Code:play
Example¶
package main
import (
"context"
networksecurity "cloud.google.com/go/networksecurity/apiv1beta1"
networksecuritypb "cloud.google.com/go/networksecurity/apiv1beta1/networksecuritypb"
"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 := networksecurity.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networksecuritypb.ListAuthorizationPoliciesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networksecurity/apiv1beta1/networksecuritypb#ListAuthorizationPoliciesRequest.
}
it := c.ListAuthorizationPolicies(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.(*networksecuritypb.ListAuthorizationPoliciesResponse)
}
}
Example (All)¶
package main
import (
"context"
networksecurity "cloud.google.com/go/networksecurity/apiv1beta1"
networksecuritypb "cloud.google.com/go/networksecurity/apiv1beta1/networksecuritypb"
)
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 := networksecurity.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networksecuritypb.ListAuthorizationPoliciesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networksecurity/apiv1beta1/networksecuritypb#ListAuthorizationPoliciesRequest.
}
for resp, err := range c.ListAuthorizationPolicies(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) ListClientTlsPolicies ¶
func (c *Client) ListClientTlsPolicies(ctx context.Context, req *networksecuritypb.ListClientTlsPoliciesRequest, opts ...gax.CallOption) *ClientTlsPolicyIterator
ListClientTlsPolicies lists ClientTlsPolicies in a given project and location.
Code:play
Code:play
Example¶
package main
import (
"context"
networksecurity "cloud.google.com/go/networksecurity/apiv1beta1"
networksecuritypb "cloud.google.com/go/networksecurity/apiv1beta1/networksecuritypb"
"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 := networksecurity.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networksecuritypb.ListClientTlsPoliciesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networksecurity/apiv1beta1/networksecuritypb#ListClientTlsPoliciesRequest.
}
it := c.ListClientTlsPolicies(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.(*networksecuritypb.ListClientTlsPoliciesResponse)
}
}
Example (All)¶
package main
import (
"context"
networksecurity "cloud.google.com/go/networksecurity/apiv1beta1"
networksecuritypb "cloud.google.com/go/networksecurity/apiv1beta1/networksecuritypb"
)
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 := networksecurity.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networksecuritypb.ListClientTlsPoliciesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networksecurity/apiv1beta1/networksecuritypb#ListClientTlsPoliciesRequest.
}
for resp, err := range c.ListClientTlsPolicies(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*Client) ListLocations ¶
func (c *Client) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator
ListLocations lists information about the supported locations for this service.
Code:play
Code:play
Example¶
package main
import (
"context"
networksecurity "cloud.google.com/go/networksecurity/apiv1beta1"
"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 := networksecurity.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &locationpb.ListLocationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.
}
it := c.ListLocations(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*locationpb.ListLocationsResponse)
}
}
Example (All)¶
package main
import (
"context"
networksecurity "cloud.google.com/go/networksecurity/apiv1beta1"
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 := networksecurity.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &locationpb.ListLocationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.
}
for resp, err := range c.ListLocations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*Client) ListOperations ¶
func (c *Client) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
ListOperations is a utility method from google.longrunning.Operations.
Code:play
Code:play
Example¶
package main
import (
"context"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
networksecurity "cloud.google.com/go/networksecurity/apiv1beta1"
"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 := networksecurity.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
it := c.ListOperations(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*longrunningpb.ListOperationsResponse)
}
}
Example (All)¶
package main
import (
"context"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
networksecurity "cloud.google.com/go/networksecurity/apiv1beta1"
)
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 := networksecurity.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) ListServerTlsPolicies ¶
func (c *Client) ListServerTlsPolicies(ctx context.Context, req *networksecuritypb.ListServerTlsPoliciesRequest, opts ...gax.CallOption) *ServerTlsPolicyIterator
ListServerTlsPolicies lists ServerTlsPolicies in a given project and location.
Code:play
Code:play
Example¶
package main
import (
"context"
networksecurity "cloud.google.com/go/networksecurity/apiv1beta1"
networksecuritypb "cloud.google.com/go/networksecurity/apiv1beta1/networksecuritypb"
"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 := networksecurity.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networksecuritypb.ListServerTlsPoliciesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networksecurity/apiv1beta1/networksecuritypb#ListServerTlsPoliciesRequest.
}
it := c.ListServerTlsPolicies(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.(*networksecuritypb.ListServerTlsPoliciesResponse)
}
}
Example (All)¶
package main
import (
"context"
networksecurity "cloud.google.com/go/networksecurity/apiv1beta1"
networksecuritypb "cloud.google.com/go/networksecurity/apiv1beta1/networksecuritypb"
)
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 := networksecurity.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networksecuritypb.ListServerTlsPoliciesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networksecurity/apiv1beta1/networksecuritypb#ListServerTlsPoliciesRequest.
}
for resp, err := range c.ListServerTlsPolicies(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 ¶
func (c *Client) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)
SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy.
Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED
errors.
Code:play
Example¶
package main
import (
"context"
iampb "cloud.google.com/go/iam/apiv1/iampb"
networksecurity "cloud.google.com/go/networksecurity/apiv1beta1"
)
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 := networksecurity.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) TestIamPermissions ¶
func (c *Client) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, opts ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error)
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.
Code:play
Example¶
package main
import (
"context"
iampb "cloud.google.com/go/iam/apiv1/iampb"
networksecurity "cloud.google.com/go/networksecurity/apiv1beta1"
)
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 := networksecurity.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) UpdateAuthorizationPolicy ¶
func (c *Client) UpdateAuthorizationPolicy(ctx context.Context, req *networksecuritypb.UpdateAuthorizationPolicyRequest, opts ...gax.CallOption) (*UpdateAuthorizationPolicyOperation, error)
UpdateAuthorizationPolicy updates the parameters of a single AuthorizationPolicy.
Code:play
Example¶
package main
import (
"context"
networksecurity "cloud.google.com/go/networksecurity/apiv1beta1"
networksecuritypb "cloud.google.com/go/networksecurity/apiv1beta1/networksecuritypb"
)
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 := networksecurity.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networksecuritypb.UpdateAuthorizationPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networksecurity/apiv1beta1/networksecuritypb#UpdateAuthorizationPolicyRequest.
}
op, err := c.UpdateAuthorizationPolicy(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) UpdateAuthorizationPolicyOperation ¶
func (c *Client) UpdateAuthorizationPolicyOperation(name string) *UpdateAuthorizationPolicyOperation
UpdateAuthorizationPolicyOperation returns a new UpdateAuthorizationPolicyOperation from a given name. The name must be that of a previously created UpdateAuthorizationPolicyOperation, possibly from a different process.
func (*Client) UpdateClientTlsPolicy ¶
func (c *Client) UpdateClientTlsPolicy(ctx context.Context, req *networksecuritypb.UpdateClientTlsPolicyRequest, opts ...gax.CallOption) (*UpdateClientTlsPolicyOperation, error)
UpdateClientTlsPolicy updates the parameters of a single ClientTlsPolicy.
Code:play
Example¶
package main
import (
"context"
networksecurity "cloud.google.com/go/networksecurity/apiv1beta1"
networksecuritypb "cloud.google.com/go/networksecurity/apiv1beta1/networksecuritypb"
)
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 := networksecurity.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networksecuritypb.UpdateClientTlsPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networksecurity/apiv1beta1/networksecuritypb#UpdateClientTlsPolicyRequest.
}
op, err := c.UpdateClientTlsPolicy(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) UpdateClientTlsPolicyOperation ¶
func (c *Client) UpdateClientTlsPolicyOperation(name string) *UpdateClientTlsPolicyOperation
UpdateClientTlsPolicyOperation returns a new UpdateClientTlsPolicyOperation from a given name. The name must be that of a previously created UpdateClientTlsPolicyOperation, possibly from a different process.
func (*Client) UpdateServerTlsPolicy ¶
func (c *Client) UpdateServerTlsPolicy(ctx context.Context, req *networksecuritypb.UpdateServerTlsPolicyRequest, opts ...gax.CallOption) (*UpdateServerTlsPolicyOperation, error)
UpdateServerTlsPolicy updates the parameters of a single ServerTlsPolicy.
Code:play
Example¶
package main
import (
"context"
networksecurity "cloud.google.com/go/networksecurity/apiv1beta1"
networksecuritypb "cloud.google.com/go/networksecurity/apiv1beta1/networksecuritypb"
)
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 := networksecurity.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networksecuritypb.UpdateServerTlsPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networksecurity/apiv1beta1/networksecuritypb#UpdateServerTlsPolicyRequest.
}
op, err := c.UpdateServerTlsPolicy(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) UpdateServerTlsPolicyOperation ¶
func (c *Client) UpdateServerTlsPolicyOperation(name string) *UpdateServerTlsPolicyOperation
UpdateServerTlsPolicyOperation returns a new UpdateServerTlsPolicyOperation from a given name. The name must be that of a previously created UpdateServerTlsPolicyOperation, possibly from a different process.
type ClientTlsPolicyIterator ¶
type ClientTlsPolicyIterator 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 []*networksecuritypb.ClientTlsPolicy, nextPageToken string, err error) // contains filtered or unexported fields }
ClientTlsPolicyIterator manages a stream of *networksecuritypb.ClientTlsPolicy.
func (*ClientTlsPolicyIterator) All ¶
func (it *ClientTlsPolicyIterator) All() iter.Seq2[*networksecuritypb.ClientTlsPolicy, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*ClientTlsPolicyIterator) Next ¶
func (it *ClientTlsPolicyIterator) Next() (*networksecuritypb.ClientTlsPolicy, 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 (*ClientTlsPolicyIterator) PageInfo ¶
func (it *ClientTlsPolicyIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type CreateAuthorizationPolicyOperation ¶
type CreateAuthorizationPolicyOperation struct {
// contains filtered or unexported fields
}
CreateAuthorizationPolicyOperation manages a long-running operation from CreateAuthorizationPolicy.
func (*CreateAuthorizationPolicyOperation) Done ¶
func (op *CreateAuthorizationPolicyOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*CreateAuthorizationPolicyOperation) Metadata ¶
func (op *CreateAuthorizationPolicyOperation) Metadata() (*networksecuritypb.OperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*CreateAuthorizationPolicyOperation) Name ¶
func (op *CreateAuthorizationPolicyOperation) Name() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*CreateAuthorizationPolicyOperation) Poll ¶
func (op *CreateAuthorizationPolicyOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*networksecuritypb.AuthorizationPolicy, error)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds 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 (*CreateAuthorizationPolicyOperation) Wait ¶
func (op *CreateAuthorizationPolicyOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*networksecuritypb.AuthorizationPolicy, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type CreateClientTlsPolicyOperation ¶
type CreateClientTlsPolicyOperation struct {
// contains filtered or unexported fields
}
CreateClientTlsPolicyOperation manages a long-running operation from CreateClientTlsPolicy.
func (*CreateClientTlsPolicyOperation) Done ¶
func (op *CreateClientTlsPolicyOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*CreateClientTlsPolicyOperation) Metadata ¶
func (op *CreateClientTlsPolicyOperation) Metadata() (*networksecuritypb.OperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*CreateClientTlsPolicyOperation) Name ¶
func (op *CreateClientTlsPolicyOperation) Name() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*CreateClientTlsPolicyOperation) Poll ¶
func (op *CreateClientTlsPolicyOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*networksecuritypb.ClientTlsPolicy, error)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds 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 (*CreateClientTlsPolicyOperation) Wait ¶
func (op *CreateClientTlsPolicyOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*networksecuritypb.ClientTlsPolicy, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type CreateServerTlsPolicyOperation ¶
type CreateServerTlsPolicyOperation struct {
// contains filtered or unexported fields
}
CreateServerTlsPolicyOperation manages a long-running operation from CreateServerTlsPolicy.
func (*CreateServerTlsPolicyOperation) Done ¶
func (op *CreateServerTlsPolicyOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*CreateServerTlsPolicyOperation) Metadata ¶
func (op *CreateServerTlsPolicyOperation) Metadata() (*networksecuritypb.OperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*CreateServerTlsPolicyOperation) Name ¶
func (op *CreateServerTlsPolicyOperation) Name() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*CreateServerTlsPolicyOperation) Poll ¶
func (op *CreateServerTlsPolicyOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*networksecuritypb.ServerTlsPolicy, error)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds 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 (*CreateServerTlsPolicyOperation) Wait ¶
func (op *CreateServerTlsPolicyOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*networksecuritypb.ServerTlsPolicy, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type DeleteAuthorizationPolicyOperation ¶
type DeleteAuthorizationPolicyOperation struct {
// contains filtered or unexported fields
}
DeleteAuthorizationPolicyOperation manages a long-running operation from DeleteAuthorizationPolicy.
func (*DeleteAuthorizationPolicyOperation) Done ¶
func (op *DeleteAuthorizationPolicyOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*DeleteAuthorizationPolicyOperation) Metadata ¶
func (op *DeleteAuthorizationPolicyOperation) Metadata() (*networksecuritypb.OperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*DeleteAuthorizationPolicyOperation) Name ¶
func (op *DeleteAuthorizationPolicyOperation) Name() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*DeleteAuthorizationPolicyOperation) Poll ¶
func (op *DeleteAuthorizationPolicyOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds 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 (*DeleteAuthorizationPolicyOperation) Wait ¶
func (op *DeleteAuthorizationPolicyOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type DeleteClientTlsPolicyOperation ¶
type DeleteClientTlsPolicyOperation struct {
// contains filtered or unexported fields
}
DeleteClientTlsPolicyOperation manages a long-running operation from DeleteClientTlsPolicy.
func (*DeleteClientTlsPolicyOperation) Done ¶
func (op *DeleteClientTlsPolicyOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*DeleteClientTlsPolicyOperation) Metadata ¶
func (op *DeleteClientTlsPolicyOperation) Metadata() (*networksecuritypb.OperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*DeleteClientTlsPolicyOperation) Name ¶
func (op *DeleteClientTlsPolicyOperation) Name() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*DeleteClientTlsPolicyOperation) Poll ¶
func (op *DeleteClientTlsPolicyOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds 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 (*DeleteClientTlsPolicyOperation) Wait ¶
func (op *DeleteClientTlsPolicyOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type DeleteServerTlsPolicyOperation ¶
type DeleteServerTlsPolicyOperation struct {
// contains filtered or unexported fields
}
DeleteServerTlsPolicyOperation manages a long-running operation from DeleteServerTlsPolicy.
func (*DeleteServerTlsPolicyOperation) Done ¶
func (op *DeleteServerTlsPolicyOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*DeleteServerTlsPolicyOperation) Metadata ¶
func (op *DeleteServerTlsPolicyOperation) Metadata() (*networksecuritypb.OperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*DeleteServerTlsPolicyOperation) Name ¶
func (op *DeleteServerTlsPolicyOperation) Name() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*DeleteServerTlsPolicyOperation) Poll ¶
func (op *DeleteServerTlsPolicyOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds 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 (*DeleteServerTlsPolicyOperation) Wait ¶
func (op *DeleteServerTlsPolicyOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type 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 ¶
func (it *LocationIterator) Next() (*locationpb.Location, 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 (*LocationIterator) PageInfo ¶
func (it *LocationIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type 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 ¶
func (it *OperationIterator) Next() (*longrunningpb.Operation, 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 (*OperationIterator) PageInfo ¶
func (it *OperationIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type ServerTlsPolicyIterator ¶
type ServerTlsPolicyIterator 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 []*networksecuritypb.ServerTlsPolicy, nextPageToken string, err error) // contains filtered or unexported fields }
ServerTlsPolicyIterator manages a stream of *networksecuritypb.ServerTlsPolicy.
func (*ServerTlsPolicyIterator) All ¶
func (it *ServerTlsPolicyIterator) All() iter.Seq2[*networksecuritypb.ServerTlsPolicy, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*ServerTlsPolicyIterator) Next ¶
func (it *ServerTlsPolicyIterator) Next() (*networksecuritypb.ServerTlsPolicy, 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 (*ServerTlsPolicyIterator) PageInfo ¶
func (it *ServerTlsPolicyIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type UpdateAuthorizationPolicyOperation ¶
type UpdateAuthorizationPolicyOperation struct {
// contains filtered or unexported fields
}
UpdateAuthorizationPolicyOperation manages a long-running operation from UpdateAuthorizationPolicy.
func (*UpdateAuthorizationPolicyOperation) Done ¶
func (op *UpdateAuthorizationPolicyOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*UpdateAuthorizationPolicyOperation) Metadata ¶
func (op *UpdateAuthorizationPolicyOperation) Metadata() (*networksecuritypb.OperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*UpdateAuthorizationPolicyOperation) Name ¶
func (op *UpdateAuthorizationPolicyOperation) Name() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*UpdateAuthorizationPolicyOperation) Poll ¶
func (op *UpdateAuthorizationPolicyOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*networksecuritypb.AuthorizationPolicy, error)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds 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 (*UpdateAuthorizationPolicyOperation) Wait ¶
func (op *UpdateAuthorizationPolicyOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*networksecuritypb.AuthorizationPolicy, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type UpdateClientTlsPolicyOperation ¶
type UpdateClientTlsPolicyOperation struct {
// contains filtered or unexported fields
}
UpdateClientTlsPolicyOperation manages a long-running operation from UpdateClientTlsPolicy.
func (*UpdateClientTlsPolicyOperation) Done ¶
func (op *UpdateClientTlsPolicyOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*UpdateClientTlsPolicyOperation) Metadata ¶
func (op *UpdateClientTlsPolicyOperation) Metadata() (*networksecuritypb.OperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*UpdateClientTlsPolicyOperation) Name ¶
func (op *UpdateClientTlsPolicyOperation) Name() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*UpdateClientTlsPolicyOperation) Poll ¶
func (op *UpdateClientTlsPolicyOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*networksecuritypb.ClientTlsPolicy, error)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds 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 (*UpdateClientTlsPolicyOperation) Wait ¶
func (op *UpdateClientTlsPolicyOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*networksecuritypb.ClientTlsPolicy, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type UpdateServerTlsPolicyOperation ¶
type UpdateServerTlsPolicyOperation struct {
// contains filtered or unexported fields
}
UpdateServerTlsPolicyOperation manages a long-running operation from UpdateServerTlsPolicy.
func (*UpdateServerTlsPolicyOperation) Done ¶
func (op *UpdateServerTlsPolicyOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*UpdateServerTlsPolicyOperation) Metadata ¶
func (op *UpdateServerTlsPolicyOperation) Metadata() (*networksecuritypb.OperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*UpdateServerTlsPolicyOperation) Name ¶
func (op *UpdateServerTlsPolicyOperation) Name() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*UpdateServerTlsPolicyOperation) Poll ¶
func (op *UpdateServerTlsPolicyOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*networksecuritypb.ServerTlsPolicy, error)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds 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 (*UpdateServerTlsPolicyOperation) Wait ¶
func (op *UpdateServerTlsPolicyOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*networksecuritypb.ServerTlsPolicy, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
Source Files ¶
auxiliary.go auxiliary_go123.go doc.go helpers.go network_security_client.go version.go
Directories ¶
Path | Synopsis |
---|---|
apiv1beta1/networksecuritypb |
- Version
- v0.10.3 (latest)
- Published
- Jan 2, 2025
- Platform
- linux/amd64
- Imports
- 30 packages
- Last checked
- 5 days ago –
Tools for package owners.