chore(beyondcorp): start generating apiv1 (#6326)
feat(beyondcorp/appconnectors): start generating apiv1
feat(beyondcorp/appgateways): start generating apiv1
feat(beyondcorp/clientconnectorservices): start generating apiv1
feat(beyondcorp/clientgateways): start generating apiv1
diff --git a/beyondcorp/appconnectors/apiv1/app_connectors_client.go b/beyondcorp/appconnectors/apiv1/app_connectors_client.go
new file mode 100644
index 0000000..1df1011
--- /dev/null
+++ b/beyondcorp/appconnectors/apiv1/app_connectors_client.go
@@ -0,0 +1,1136 @@
+// Copyright 2022 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
+
+package appconnectors
+
+import (
+ "context"
+ "fmt"
+ "math"
+ "net/url"
+ "time"
+
+ "cloud.google.com/go/longrunning"
+ lroauto "cloud.google.com/go/longrunning/autogen"
+ gax "github.com/googleapis/gax-go/v2"
+ "google.golang.org/api/iterator"
+ "google.golang.org/api/option"
+ "google.golang.org/api/option/internaloption"
+ gtransport "google.golang.org/api/transport/grpc"
+ appconnectorspb "google.golang.org/genproto/googleapis/cloud/beyondcorp/appconnectors/v1"
+ locationpb "google.golang.org/genproto/googleapis/cloud/location"
+ iampb "google.golang.org/genproto/googleapis/iam/v1"
+ longrunningpb "google.golang.org/genproto/googleapis/longrunning"
+ "google.golang.org/grpc"
+ "google.golang.org/grpc/metadata"
+ "google.golang.org/protobuf/proto"
+)
+
+var newClientHook clientHook
+
+// CallOptions contains the retry settings for each method of Client.
+type CallOptions struct {
+ ListAppConnectors []gax.CallOption
+ GetAppConnector []gax.CallOption
+ CreateAppConnector []gax.CallOption
+ UpdateAppConnector []gax.CallOption
+ DeleteAppConnector []gax.CallOption
+ ReportStatus []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
+}
+
+func defaultGRPCClientOptions() []option.ClientOption {
+ return []option.ClientOption{
+ internaloption.WithDefaultEndpoint("beyondcorp.googleapis.com:443"),
+ internaloption.WithDefaultMTLSEndpoint("beyondcorp.mtls.googleapis.com:443"),
+ internaloption.WithDefaultAudience("https://beyondcorp.googleapis.com/"),
+ internaloption.WithDefaultScopes(DefaultAuthScopes()...),
+ internaloption.EnableJwtWithScope(),
+ option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
+ grpc.MaxCallRecvMsgSize(math.MaxInt32))),
+ }
+}
+
+func defaultCallOptions() *CallOptions {
+ return &CallOptions{
+ ListAppConnectors: []gax.CallOption{},
+ GetAppConnector: []gax.CallOption{},
+ CreateAppConnector: []gax.CallOption{},
+ UpdateAppConnector: []gax.CallOption{},
+ DeleteAppConnector: []gax.CallOption{},
+ ReportStatus: []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{},
+ }
+}
+
+// internalClient is an interface that defines the methods available from BeyondCorp API.
+type internalClient interface {
+ Close() error
+ setGoogleClientInfo(...string)
+ Connection() *grpc.ClientConn
+ ListAppConnectors(context.Context, *appconnectorspb.ListAppConnectorsRequest, ...gax.CallOption) *AppConnectorIterator
+ GetAppConnector(context.Context, *appconnectorspb.GetAppConnectorRequest, ...gax.CallOption) (*appconnectorspb.AppConnector, error)
+ CreateAppConnector(context.Context, *appconnectorspb.CreateAppConnectorRequest, ...gax.CallOption) (*CreateAppConnectorOperation, error)
+ CreateAppConnectorOperation(name string) *CreateAppConnectorOperation
+ UpdateAppConnector(context.Context, *appconnectorspb.UpdateAppConnectorRequest, ...gax.CallOption) (*UpdateAppConnectorOperation, error)
+ UpdateAppConnectorOperation(name string) *UpdateAppConnectorOperation
+ DeleteAppConnector(context.Context, *appconnectorspb.DeleteAppConnectorRequest, ...gax.CallOption) (*DeleteAppConnectorOperation, error)
+ DeleteAppConnectorOperation(name string) *DeleteAppConnectorOperation
+ ReportStatus(context.Context, *appconnectorspb.ReportStatusRequest, ...gax.CallOption) (*ReportStatusOperation, error)
+ ReportStatusOperation(name string) *ReportStatusOperation
+ GetLocation(context.Context, *locationpb.GetLocationRequest, ...gax.CallOption) (*locationpb.Location, error)
+ ListLocations(context.Context, *locationpb.ListLocationsRequest, ...gax.CallOption) *LocationIterator
+ GetIamPolicy(context.Context, *iampb.GetIamPolicyRequest, ...gax.CallOption) (*iampb.Policy, error)
+ SetIamPolicy(context.Context, *iampb.SetIamPolicyRequest, ...gax.CallOption) (*iampb.Policy, error)
+ TestIamPermissions(context.Context, *iampb.TestIamPermissionsRequest, ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error)
+ CancelOperation(context.Context, *longrunningpb.CancelOperationRequest, ...gax.CallOption) error
+ DeleteOperation(context.Context, *longrunningpb.DeleteOperationRequest, ...gax.CallOption) error
+ GetOperation(context.Context, *longrunningpb.GetOperationRequest, ...gax.CallOption) (*longrunningpb.Operation, error)
+ ListOperations(context.Context, *longrunningpb.ListOperationsRequest, ...gax.CallOption) *OperationIterator
+}
+
+// Client is a client for interacting with BeyondCorp API.
+// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
+//
+// API OverviewThe beyondcorp.googleapis.com service implements the Google Cloud
+// BeyondCorp API.
+//
+// Data ModelThe AppConnectorsService exposes the following resource:
+//
+// AppConnectors, named as follows:
+// projects/{project_id}/locations/{location_id}/appConnectors/{app_connector_id}.
+//
+// The AppConnectorsService provides methods to manage
+// (create/read/update/delete) BeyondCorp AppConnectors.
+type Client struct {
+ // The internal transport-dependent client.
+ internalClient internalClient
+
+ // 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
+}
+
+// Wrapper methods routed to the internal client.
+
+// Close closes the connection to the API service. The user should invoke this when
+// the client is no longer required.
+func (c *Client) Close() error {
+ return c.internalClient.Close()
+}
+
+// setGoogleClientInfo sets the name and version of the application in
+// the `x-goog-api-client` header passed on each request. Intended for
+// use by Google-written clients.
+func (c *Client) setGoogleClientInfo(keyval ...string) {
+ c.internalClient.setGoogleClientInfo(keyval...)
+}
+
+// Connection returns a connection to the API service.
+//
+// Deprecated.
+func (c *Client) Connection() *grpc.ClientConn {
+ return c.internalClient.Connection()
+}
+
+// ListAppConnectors lists AppConnectors in a given project and location.
+func (c *Client) ListAppConnectors(ctx context.Context, req *appconnectorspb.ListAppConnectorsRequest, opts ...gax.CallOption) *AppConnectorIterator {
+ return c.internalClient.ListAppConnectors(ctx, req, opts...)
+}
+
+// GetAppConnector gets details of a single AppConnector.
+func (c *Client) GetAppConnector(ctx context.Context, req *appconnectorspb.GetAppConnectorRequest, opts ...gax.CallOption) (*appconnectorspb.AppConnector, error) {
+ return c.internalClient.GetAppConnector(ctx, req, opts...)
+}
+
+// CreateAppConnector creates a new AppConnector in a given project and location.
+func (c *Client) CreateAppConnector(ctx context.Context, req *appconnectorspb.CreateAppConnectorRequest, opts ...gax.CallOption) (*CreateAppConnectorOperation, error) {
+ return c.internalClient.CreateAppConnector(ctx, req, opts...)
+}
+
+// CreateAppConnectorOperation returns a new CreateAppConnectorOperation from a given name.
+// The name must be that of a previously created CreateAppConnectorOperation, possibly from a different process.
+func (c *Client) CreateAppConnectorOperation(name string) *CreateAppConnectorOperation {
+ return c.internalClient.CreateAppConnectorOperation(name)
+}
+
+// UpdateAppConnector updates the parameters of a single AppConnector.
+func (c *Client) UpdateAppConnector(ctx context.Context, req *appconnectorspb.UpdateAppConnectorRequest, opts ...gax.CallOption) (*UpdateAppConnectorOperation, error) {
+ return c.internalClient.UpdateAppConnector(ctx, req, opts...)
+}
+
+// UpdateAppConnectorOperation returns a new UpdateAppConnectorOperation from a given name.
+// The name must be that of a previously created UpdateAppConnectorOperation, possibly from a different process.
+func (c *Client) UpdateAppConnectorOperation(name string) *UpdateAppConnectorOperation {
+ return c.internalClient.UpdateAppConnectorOperation(name)
+}
+
+// DeleteAppConnector deletes a single AppConnector.
+func (c *Client) DeleteAppConnector(ctx context.Context, req *appconnectorspb.DeleteAppConnectorRequest, opts ...gax.CallOption) (*DeleteAppConnectorOperation, error) {
+ return c.internalClient.DeleteAppConnector(ctx, req, opts...)
+}
+
+// DeleteAppConnectorOperation returns a new DeleteAppConnectorOperation from a given name.
+// The name must be that of a previously created DeleteAppConnectorOperation, possibly from a different process.
+func (c *Client) DeleteAppConnectorOperation(name string) *DeleteAppConnectorOperation {
+ return c.internalClient.DeleteAppConnectorOperation(name)
+}
+
+// ReportStatus report status for a given connector.
+func (c *Client) ReportStatus(ctx context.Context, req *appconnectorspb.ReportStatusRequest, opts ...gax.CallOption) (*ReportStatusOperation, error) {
+ return c.internalClient.ReportStatus(ctx, req, opts...)
+}
+
+// ReportStatusOperation returns a new ReportStatusOperation from a given name.
+// The name must be that of a previously created ReportStatusOperation, possibly from a different process.
+func (c *Client) ReportStatusOperation(name string) *ReportStatusOperation {
+ return c.internalClient.ReportStatusOperation(name)
+}
+
+// GetLocation gets information about a location.
+func (c *Client) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error) {
+ return c.internalClient.GetLocation(ctx, req, opts...)
+}
+
+// ListLocations lists information about the supported locations for this service.
+func (c *Client) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator {
+ return c.internalClient.ListLocations(ctx, req, opts...)
+}
+
+// GetIamPolicy gets the access control policy for a resource. Returns an empty policy
+// if the resource exists and does not have a policy set.
+func (c *Client) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) {
+ return c.internalClient.GetIamPolicy(ctx, req, opts...)
+}
+
+// SetIamPolicy sets the access control policy on the specified resource. Replaces
+// any existing policy.
+//
+// Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED
+// errors.
+func (c *Client) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) {
+ return c.internalClient.SetIamPolicy(ctx, req, opts...)
+}
+
+// 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.
+func (c *Client) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, opts ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error) {
+ return c.internalClient.TestIamPermissions(ctx, req, opts...)
+}
+
+// CancelOperation is a utility method from google.longrunning.Operations.
+func (c *Client) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error {
+ return c.internalClient.CancelOperation(ctx, req, opts...)
+}
+
+// DeleteOperation is a utility method from google.longrunning.Operations.
+func (c *Client) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error {
+ return c.internalClient.DeleteOperation(ctx, req, opts...)
+}
+
+// GetOperation is a utility method from google.longrunning.Operations.
+func (c *Client) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) {
+ return c.internalClient.GetOperation(ctx, req, opts...)
+}
+
+// ListOperations is a utility method from google.longrunning.Operations.
+func (c *Client) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator {
+ return c.internalClient.ListOperations(ctx, req, opts...)
+}
+
+// gRPCClient is a client for interacting with BeyondCorp API over gRPC transport.
+//
+// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
+type gRPCClient struct {
+ // Connection pool of gRPC connections to the service.
+ connPool gtransport.ConnPool
+
+ // flag to opt out of default deadlines via GOOGLE_API_GO_EXPERIMENTAL_DISABLE_DEFAULT_DEADLINE
+ disableDeadlines bool
+
+ // Points back to the CallOptions field of the containing Client
+ CallOptions **CallOptions
+
+ // The gRPC API client.
+ client appconnectorspb.AppConnectorsServiceClient
+
+ // 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
+
+ operationsClient longrunningpb.OperationsClient
+
+ iamPolicyClient iampb.IAMPolicyClient
+
+ locationsClient locationpb.LocationsClient
+
+ // The x-goog-* metadata to be sent with each request.
+ xGoogMetadata metadata.MD
+}
+
+// NewClient creates a new app connectors service client based on gRPC.
+// The returned client must be Closed when it is done being used to clean up its underlying connections.
+//
+// API OverviewThe beyondcorp.googleapis.com service implements the Google Cloud
+// BeyondCorp API.
+//
+// Data ModelThe AppConnectorsService exposes the following resource:
+//
+// AppConnectors, named as follows:
+// projects/{project_id}/locations/{location_id}/appConnectors/{app_connector_id}.
+//
+// The AppConnectorsService provides methods to manage
+// (create/read/update/delete) BeyondCorp AppConnectors.
+func NewClient(ctx context.Context, opts ...option.ClientOption) (*Client, error) {
+ clientOpts := defaultGRPCClientOptions()
+ if newClientHook != nil {
+ hookOpts, err := newClientHook(ctx, clientHookParams{})
+ if err != nil {
+ return nil, err
+ }
+ clientOpts = append(clientOpts, hookOpts...)
+ }
+
+ disableDeadlines, err := checkDisableDeadlines()
+ if err != nil {
+ return nil, err
+ }
+
+ connPool, err := gtransport.DialPool(ctx, append(clientOpts, opts...)...)
+ if err != nil {
+ return nil, err
+ }
+ client := Client{CallOptions: defaultCallOptions()}
+
+ c := &gRPCClient{
+ connPool: connPool,
+ disableDeadlines: disableDeadlines,
+ client: appconnectorspb.NewAppConnectorsServiceClient(connPool),
+ CallOptions: &client.CallOptions,
+ operationsClient: longrunningpb.NewOperationsClient(connPool),
+ iamPolicyClient: iampb.NewIAMPolicyClient(connPool),
+ locationsClient: locationpb.NewLocationsClient(connPool),
+ }
+ c.setGoogleClientInfo()
+
+ client.internalClient = c
+
+ client.LROClient, err = lroauto.NewOperationsClient(ctx, gtransport.WithConnPool(connPool))
+ if err != nil {
+ // This error "should not happen", since we are just reusing old connection pool
+ // and never actually need to dial.
+ // If this does happen, we could leak connp. However, we cannot close conn:
+ // If the user invoked the constructor with option.WithGRPCConn,
+ // we would close a connection that's still in use.
+ // TODO: investigate error conditions.
+ return nil, err
+ }
+ c.LROClient = &client.LROClient
+ return &client, nil
+}
+
+// Connection returns a connection to the API service.
+//
+// Deprecated.
+func (c *gRPCClient) Connection() *grpc.ClientConn {
+ return c.connPool.Conn()
+}
+
+// setGoogleClientInfo sets the name and version of the application in
+// the `x-goog-api-client` header passed on each request. Intended for
+// use by Google-written clients.
+func (c *gRPCClient) setGoogleClientInfo(keyval ...string) {
+ kv := append([]string{"gl-go", versionGo()}, keyval...)
+ kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version)
+ c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
+}
+
+// Close closes the connection to the API service. The user should invoke this when
+// the client is no longer required.
+func (c *gRPCClient) Close() error {
+ return c.connPool.Close()
+}
+
+func (c *gRPCClient) ListAppConnectors(ctx context.Context, req *appconnectorspb.ListAppConnectorsRequest, opts ...gax.CallOption) *AppConnectorIterator {
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent())))
+
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ opts = append((*c.CallOptions).ListAppConnectors[0:len((*c.CallOptions).ListAppConnectors):len((*c.CallOptions).ListAppConnectors)], opts...)
+ it := &AppConnectorIterator{}
+ req = proto.Clone(req).(*appconnectorspb.ListAppConnectorsRequest)
+ it.InternalFetch = func(pageSize int, pageToken string) ([]*appconnectorspb.AppConnector, string, error) {
+ resp := &appconnectorspb.ListAppConnectorsResponse{}
+ if pageToken != "" {
+ req.PageToken = pageToken
+ }
+ if pageSize > math.MaxInt32 {
+ req.PageSize = math.MaxInt32
+ } else if pageSize != 0 {
+ req.PageSize = int32(pageSize)
+ }
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.client.ListAppConnectors(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, "", err
+ }
+
+ it.Response = resp
+ return resp.GetAppConnectors(), resp.GetNextPageToken(), nil
+ }
+ fetch := func(pageSize int, pageToken string) (string, error) {
+ items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
+ if err != nil {
+ return "", err
+ }
+ it.items = append(it.items, items...)
+ return nextPageToken, nil
+ }
+
+ it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
+ it.pageInfo.MaxSize = int(req.GetPageSize())
+ it.pageInfo.Token = req.GetPageToken()
+
+ return it
+}
+
+func (c *gRPCClient) GetAppConnector(ctx context.Context, req *appconnectorspb.GetAppConnectorRequest, opts ...gax.CallOption) (*appconnectorspb.AppConnector, error) {
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName())))
+
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ opts = append((*c.CallOptions).GetAppConnector[0:len((*c.CallOptions).GetAppConnector):len((*c.CallOptions).GetAppConnector)], opts...)
+ var resp *appconnectorspb.AppConnector
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.client.GetAppConnector(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+func (c *gRPCClient) CreateAppConnector(ctx context.Context, req *appconnectorspb.CreateAppConnectorRequest, opts ...gax.CallOption) (*CreateAppConnectorOperation, error) {
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent())))
+
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ opts = append((*c.CallOptions).CreateAppConnector[0:len((*c.CallOptions).CreateAppConnector):len((*c.CallOptions).CreateAppConnector)], opts...)
+ var resp *longrunningpb.Operation
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.client.CreateAppConnector(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return &CreateAppConnectorOperation{
+ lro: longrunning.InternalNewOperation(*c.LROClient, resp),
+ }, nil
+}
+
+func (c *gRPCClient) UpdateAppConnector(ctx context.Context, req *appconnectorspb.UpdateAppConnectorRequest, opts ...gax.CallOption) (*UpdateAppConnectorOperation, error) {
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "app_connector.name", url.QueryEscape(req.GetAppConnector().GetName())))
+
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ opts = append((*c.CallOptions).UpdateAppConnector[0:len((*c.CallOptions).UpdateAppConnector):len((*c.CallOptions).UpdateAppConnector)], opts...)
+ var resp *longrunningpb.Operation
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.client.UpdateAppConnector(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return &UpdateAppConnectorOperation{
+ lro: longrunning.InternalNewOperation(*c.LROClient, resp),
+ }, nil
+}
+
+func (c *gRPCClient) DeleteAppConnector(ctx context.Context, req *appconnectorspb.DeleteAppConnectorRequest, opts ...gax.CallOption) (*DeleteAppConnectorOperation, error) {
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName())))
+
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ opts = append((*c.CallOptions).DeleteAppConnector[0:len((*c.CallOptions).DeleteAppConnector):len((*c.CallOptions).DeleteAppConnector)], opts...)
+ var resp *longrunningpb.Operation
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.client.DeleteAppConnector(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return &DeleteAppConnectorOperation{
+ lro: longrunning.InternalNewOperation(*c.LROClient, resp),
+ }, nil
+}
+
+func (c *gRPCClient) ReportStatus(ctx context.Context, req *appconnectorspb.ReportStatusRequest, opts ...gax.CallOption) (*ReportStatusOperation, error) {
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "app_connector", url.QueryEscape(req.GetAppConnector())))
+
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ opts = append((*c.CallOptions).ReportStatus[0:len((*c.CallOptions).ReportStatus):len((*c.CallOptions).ReportStatus)], opts...)
+ var resp *longrunningpb.Operation
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.client.ReportStatus(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return &ReportStatusOperation{
+ lro: longrunning.InternalNewOperation(*c.LROClient, resp),
+ }, nil
+}
+
+func (c *gRPCClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error) {
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName())))
+
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ opts = append((*c.CallOptions).GetLocation[0:len((*c.CallOptions).GetLocation):len((*c.CallOptions).GetLocation)], opts...)
+ var resp *locationpb.Location
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.locationsClient.GetLocation(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+func (c *gRPCClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator {
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName())))
+
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ opts = append((*c.CallOptions).ListLocations[0:len((*c.CallOptions).ListLocations):len((*c.CallOptions).ListLocations)], opts...)
+ it := &LocationIterator{}
+ req = proto.Clone(req).(*locationpb.ListLocationsRequest)
+ it.InternalFetch = func(pageSize int, pageToken string) ([]*locationpb.Location, string, error) {
+ resp := &locationpb.ListLocationsResponse{}
+ if pageToken != "" {
+ req.PageToken = pageToken
+ }
+ if pageSize > math.MaxInt32 {
+ req.PageSize = math.MaxInt32
+ } else if pageSize != 0 {
+ req.PageSize = int32(pageSize)
+ }
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.locationsClient.ListLocations(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, "", err
+ }
+
+ it.Response = resp
+ return resp.GetLocations(), resp.GetNextPageToken(), nil
+ }
+ fetch := func(pageSize int, pageToken string) (string, error) {
+ items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
+ if err != nil {
+ return "", err
+ }
+ it.items = append(it.items, items...)
+ return nextPageToken, nil
+ }
+
+ it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
+ it.pageInfo.MaxSize = int(req.GetPageSize())
+ it.pageInfo.Token = req.GetPageToken()
+
+ return it
+}
+
+func (c *gRPCClient) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) {
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "resource", url.QueryEscape(req.GetResource())))
+
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ opts = append((*c.CallOptions).GetIamPolicy[0:len((*c.CallOptions).GetIamPolicy):len((*c.CallOptions).GetIamPolicy)], opts...)
+ var resp *iampb.Policy
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.iamPolicyClient.GetIamPolicy(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+func (c *gRPCClient) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) {
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "resource", url.QueryEscape(req.GetResource())))
+
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ opts = append((*c.CallOptions).SetIamPolicy[0:len((*c.CallOptions).SetIamPolicy):len((*c.CallOptions).SetIamPolicy)], opts...)
+ var resp *iampb.Policy
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.iamPolicyClient.SetIamPolicy(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+func (c *gRPCClient) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, opts ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error) {
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "resource", url.QueryEscape(req.GetResource())))
+
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ opts = append((*c.CallOptions).TestIamPermissions[0:len((*c.CallOptions).TestIamPermissions):len((*c.CallOptions).TestIamPermissions)], opts...)
+ var resp *iampb.TestIamPermissionsResponse
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.iamPolicyClient.TestIamPermissions(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+func (c *gRPCClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error {
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName())))
+
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ opts = append((*c.CallOptions).CancelOperation[0:len((*c.CallOptions).CancelOperation):len((*c.CallOptions).CancelOperation)], opts...)
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ _, err = c.operationsClient.CancelOperation(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ return err
+}
+
+func (c *gRPCClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error {
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName())))
+
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ opts = append((*c.CallOptions).DeleteOperation[0:len((*c.CallOptions).DeleteOperation):len((*c.CallOptions).DeleteOperation)], opts...)
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ _, err = c.operationsClient.DeleteOperation(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ return err
+}
+
+func (c *gRPCClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) {
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName())))
+
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ opts = append((*c.CallOptions).GetOperation[0:len((*c.CallOptions).GetOperation):len((*c.CallOptions).GetOperation)], opts...)
+ var resp *longrunningpb.Operation
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.operationsClient.GetOperation(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+func (c *gRPCClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator {
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName())))
+
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ opts = append((*c.CallOptions).ListOperations[0:len((*c.CallOptions).ListOperations):len((*c.CallOptions).ListOperations)], opts...)
+ it := &OperationIterator{}
+ req = proto.Clone(req).(*longrunningpb.ListOperationsRequest)
+ it.InternalFetch = func(pageSize int, pageToken string) ([]*longrunningpb.Operation, string, error) {
+ resp := &longrunningpb.ListOperationsResponse{}
+ if pageToken != "" {
+ req.PageToken = pageToken
+ }
+ if pageSize > math.MaxInt32 {
+ req.PageSize = math.MaxInt32
+ } else if pageSize != 0 {
+ req.PageSize = int32(pageSize)
+ }
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.operationsClient.ListOperations(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, "", err
+ }
+
+ it.Response = resp
+ return resp.GetOperations(), resp.GetNextPageToken(), nil
+ }
+ fetch := func(pageSize int, pageToken string) (string, error) {
+ items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
+ if err != nil {
+ return "", err
+ }
+ it.items = append(it.items, items...)
+ return nextPageToken, nil
+ }
+
+ it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
+ it.pageInfo.MaxSize = int(req.GetPageSize())
+ it.pageInfo.Token = req.GetPageToken()
+
+ return it
+}
+
+// CreateAppConnectorOperation manages a long-running operation from CreateAppConnector.
+type CreateAppConnectorOperation struct {
+ lro *longrunning.Operation
+}
+
+// CreateAppConnectorOperation returns a new CreateAppConnectorOperation from a given name.
+// The name must be that of a previously created CreateAppConnectorOperation, possibly from a different process.
+func (c *gRPCClient) CreateAppConnectorOperation(name string) *CreateAppConnectorOperation {
+ return &CreateAppConnectorOperation{
+ lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
+ }
+}
+
+// Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
+//
+// See documentation of Poll for error-handling information.
+func (op *CreateAppConnectorOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*appconnectorspb.AppConnector, error) {
+ var resp appconnectorspb.AppConnector
+ if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
+ return nil, err
+ }
+ return &resp, nil
+}
+
+// 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 (op *CreateAppConnectorOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*appconnectorspb.AppConnector, error) {
+ var resp appconnectorspb.AppConnector
+ if err := op.lro.Poll(ctx, &resp, opts...); err != nil {
+ return nil, err
+ }
+ if !op.Done() {
+ return nil, nil
+ }
+ return &resp, nil
+}
+
+// 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 (op *CreateAppConnectorOperation) Metadata() (*appconnectorspb.AppConnectorOperationMetadata, error) {
+ var meta appconnectorspb.AppConnectorOperationMetadata
+ if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
+ return nil, nil
+ } else if err != nil {
+ return nil, err
+ }
+ return &meta, nil
+}
+
+// Done reports whether the long-running operation has completed.
+func (op *CreateAppConnectorOperation) Done() bool {
+ return op.lro.Done()
+}
+
+// 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 (op *CreateAppConnectorOperation) Name() string {
+ return op.lro.Name()
+}
+
+// DeleteAppConnectorOperation manages a long-running operation from DeleteAppConnector.
+type DeleteAppConnectorOperation struct {
+ lro *longrunning.Operation
+}
+
+// DeleteAppConnectorOperation returns a new DeleteAppConnectorOperation from a given name.
+// The name must be that of a previously created DeleteAppConnectorOperation, possibly from a different process.
+func (c *gRPCClient) DeleteAppConnectorOperation(name string) *DeleteAppConnectorOperation {
+ return &DeleteAppConnectorOperation{
+ lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
+ }
+}
+
+// Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
+//
+// See documentation of Poll for error-handling information.
+func (op *DeleteAppConnectorOperation) Wait(ctx context.Context, opts ...gax.CallOption) error {
+ return op.lro.WaitWithInterval(ctx, nil, time.Minute, opts...)
+}
+
+// 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 (op *DeleteAppConnectorOperation) Poll(ctx context.Context, opts ...gax.CallOption) error {
+ return op.lro.Poll(ctx, nil, opts...)
+}
+
+// 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 (op *DeleteAppConnectorOperation) Metadata() (*appconnectorspb.AppConnectorOperationMetadata, error) {
+ var meta appconnectorspb.AppConnectorOperationMetadata
+ if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
+ return nil, nil
+ } else if err != nil {
+ return nil, err
+ }
+ return &meta, nil
+}
+
+// Done reports whether the long-running operation has completed.
+func (op *DeleteAppConnectorOperation) Done() bool {
+ return op.lro.Done()
+}
+
+// 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 (op *DeleteAppConnectorOperation) Name() string {
+ return op.lro.Name()
+}
+
+// ReportStatusOperation manages a long-running operation from ReportStatus.
+type ReportStatusOperation struct {
+ lro *longrunning.Operation
+}
+
+// ReportStatusOperation returns a new ReportStatusOperation from a given name.
+// The name must be that of a previously created ReportStatusOperation, possibly from a different process.
+func (c *gRPCClient) ReportStatusOperation(name string) *ReportStatusOperation {
+ return &ReportStatusOperation{
+ lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
+ }
+}
+
+// Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
+//
+// See documentation of Poll for error-handling information.
+func (op *ReportStatusOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*appconnectorspb.AppConnector, error) {
+ var resp appconnectorspb.AppConnector
+ if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
+ return nil, err
+ }
+ return &resp, nil
+}
+
+// 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 (op *ReportStatusOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*appconnectorspb.AppConnector, error) {
+ var resp appconnectorspb.AppConnector
+ if err := op.lro.Poll(ctx, &resp, opts...); err != nil {
+ return nil, err
+ }
+ if !op.Done() {
+ return nil, nil
+ }
+ return &resp, nil
+}
+
+// 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 (op *ReportStatusOperation) Metadata() (*appconnectorspb.AppConnectorOperationMetadata, error) {
+ var meta appconnectorspb.AppConnectorOperationMetadata
+ if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
+ return nil, nil
+ } else if err != nil {
+ return nil, err
+ }
+ return &meta, nil
+}
+
+// Done reports whether the long-running operation has completed.
+func (op *ReportStatusOperation) Done() bool {
+ return op.lro.Done()
+}
+
+// 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 (op *ReportStatusOperation) Name() string {
+ return op.lro.Name()
+}
+
+// UpdateAppConnectorOperation manages a long-running operation from UpdateAppConnector.
+type UpdateAppConnectorOperation struct {
+ lro *longrunning.Operation
+}
+
+// UpdateAppConnectorOperation returns a new UpdateAppConnectorOperation from a given name.
+// The name must be that of a previously created UpdateAppConnectorOperation, possibly from a different process.
+func (c *gRPCClient) UpdateAppConnectorOperation(name string) *UpdateAppConnectorOperation {
+ return &UpdateAppConnectorOperation{
+ lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
+ }
+}
+
+// Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
+//
+// See documentation of Poll for error-handling information.
+func (op *UpdateAppConnectorOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*appconnectorspb.AppConnector, error) {
+ var resp appconnectorspb.AppConnector
+ if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
+ return nil, err
+ }
+ return &resp, nil
+}
+
+// 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 (op *UpdateAppConnectorOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*appconnectorspb.AppConnector, error) {
+ var resp appconnectorspb.AppConnector
+ if err := op.lro.Poll(ctx, &resp, opts...); err != nil {
+ return nil, err
+ }
+ if !op.Done() {
+ return nil, nil
+ }
+ return &resp, nil
+}
+
+// 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 (op *UpdateAppConnectorOperation) Metadata() (*appconnectorspb.AppConnectorOperationMetadata, error) {
+ var meta appconnectorspb.AppConnectorOperationMetadata
+ if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
+ return nil, nil
+ } else if err != nil {
+ return nil, err
+ }
+ return &meta, nil
+}
+
+// Done reports whether the long-running operation has completed.
+func (op *UpdateAppConnectorOperation) Done() bool {
+ return op.lro.Done()
+}
+
+// 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 (op *UpdateAppConnectorOperation) Name() string {
+ return op.lro.Name()
+}
+
+// AppConnectorIterator manages a stream of *appconnectorspb.AppConnector.
+type AppConnectorIterator struct {
+ items []*appconnectorspb.AppConnector
+ pageInfo *iterator.PageInfo
+ nextFunc func() error
+
+ // 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 []*appconnectorspb.AppConnector, nextPageToken string, err error)
+}
+
+// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
+func (it *AppConnectorIterator) PageInfo() *iterator.PageInfo {
+ return it.pageInfo
+}
+
+// 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 (it *AppConnectorIterator) Next() (*appconnectorspb.AppConnector, error) {
+ var item *appconnectorspb.AppConnector
+ if err := it.nextFunc(); err != nil {
+ return item, err
+ }
+ item = it.items[0]
+ it.items = it.items[1:]
+ return item, nil
+}
+
+func (it *AppConnectorIterator) bufLen() int {
+ return len(it.items)
+}
+
+func (it *AppConnectorIterator) takeBuf() interface{} {
+ b := it.items
+ it.items = nil
+ return b
+}
+
+// LocationIterator manages a stream of *locationpb.Location.
+type LocationIterator struct {
+ items []*locationpb.Location
+ pageInfo *iterator.PageInfo
+ nextFunc func() error
+
+ // 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)
+}
+
+// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
+func (it *LocationIterator) PageInfo() *iterator.PageInfo {
+ return it.pageInfo
+}
+
+// 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 (it *LocationIterator) Next() (*locationpb.Location, error) {
+ var item *locationpb.Location
+ if err := it.nextFunc(); err != nil {
+ return item, err
+ }
+ item = it.items[0]
+ it.items = it.items[1:]
+ return item, nil
+}
+
+func (it *LocationIterator) bufLen() int {
+ return len(it.items)
+}
+
+func (it *LocationIterator) takeBuf() interface{} {
+ b := it.items
+ it.items = nil
+ return b
+}
+
+// OperationIterator manages a stream of *longrunningpb.Operation.
+type OperationIterator struct {
+ items []*longrunningpb.Operation
+ pageInfo *iterator.PageInfo
+ nextFunc func() error
+
+ // 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)
+}
+
+// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
+func (it *OperationIterator) PageInfo() *iterator.PageInfo {
+ return it.pageInfo
+}
+
+// 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 (it *OperationIterator) Next() (*longrunningpb.Operation, error) {
+ var item *longrunningpb.Operation
+ if err := it.nextFunc(); err != nil {
+ return item, err
+ }
+ item = it.items[0]
+ it.items = it.items[1:]
+ return item, nil
+}
+
+func (it *OperationIterator) bufLen() int {
+ return len(it.items)
+}
+
+func (it *OperationIterator) takeBuf() interface{} {
+ b := it.items
+ it.items = nil
+ return b
+}
diff --git a/beyondcorp/appconnectors/apiv1/app_connectors_client_example_test.go b/beyondcorp/appconnectors/apiv1/app_connectors_client_example_test.go
new file mode 100644
index 0000000..64b4b3c
--- /dev/null
+++ b/beyondcorp/appconnectors/apiv1/app_connectors_client_example_test.go
@@ -0,0 +1,372 @@
+// Copyright 2022 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
+
+package appconnectors_test
+
+import (
+ "context"
+
+ appconnectors "cloud.google.com/go/beyondcorp/appconnectors/apiv1"
+ "google.golang.org/api/iterator"
+ appconnectorspb "google.golang.org/genproto/googleapis/cloud/beyondcorp/appconnectors/v1"
+ locationpb "google.golang.org/genproto/googleapis/cloud/location"
+ iampb "google.golang.org/genproto/googleapis/iam/v1"
+ longrunningpb "google.golang.org/genproto/googleapis/longrunning"
+)
+
+func ExampleNewClient() {
+ ctx := context.Background()
+ c, err := appconnectors.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ defer c.Close()
+
+ // TODO: Use client.
+ _ = c
+}
+
+func ExampleClient_ListAppConnectors() {
+ ctx := context.Background()
+ c, err := appconnectors.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ defer c.Close()
+
+ req := &appconnectorspb.ListAppConnectorsRequest{
+ // TODO: Fill request struct fields.
+ // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/beyondcorp/appconnectors/v1#ListAppConnectorsRequest.
+ }
+ it := c.ListAppConnectors(ctx, req)
+ for {
+ resp, err := it.Next()
+ if err == iterator.Done {
+ break
+ }
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+ }
+}
+
+func ExampleClient_GetAppConnector() {
+ ctx := context.Background()
+ c, err := appconnectors.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ defer c.Close()
+
+ req := &appconnectorspb.GetAppConnectorRequest{
+ // TODO: Fill request struct fields.
+ // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/beyondcorp/appconnectors/v1#GetAppConnectorRequest.
+ }
+ resp, err := c.GetAppConnector(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+}
+
+func ExampleClient_CreateAppConnector() {
+ ctx := context.Background()
+ c, err := appconnectors.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ defer c.Close()
+
+ req := &appconnectorspb.CreateAppConnectorRequest{
+ // TODO: Fill request struct fields.
+ // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/beyondcorp/appconnectors/v1#CreateAppConnectorRequest.
+ }
+ op, err := c.CreateAppConnector(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ resp, err := op.Wait(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+}
+
+func ExampleClient_UpdateAppConnector() {
+ ctx := context.Background()
+ c, err := appconnectors.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ defer c.Close()
+
+ req := &appconnectorspb.UpdateAppConnectorRequest{
+ // TODO: Fill request struct fields.
+ // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/beyondcorp/appconnectors/v1#UpdateAppConnectorRequest.
+ }
+ op, err := c.UpdateAppConnector(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ resp, err := op.Wait(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+}
+
+func ExampleClient_DeleteAppConnector() {
+ ctx := context.Background()
+ c, err := appconnectors.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ defer c.Close()
+
+ req := &appconnectorspb.DeleteAppConnectorRequest{
+ // TODO: Fill request struct fields.
+ // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/beyondcorp/appconnectors/v1#DeleteAppConnectorRequest.
+ }
+ op, err := c.DeleteAppConnector(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ err = op.Wait(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+}
+
+func ExampleClient_ReportStatus() {
+ ctx := context.Background()
+ c, err := appconnectors.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ defer c.Close()
+
+ req := &appconnectorspb.ReportStatusRequest{
+ // TODO: Fill request struct fields.
+ // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/beyondcorp/appconnectors/v1#ReportStatusRequest.
+ }
+ op, err := c.ReportStatus(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ resp, err := op.Wait(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+}
+
+func ExampleClient_GetLocation() {
+ ctx := context.Background()
+ c, err := appconnectors.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 ExampleClient_ListLocations() {
+ ctx := context.Background()
+ c, err := appconnectors.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
+ }
+}
+
+func ExampleClient_GetIamPolicy() {
+ ctx := context.Background()
+ c, err := appconnectors.NewClient(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 ExampleClient_SetIamPolicy() {
+ ctx := context.Background()
+ c, err := appconnectors.NewClient(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 ExampleClient_TestIamPermissions() {
+ ctx := context.Background()
+ c, err := appconnectors.NewClient(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 ExampleClient_CancelOperation() {
+ ctx := context.Background()
+ c, err := appconnectors.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ defer c.Close()
+
+ req := &longrunningpb.CancelOperationRequest{
+ // TODO: Fill request struct fields.
+ // See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#CancelOperationRequest.
+ }
+ err = c.CancelOperation(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+}
+
+func ExampleClient_DeleteOperation() {
+ ctx := context.Background()
+ c, err := appconnectors.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ defer c.Close()
+
+ req := &longrunningpb.DeleteOperationRequest{
+ // TODO: Fill request struct fields.
+ // See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#DeleteOperationRequest.
+ }
+ err = c.DeleteOperation(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+}
+
+func ExampleClient_GetOperation() {
+ ctx := context.Background()
+ c, err := appconnectors.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ defer c.Close()
+
+ req := &longrunningpb.GetOperationRequest{
+ // TODO: Fill request struct fields.
+ // See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#GetOperationRequest.
+ }
+ resp, err := c.GetOperation(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+}
+
+func ExampleClient_ListOperations() {
+ ctx := context.Background()
+ c, err := appconnectors.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ defer c.Close()
+
+ req := &longrunningpb.ListOperationsRequest{
+ // TODO: Fill request struct fields.
+ // See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#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
+ }
+}
diff --git a/beyondcorp/appconnectors/apiv1/doc.go b/beyondcorp/appconnectors/apiv1/doc.go
new file mode 100644
index 0000000..ce397bb
--- /dev/null
+++ b/beyondcorp/appconnectors/apiv1/doc.go
@@ -0,0 +1,170 @@
+// Copyright 2022 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
+
+// Package appconnectors is an auto-generated package for the
+// BeyondCorp API.
+//
+// Beyondcorp Enterprise provides identity and context aware access controls
+// for enterprise resources and enables zero-trust access. Using the
+// Beyondcorp Enterprise APIs, enterprises can set up multi-cloud and on-prem
+// connectivity using the App Connector hybrid connectivity solution.
+//
+// NOTE: This package is in beta. It is not stable, and may be subject to changes.
+//
+// Example usage
+//
+// To get started with this package, create a client.
+// ctx := context.Background()
+// c, err := appconnectors.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.
+//
+// ctx := context.Background()
+// c, err := appconnectors.NewClient(ctx)
+// if err != nil {
+// // TODO: Handle error.
+// }
+// defer c.Close()
+//
+// req := &appconnectorspb.ListAppConnectorsRequest{
+// // TODO: Fill request struct fields.
+// // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/beyondcorp/appconnectors/v1#ListAppConnectorsRequest.
+// }
+// it := c.ListAppConnectors(ctx, req)
+// for {
+// resp, err := it.Next()
+// if err == iterator.Done {
+// break
+// }
+// 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.
+//
+// For information about setting deadlines, reusing contexts, and more
+// please visit https://pkg.go.dev/cloud.google.com/go.
+package appconnectors // import "cloud.google.com/go/beyondcorp/appconnectors/apiv1"
+
+import (
+ "context"
+ "os"
+ "runtime"
+ "strconv"
+ "strings"
+ "unicode"
+
+ "google.golang.org/api/option"
+ "google.golang.org/grpc/metadata"
+)
+
+// For more information on implementing a client constructor hook, see
+// https://github.com/googleapis/google-cloud-go/wiki/Customizing-constructors.
+type clientHookParams struct{}
+type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error)
+
+var versionClient string
+
+func getVersionClient() string {
+ if versionClient == "" {
+ return "UNKNOWN"
+ }
+ return versionClient
+}
+
+func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
+ out, _ := metadata.FromOutgoingContext(ctx)
+ out = out.Copy()
+ for _, md := range mds {
+ for k, v := range md {
+ out[k] = append(out[k], v...)
+ }
+ }
+ return metadata.NewOutgoingContext(ctx, out)
+}
+
+func checkDisableDeadlines() (bool, error) {
+ raw, ok := os.LookupEnv("GOOGLE_API_GO_EXPERIMENTAL_DISABLE_DEFAULT_DEADLINE")
+ if !ok {
+ return false, nil
+ }
+
+ b, err := strconv.ParseBool(raw)
+ return b, err
+}
+
+// DefaultAuthScopes reports the default set of authentication scopes to use with this package.
+func DefaultAuthScopes() []string {
+ return []string{
+ "https://www.googleapis.com/auth/cloud-platform",
+ }
+}
+
+// versionGo returns the Go runtime version. The returned string
+// has no whitespace, suitable for reporting in header.
+func versionGo() string {
+ const develPrefix = "devel +"
+
+ s := runtime.Version()
+ if strings.HasPrefix(s, develPrefix) {
+ s = s[len(develPrefix):]
+ if p := strings.IndexFunc(s, unicode.IsSpace); p >= 0 {
+ s = s[:p]
+ }
+ return s
+ }
+
+ notSemverRune := func(r rune) bool {
+ return !strings.ContainsRune("0123456789.", r)
+ }
+
+ if strings.HasPrefix(s, "go1") {
+ s = s[2:]
+ var prerelease string
+ if p := strings.IndexFunc(s, notSemverRune); p >= 0 {
+ s, prerelease = s[:p], s[p:]
+ }
+ if strings.HasSuffix(s, ".") {
+ s += "0"
+ } else if strings.Count(s, ".") < 2 {
+ s += ".0"
+ }
+ if prerelease != "" {
+ s += "-" + prerelease
+ }
+ return s
+ }
+ return "UNKNOWN"
+}
diff --git a/beyondcorp/appconnectors/apiv1/gapic_metadata.json b/beyondcorp/appconnectors/apiv1/gapic_metadata.json
new file mode 100644
index 0000000..782b033
--- /dev/null
+++ b/beyondcorp/appconnectors/apiv1/gapic_metadata.json
@@ -0,0 +1,93 @@
+{
+ "schema": "1.0",
+ "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.",
+ "language": "go",
+ "protoPackage": "google.cloud.beyondcorp.appconnectors.v1",
+ "libraryPackage": "cloud.google.com/go/beyondcorp/appconnectors/apiv1",
+ "services": {
+ "AppConnectorsService": {
+ "clients": {
+ "grpc": {
+ "libraryClient": "Client",
+ "rpcs": {
+ "CancelOperation": {
+ "methods": [
+ "CancelOperation"
+ ]
+ },
+ "CreateAppConnector": {
+ "methods": [
+ "CreateAppConnector"
+ ]
+ },
+ "DeleteAppConnector": {
+ "methods": [
+ "DeleteAppConnector"
+ ]
+ },
+ "DeleteOperation": {
+ "methods": [
+ "DeleteOperation"
+ ]
+ },
+ "GetAppConnector": {
+ "methods": [
+ "GetAppConnector"
+ ]
+ },
+ "GetIamPolicy": {
+ "methods": [
+ "GetIamPolicy"
+ ]
+ },
+ "GetLocation": {
+ "methods": [
+ "GetLocation"
+ ]
+ },
+ "GetOperation": {
+ "methods": [
+ "GetOperation"
+ ]
+ },
+ "ListAppConnectors": {
+ "methods": [
+ "ListAppConnectors"
+ ]
+ },
+ "ListLocations": {
+ "methods": [
+ "ListLocations"
+ ]
+ },
+ "ListOperations": {
+ "methods": [
+ "ListOperations"
+ ]
+ },
+ "ReportStatus": {
+ "methods": [
+ "ReportStatus"
+ ]
+ },
+ "SetIamPolicy": {
+ "methods": [
+ "SetIamPolicy"
+ ]
+ },
+ "TestIamPermissions": {
+ "methods": [
+ "TestIamPermissions"
+ ]
+ },
+ "UpdateAppConnector": {
+ "methods": [
+ "UpdateAppConnector"
+ ]
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/beyondcorp/appconnectors/apiv1/version.go b/beyondcorp/appconnectors/apiv1/version.go
new file mode 100644
index 0000000..198ce10
--- /dev/null
+++ b/beyondcorp/appconnectors/apiv1/version.go
@@ -0,0 +1,23 @@
+// Copyright 2022 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Code generated by gapicgen. DO NOT EDIT.
+
+package appconnectors
+
+import "cloud.google.com/go/beyondcorp/internal"
+
+func init() {
+ versionClient = internal.Version
+}
diff --git a/beyondcorp/appgateways/apiv1/app_gateways_client.go b/beyondcorp/appgateways/apiv1/app_gateways_client.go
new file mode 100644
index 0000000..f0d6d4f
--- /dev/null
+++ b/beyondcorp/appgateways/apiv1/app_gateways_client.go
@@ -0,0 +1,930 @@
+// Copyright 2022 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
+
+package appgateways
+
+import (
+ "context"
+ "fmt"
+ "math"
+ "net/url"
+ "time"
+
+ "cloud.google.com/go/longrunning"
+ lroauto "cloud.google.com/go/longrunning/autogen"
+ gax "github.com/googleapis/gax-go/v2"
+ "google.golang.org/api/iterator"
+ "google.golang.org/api/option"
+ "google.golang.org/api/option/internaloption"
+ gtransport "google.golang.org/api/transport/grpc"
+ appgatewayspb "google.golang.org/genproto/googleapis/cloud/beyondcorp/appgateways/v1"
+ locationpb "google.golang.org/genproto/googleapis/cloud/location"
+ iampb "google.golang.org/genproto/googleapis/iam/v1"
+ longrunningpb "google.golang.org/genproto/googleapis/longrunning"
+ "google.golang.org/grpc"
+ "google.golang.org/grpc/metadata"
+ "google.golang.org/protobuf/proto"
+)
+
+var newClientHook clientHook
+
+// CallOptions contains the retry settings for each method of Client.
+type CallOptions struct {
+ ListAppGateways []gax.CallOption
+ GetAppGateway []gax.CallOption
+ CreateAppGateway []gax.CallOption
+ DeleteAppGateway []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
+}
+
+func defaultGRPCClientOptions() []option.ClientOption {
+ return []option.ClientOption{
+ internaloption.WithDefaultEndpoint("beyondcorp.googleapis.com:443"),
+ internaloption.WithDefaultMTLSEndpoint("beyondcorp.mtls.googleapis.com:443"),
+ internaloption.WithDefaultAudience("https://beyondcorp.googleapis.com/"),
+ internaloption.WithDefaultScopes(DefaultAuthScopes()...),
+ internaloption.EnableJwtWithScope(),
+ option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
+ grpc.MaxCallRecvMsgSize(math.MaxInt32))),
+ }
+}
+
+func defaultCallOptions() *CallOptions {
+ return &CallOptions{
+ ListAppGateways: []gax.CallOption{},
+ GetAppGateway: []gax.CallOption{},
+ CreateAppGateway: []gax.CallOption{},
+ DeleteAppGateway: []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{},
+ }
+}
+
+// internalClient is an interface that defines the methods available from BeyondCorp API.
+type internalClient interface {
+ Close() error
+ setGoogleClientInfo(...string)
+ Connection() *grpc.ClientConn
+ ListAppGateways(context.Context, *appgatewayspb.ListAppGatewaysRequest, ...gax.CallOption) *AppGatewayIterator
+ GetAppGateway(context.Context, *appgatewayspb.GetAppGatewayRequest, ...gax.CallOption) (*appgatewayspb.AppGateway, error)
+ CreateAppGateway(context.Context, *appgatewayspb.CreateAppGatewayRequest, ...gax.CallOption) (*CreateAppGatewayOperation, error)
+ CreateAppGatewayOperation(name string) *CreateAppGatewayOperation
+ DeleteAppGateway(context.Context, *appgatewayspb.DeleteAppGatewayRequest, ...gax.CallOption) (*DeleteAppGatewayOperation, error)
+ DeleteAppGatewayOperation(name string) *DeleteAppGatewayOperation
+ GetLocation(context.Context, *locationpb.GetLocationRequest, ...gax.CallOption) (*locationpb.Location, error)
+ ListLocations(context.Context, *locationpb.ListLocationsRequest, ...gax.CallOption) *LocationIterator
+ GetIamPolicy(context.Context, *iampb.GetIamPolicyRequest, ...gax.CallOption) (*iampb.Policy, error)
+ SetIamPolicy(context.Context, *iampb.SetIamPolicyRequest, ...gax.CallOption) (*iampb.Policy, error)
+ TestIamPermissions(context.Context, *iampb.TestIamPermissionsRequest, ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error)
+ CancelOperation(context.Context, *longrunningpb.CancelOperationRequest, ...gax.CallOption) error
+ DeleteOperation(context.Context, *longrunningpb.DeleteOperationRequest, ...gax.CallOption) error
+ GetOperation(context.Context, *longrunningpb.GetOperationRequest, ...gax.CallOption) (*longrunningpb.Operation, error)
+ ListOperations(context.Context, *longrunningpb.ListOperationsRequest, ...gax.CallOption) *OperationIterator
+}
+
+// Client is a client for interacting with BeyondCorp API.
+// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
+//
+// API OverviewThe beyondcorp.googleapis.com service implements the Google Cloud
+// BeyondCorp API.
+//
+// Data ModelThe AppGatewaysService exposes the following resources:
+//
+// AppGateways, named as follows:
+// projects/{project_id}/locations/{location_id}/appGateways/{app_gateway_id}.
+//
+// The AppGatewaysService service provides methods to manage
+// (create/read/update/delete) BeyondCorp AppGateways.
+type Client struct {
+ // The internal transport-dependent client.
+ internalClient internalClient
+
+ // 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
+}
+
+// Wrapper methods routed to the internal client.
+
+// Close closes the connection to the API service. The user should invoke this when
+// the client is no longer required.
+func (c *Client) Close() error {
+ return c.internalClient.Close()
+}
+
+// setGoogleClientInfo sets the name and version of the application in
+// the `x-goog-api-client` header passed on each request. Intended for
+// use by Google-written clients.
+func (c *Client) setGoogleClientInfo(keyval ...string) {
+ c.internalClient.setGoogleClientInfo(keyval...)
+}
+
+// Connection returns a connection to the API service.
+//
+// Deprecated.
+func (c *Client) Connection() *grpc.ClientConn {
+ return c.internalClient.Connection()
+}
+
+// ListAppGateways lists AppGateways in a given project and location.
+func (c *Client) ListAppGateways(ctx context.Context, req *appgatewayspb.ListAppGatewaysRequest, opts ...gax.CallOption) *AppGatewayIterator {
+ return c.internalClient.ListAppGateways(ctx, req, opts...)
+}
+
+// GetAppGateway gets details of a single AppGateway.
+func (c *Client) GetAppGateway(ctx context.Context, req *appgatewayspb.GetAppGatewayRequest, opts ...gax.CallOption) (*appgatewayspb.AppGateway, error) {
+ return c.internalClient.GetAppGateway(ctx, req, opts...)
+}
+
+// CreateAppGateway creates a new AppGateway in a given project and location.
+func (c *Client) CreateAppGateway(ctx context.Context, req *appgatewayspb.CreateAppGatewayRequest, opts ...gax.CallOption) (*CreateAppGatewayOperation, error) {
+ return c.internalClient.CreateAppGateway(ctx, req, opts...)
+}
+
+// CreateAppGatewayOperation returns a new CreateAppGatewayOperation from a given name.
+// The name must be that of a previously created CreateAppGatewayOperation, possibly from a different process.
+func (c *Client) CreateAppGatewayOperation(name string) *CreateAppGatewayOperation {
+ return c.internalClient.CreateAppGatewayOperation(name)
+}
+
+// DeleteAppGateway deletes a single AppGateway.
+func (c *Client) DeleteAppGateway(ctx context.Context, req *appgatewayspb.DeleteAppGatewayRequest, opts ...gax.CallOption) (*DeleteAppGatewayOperation, error) {
+ return c.internalClient.DeleteAppGateway(ctx, req, opts...)
+}
+
+// DeleteAppGatewayOperation returns a new DeleteAppGatewayOperation from a given name.
+// The name must be that of a previously created DeleteAppGatewayOperation, possibly from a different process.
+func (c *Client) DeleteAppGatewayOperation(name string) *DeleteAppGatewayOperation {
+ return c.internalClient.DeleteAppGatewayOperation(name)
+}
+
+// GetLocation gets information about a location.
+func (c *Client) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error) {
+ return c.internalClient.GetLocation(ctx, req, opts...)
+}
+
+// ListLocations lists information about the supported locations for this service.
+func (c *Client) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator {
+ return c.internalClient.ListLocations(ctx, req, opts...)
+}
+
+// GetIamPolicy gets the access control policy for a resource. Returns an empty policy
+// if the resource exists and does not have a policy set.
+func (c *Client) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) {
+ return c.internalClient.GetIamPolicy(ctx, req, opts...)
+}
+
+// SetIamPolicy sets the access control policy on the specified resource. Replaces
+// any existing policy.
+//
+// Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED
+// errors.
+func (c *Client) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) {
+ return c.internalClient.SetIamPolicy(ctx, req, opts...)
+}
+
+// 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.
+func (c *Client) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, opts ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error) {
+ return c.internalClient.TestIamPermissions(ctx, req, opts...)
+}
+
+// CancelOperation is a utility method from google.longrunning.Operations.
+func (c *Client) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error {
+ return c.internalClient.CancelOperation(ctx, req, opts...)
+}
+
+// DeleteOperation is a utility method from google.longrunning.Operations.
+func (c *Client) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error {
+ return c.internalClient.DeleteOperation(ctx, req, opts...)
+}
+
+// GetOperation is a utility method from google.longrunning.Operations.
+func (c *Client) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) {
+ return c.internalClient.GetOperation(ctx, req, opts...)
+}
+
+// ListOperations is a utility method from google.longrunning.Operations.
+func (c *Client) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator {
+ return c.internalClient.ListOperations(ctx, req, opts...)
+}
+
+// gRPCClient is a client for interacting with BeyondCorp API over gRPC transport.
+//
+// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
+type gRPCClient struct {
+ // Connection pool of gRPC connections to the service.
+ connPool gtransport.ConnPool
+
+ // flag to opt out of default deadlines via GOOGLE_API_GO_EXPERIMENTAL_DISABLE_DEFAULT_DEADLINE
+ disableDeadlines bool
+
+ // Points back to the CallOptions field of the containing Client
+ CallOptions **CallOptions
+
+ // The gRPC API client.
+ client appgatewayspb.AppGatewaysServiceClient
+
+ // 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
+
+ operationsClient longrunningpb.OperationsClient
+
+ iamPolicyClient iampb.IAMPolicyClient
+
+ locationsClient locationpb.LocationsClient
+
+ // The x-goog-* metadata to be sent with each request.
+ xGoogMetadata metadata.MD
+}
+
+// NewClient creates a new app gateways service client based on gRPC.
+// The returned client must be Closed when it is done being used to clean up its underlying connections.
+//
+// API OverviewThe beyondcorp.googleapis.com service implements the Google Cloud
+// BeyondCorp API.
+//
+// Data ModelThe AppGatewaysService exposes the following resources:
+//
+// AppGateways, named as follows:
+// projects/{project_id}/locations/{location_id}/appGateways/{app_gateway_id}.
+//
+// The AppGatewaysService service provides methods to manage
+// (create/read/update/delete) BeyondCorp AppGateways.
+func NewClient(ctx context.Context, opts ...option.ClientOption) (*Client, error) {
+ clientOpts := defaultGRPCClientOptions()
+ if newClientHook != nil {
+ hookOpts, err := newClientHook(ctx, clientHookParams{})
+ if err != nil {
+ return nil, err
+ }
+ clientOpts = append(clientOpts, hookOpts...)
+ }
+
+ disableDeadlines, err := checkDisableDeadlines()
+ if err != nil {
+ return nil, err
+ }
+
+ connPool, err := gtransport.DialPool(ctx, append(clientOpts, opts...)...)
+ if err != nil {
+ return nil, err
+ }
+ client := Client{CallOptions: defaultCallOptions()}
+
+ c := &gRPCClient{
+ connPool: connPool,
+ disableDeadlines: disableDeadlines,
+ client: appgatewayspb.NewAppGatewaysServiceClient(connPool),
+ CallOptions: &client.CallOptions,
+ operationsClient: longrunningpb.NewOperationsClient(connPool),
+ iamPolicyClient: iampb.NewIAMPolicyClient(connPool),
+ locationsClient: locationpb.NewLocationsClient(connPool),
+ }
+ c.setGoogleClientInfo()
+
+ client.internalClient = c
+
+ client.LROClient, err = lroauto.NewOperationsClient(ctx, gtransport.WithConnPool(connPool))
+ if err != nil {
+ // This error "should not happen", since we are just reusing old connection pool
+ // and never actually need to dial.
+ // If this does happen, we could leak connp. However, we cannot close conn:
+ // If the user invoked the constructor with option.WithGRPCConn,
+ // we would close a connection that's still in use.
+ // TODO: investigate error conditions.
+ return nil, err
+ }
+ c.LROClient = &client.LROClient
+ return &client, nil
+}
+
+// Connection returns a connection to the API service.
+//
+// Deprecated.
+func (c *gRPCClient) Connection() *grpc.ClientConn {
+ return c.connPool.Conn()
+}
+
+// setGoogleClientInfo sets the name and version of the application in
+// the `x-goog-api-client` header passed on each request. Intended for
+// use by Google-written clients.
+func (c *gRPCClient) setGoogleClientInfo(keyval ...string) {
+ kv := append([]string{"gl-go", versionGo()}, keyval...)
+ kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version)
+ c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
+}
+
+// Close closes the connection to the API service. The user should invoke this when
+// the client is no longer required.
+func (c *gRPCClient) Close() error {
+ return c.connPool.Close()
+}
+
+func (c *gRPCClient) ListAppGateways(ctx context.Context, req *appgatewayspb.ListAppGatewaysRequest, opts ...gax.CallOption) *AppGatewayIterator {
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent())))
+
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ opts = append((*c.CallOptions).ListAppGateways[0:len((*c.CallOptions).ListAppGateways):len((*c.CallOptions).ListAppGateways)], opts...)
+ it := &AppGatewayIterator{}
+ req = proto.Clone(req).(*appgatewayspb.ListAppGatewaysRequest)
+ it.InternalFetch = func(pageSize int, pageToken string) ([]*appgatewayspb.AppGateway, string, error) {
+ resp := &appgatewayspb.ListAppGatewaysResponse{}
+ if pageToken != "" {
+ req.PageToken = pageToken
+ }
+ if pageSize > math.MaxInt32 {
+ req.PageSize = math.MaxInt32
+ } else if pageSize != 0 {
+ req.PageSize = int32(pageSize)
+ }
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.client.ListAppGateways(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, "", err
+ }
+
+ it.Response = resp
+ return resp.GetAppGateways(), resp.GetNextPageToken(), nil
+ }
+ fetch := func(pageSize int, pageToken string) (string, error) {
+ items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
+ if err != nil {
+ return "", err
+ }
+ it.items = append(it.items, items...)
+ return nextPageToken, nil
+ }
+
+ it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
+ it.pageInfo.MaxSize = int(req.GetPageSize())
+ it.pageInfo.Token = req.GetPageToken()
+
+ return it
+}
+
+func (c *gRPCClient) GetAppGateway(ctx context.Context, req *appgatewayspb.GetAppGatewayRequest, opts ...gax.CallOption) (*appgatewayspb.AppGateway, error) {
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName())))
+
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ opts = append((*c.CallOptions).GetAppGateway[0:len((*c.CallOptions).GetAppGateway):len((*c.CallOptions).GetAppGateway)], opts...)
+ var resp *appgatewayspb.AppGateway
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.client.GetAppGateway(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+func (c *gRPCClient) CreateAppGateway(ctx context.Context, req *appgatewayspb.CreateAppGatewayRequest, opts ...gax.CallOption) (*CreateAppGatewayOperation, error) {
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent())))
+
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ opts = append((*c.CallOptions).CreateAppGateway[0:len((*c.CallOptions).CreateAppGateway):len((*c.CallOptions).CreateAppGateway)], opts...)
+ var resp *longrunningpb.Operation
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.client.CreateAppGateway(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return &CreateAppGatewayOperation{
+ lro: longrunning.InternalNewOperation(*c.LROClient, resp),
+ }, nil
+}
+
+func (c *gRPCClient) DeleteAppGateway(ctx context.Context, req *appgatewayspb.DeleteAppGatewayRequest, opts ...gax.CallOption) (*DeleteAppGatewayOperation, error) {
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName())))
+
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ opts = append((*c.CallOptions).DeleteAppGateway[0:len((*c.CallOptions).DeleteAppGateway):len((*c.CallOptions).DeleteAppGateway)], opts...)
+ var resp *longrunningpb.Operation
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.client.DeleteAppGateway(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return &DeleteAppGatewayOperation{
+ lro: longrunning.InternalNewOperation(*c.LROClient, resp),
+ }, nil
+}
+
+func (c *gRPCClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error) {
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName())))
+
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ opts = append((*c.CallOptions).GetLocation[0:len((*c.CallOptions).GetLocation):len((*c.CallOptions).GetLocation)], opts...)
+ var resp *locationpb.Location
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.locationsClient.GetLocation(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+func (c *gRPCClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator {
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName())))
+
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ opts = append((*c.CallOptions).ListLocations[0:len((*c.CallOptions).ListLocations):len((*c.CallOptions).ListLocations)], opts...)
+ it := &LocationIterator{}
+ req = proto.Clone(req).(*locationpb.ListLocationsRequest)
+ it.InternalFetch = func(pageSize int, pageToken string) ([]*locationpb.Location, string, error) {
+ resp := &locationpb.ListLocationsResponse{}
+ if pageToken != "" {
+ req.PageToken = pageToken
+ }
+ if pageSize > math.MaxInt32 {
+ req.PageSize = math.MaxInt32
+ } else if pageSize != 0 {
+ req.PageSize = int32(pageSize)
+ }
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.locationsClient.ListLocations(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, "", err
+ }
+
+ it.Response = resp
+ return resp.GetLocations(), resp.GetNextPageToken(), nil
+ }
+ fetch := func(pageSize int, pageToken string) (string, error) {
+ items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
+ if err != nil {
+ return "", err
+ }
+ it.items = append(it.items, items...)
+ return nextPageToken, nil
+ }
+
+ it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
+ it.pageInfo.MaxSize = int(req.GetPageSize())
+ it.pageInfo.Token = req.GetPageToken()
+
+ return it
+}
+
+func (c *gRPCClient) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) {
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "resource", url.QueryEscape(req.GetResource())))
+
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ opts = append((*c.CallOptions).GetIamPolicy[0:len((*c.CallOptions).GetIamPolicy):len((*c.CallOptions).GetIamPolicy)], opts...)
+ var resp *iampb.Policy
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.iamPolicyClient.GetIamPolicy(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+func (c *gRPCClient) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) {
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "resource", url.QueryEscape(req.GetResource())))
+
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ opts = append((*c.CallOptions).SetIamPolicy[0:len((*c.CallOptions).SetIamPolicy):len((*c.CallOptions).SetIamPolicy)], opts...)
+ var resp *iampb.Policy
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.iamPolicyClient.SetIamPolicy(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+func (c *gRPCClient) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, opts ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error) {
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "resource", url.QueryEscape(req.GetResource())))
+
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ opts = append((*c.CallOptions).TestIamPermissions[0:len((*c.CallOptions).TestIamPermissions):len((*c.CallOptions).TestIamPermissions)], opts...)
+ var resp *iampb.TestIamPermissionsResponse
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.iamPolicyClient.TestIamPermissions(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+func (c *gRPCClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error {
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName())))
+
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ opts = append((*c.CallOptions).CancelOperation[0:len((*c.CallOptions).CancelOperation):len((*c.CallOptions).CancelOperation)], opts...)
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ _, err = c.operationsClient.CancelOperation(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ return err
+}
+
+func (c *gRPCClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error {
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName())))
+
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ opts = append((*c.CallOptions).DeleteOperation[0:len((*c.CallOptions).DeleteOperation):len((*c.CallOptions).DeleteOperation)], opts...)
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ _, err = c.operationsClient.DeleteOperation(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ return err
+}
+
+func (c *gRPCClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) {
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName())))
+
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ opts = append((*c.CallOptions).GetOperation[0:len((*c.CallOptions).GetOperation):len((*c.CallOptions).GetOperation)], opts...)
+ var resp *longrunningpb.Operation
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.operationsClient.GetOperation(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+func (c *gRPCClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator {
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName())))
+
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ opts = append((*c.CallOptions).ListOperations[0:len((*c.CallOptions).ListOperations):len((*c.CallOptions).ListOperations)], opts...)
+ it := &OperationIterator{}
+ req = proto.Clone(req).(*longrunningpb.ListOperationsRequest)
+ it.InternalFetch = func(pageSize int, pageToken string) ([]*longrunningpb.Operation, string, error) {
+ resp := &longrunningpb.ListOperationsResponse{}
+ if pageToken != "" {
+ req.PageToken = pageToken
+ }
+ if pageSize > math.MaxInt32 {
+ req.PageSize = math.MaxInt32
+ } else if pageSize != 0 {
+ req.PageSize = int32(pageSize)
+ }
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.operationsClient.ListOperations(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, "", err
+ }
+
+ it.Response = resp
+ return resp.GetOperations(), resp.GetNextPageToken(), nil
+ }
+ fetch := func(pageSize int, pageToken string) (string, error) {
+ items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
+ if err != nil {
+ return "", err
+ }
+ it.items = append(it.items, items...)
+ return nextPageToken, nil
+ }
+
+ it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
+ it.pageInfo.MaxSize = int(req.GetPageSize())
+ it.pageInfo.Token = req.GetPageToken()
+
+ return it
+}
+
+// CreateAppGatewayOperation manages a long-running operation from CreateAppGateway.
+type CreateAppGatewayOperation struct {
+ lro *longrunning.Operation
+}
+
+// CreateAppGatewayOperation returns a new CreateAppGatewayOperation from a given name.
+// The name must be that of a previously created CreateAppGatewayOperation, possibly from a different process.
+func (c *gRPCClient) CreateAppGatewayOperation(name string) *CreateAppGatewayOperation {
+ return &CreateAppGatewayOperation{
+ lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
+ }
+}
+
+// Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
+//
+// See documentation of Poll for error-handling information.
+func (op *CreateAppGatewayOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*appgatewayspb.AppGateway, error) {
+ var resp appgatewayspb.AppGateway
+ if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
+ return nil, err
+ }
+ return &resp, nil
+}
+
+// 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 (op *CreateAppGatewayOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*appgatewayspb.AppGateway, error) {
+ var resp appgatewayspb.AppGateway
+ if err := op.lro.Poll(ctx, &resp, opts...); err != nil {
+ return nil, err
+ }
+ if !op.Done() {
+ return nil, nil
+ }
+ return &resp, nil
+}
+
+// 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 (op *CreateAppGatewayOperation) Metadata() (*appgatewayspb.AppGatewayOperationMetadata, error) {
+ var meta appgatewayspb.AppGatewayOperationMetadata
+ if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
+ return nil, nil
+ } else if err != nil {
+ return nil, err
+ }
+ return &meta, nil
+}
+
+// Done reports whether the long-running operation has completed.
+func (op *CreateAppGatewayOperation) Done() bool {
+ return op.lro.Done()
+}
+
+// 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 (op *CreateAppGatewayOperation) Name() string {
+ return op.lro.Name()
+}
+
+// DeleteAppGatewayOperation manages a long-running operation from DeleteAppGateway.
+type DeleteAppGatewayOperation struct {
+ lro *longrunning.Operation
+}
+
+// DeleteAppGatewayOperation returns a new DeleteAppGatewayOperation from a given name.
+// The name must be that of a previously created DeleteAppGatewayOperation, possibly from a different process.
+func (c *gRPCClient) DeleteAppGatewayOperation(name string) *DeleteAppGatewayOperation {
+ return &DeleteAppGatewayOperation{
+ lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
+ }
+}
+
+// Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
+//
+// See documentation of Poll for error-handling information.
+func (op *DeleteAppGatewayOperation) Wait(ctx context.Context, opts ...gax.CallOption) error {
+ return op.lro.WaitWithInterval(ctx, nil, time.Minute, opts...)
+}
+
+// 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 (op *DeleteAppGatewayOperation) Poll(ctx context.Context, opts ...gax.CallOption) error {
+ return op.lro.Poll(ctx, nil, opts...)
+}
+
+// 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 (op *DeleteAppGatewayOperation) Metadata() (*appgatewayspb.AppGatewayOperationMetadata, error) {
+ var meta appgatewayspb.AppGatewayOperationMetadata
+ if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
+ return nil, nil
+ } else if err != nil {
+ return nil, err
+ }
+ return &meta, nil
+}
+
+// Done reports whether the long-running operation has completed.
+func (op *DeleteAppGatewayOperation) Done() bool {
+ return op.lro.Done()
+}
+
+// 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 (op *DeleteAppGatewayOperation) Name() string {
+ return op.lro.Name()
+}
+
+// AppGatewayIterator manages a stream of *appgatewayspb.AppGateway.
+type AppGatewayIterator struct {
+ items []*appgatewayspb.AppGateway
+ pageInfo *iterator.PageInfo
+ nextFunc func() error
+
+ // 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 []*appgatewayspb.AppGateway, nextPageToken string, err error)
+}
+
+// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
+func (it *AppGatewayIterator) PageInfo() *iterator.PageInfo {
+ return it.pageInfo
+}
+
+// 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 (it *AppGatewayIterator) Next() (*appgatewayspb.AppGateway, error) {
+ var item *appgatewayspb.AppGateway
+ if err := it.nextFunc(); err != nil {
+ return item, err
+ }
+ item = it.items[0]
+ it.items = it.items[1:]
+ return item, nil
+}
+
+func (it *AppGatewayIterator) bufLen() int {
+ return len(it.items)
+}
+
+func (it *AppGatewayIterator) takeBuf() interface{} {
+ b := it.items
+ it.items = nil
+ return b
+}
+
+// LocationIterator manages a stream of *locationpb.Location.
+type LocationIterator struct {
+ items []*locationpb.Location
+ pageInfo *iterator.PageInfo
+ nextFunc func() error
+
+ // 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)
+}
+
+// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
+func (it *LocationIterator) PageInfo() *iterator.PageInfo {
+ return it.pageInfo
+}
+
+// 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 (it *LocationIterator) Next() (*locationpb.Location, error) {
+ var item *locationpb.Location
+ if err := it.nextFunc(); err != nil {
+ return item, err
+ }
+ item = it.items[0]
+ it.items = it.items[1:]
+ return item, nil
+}
+
+func (it *LocationIterator) bufLen() int {
+ return len(it.items)
+}
+
+func (it *LocationIterator) takeBuf() interface{} {
+ b := it.items
+ it.items = nil
+ return b
+}
+
+// OperationIterator manages a stream of *longrunningpb.Operation.
+type OperationIterator struct {
+ items []*longrunningpb.Operation
+ pageInfo *iterator.PageInfo
+ nextFunc func() error
+
+ // 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)
+}
+
+// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
+func (it *OperationIterator) PageInfo() *iterator.PageInfo {
+ return it.pageInfo
+}
+
+// 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 (it *OperationIterator) Next() (*longrunningpb.Operation, error) {
+ var item *longrunningpb.Operation
+ if err := it.nextFunc(); err != nil {
+ return item, err
+ }
+ item = it.items[0]
+ it.items = it.items[1:]
+ return item, nil
+}
+
+func (it *OperationIterator) bufLen() int {
+ return len(it.items)
+}
+
+func (it *OperationIterator) takeBuf() interface{} {
+ b := it.items
+ it.items = nil
+ return b
+}
diff --git a/beyondcorp/appgateways/apiv1/app_gateways_client_example_test.go b/beyondcorp/appgateways/apiv1/app_gateways_client_example_test.go
new file mode 100644
index 0000000..db3d582
--- /dev/null
+++ b/beyondcorp/appgateways/apiv1/app_gateways_client_example_test.go
@@ -0,0 +1,322 @@
+// Copyright 2022 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
+
+package appgateways_test
+
+import (
+ "context"
+
+ appgateways "cloud.google.com/go/beyondcorp/appgateways/apiv1"
+ "google.golang.org/api/iterator"
+ appgatewayspb "google.golang.org/genproto/googleapis/cloud/beyondcorp/appgateways/v1"
+ locationpb "google.golang.org/genproto/googleapis/cloud/location"
+ iampb "google.golang.org/genproto/googleapis/iam/v1"
+ longrunningpb "google.golang.org/genproto/googleapis/longrunning"
+)
+
+func ExampleNewClient() {
+ ctx := context.Background()
+ c, err := appgateways.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ defer c.Close()
+
+ // TODO: Use client.
+ _ = c
+}
+
+func ExampleClient_ListAppGateways() {
+ ctx := context.Background()
+ c, err := appgateways.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ defer c.Close()
+
+ req := &appgatewayspb.ListAppGatewaysRequest{
+ // TODO: Fill request struct fields.
+ // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/beyondcorp/appgateways/v1#ListAppGatewaysRequest.
+ }
+ it := c.ListAppGateways(ctx, req)
+ for {
+ resp, err := it.Next()
+ if err == iterator.Done {
+ break
+ }
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+ }
+}
+
+func ExampleClient_GetAppGateway() {
+ ctx := context.Background()
+ c, err := appgateways.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ defer c.Close()
+
+ req := &appgatewayspb.GetAppGatewayRequest{
+ // TODO: Fill request struct fields.
+ // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/beyondcorp/appgateways/v1#GetAppGatewayRequest.
+ }
+ resp, err := c.GetAppGateway(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+}
+
+func ExampleClient_CreateAppGateway() {
+ ctx := context.Background()
+ c, err := appgateways.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ defer c.Close()
+
+ req := &appgatewayspb.CreateAppGatewayRequest{
+ // TODO: Fill request struct fields.
+ // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/beyondcorp/appgateways/v1#CreateAppGatewayRequest.
+ }
+ op, err := c.CreateAppGateway(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ resp, err := op.Wait(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+}
+
+func ExampleClient_DeleteAppGateway() {
+ ctx := context.Background()
+ c, err := appgateways.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ defer c.Close()
+
+ req := &appgatewayspb.DeleteAppGatewayRequest{
+ // TODO: Fill request struct fields.
+ // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/beyondcorp/appgateways/v1#DeleteAppGatewayRequest.
+ }
+ op, err := c.DeleteAppGateway(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ err = op.Wait(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+}
+
+func ExampleClient_GetLocation() {
+ ctx := context.Background()
+ c, err := appgateways.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 ExampleClient_ListLocations() {
+ ctx := context.Background()
+ c, err := appgateways.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
+ }
+}
+
+func ExampleClient_GetIamPolicy() {
+ ctx := context.Background()
+ c, err := appgateways.NewClient(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 ExampleClient_SetIamPolicy() {
+ ctx := context.Background()
+ c, err := appgateways.NewClient(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 ExampleClient_TestIamPermissions() {
+ ctx := context.Background()
+ c, err := appgateways.NewClient(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 ExampleClient_CancelOperation() {
+ ctx := context.Background()
+ c, err := appgateways.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ defer c.Close()
+
+ req := &longrunningpb.CancelOperationRequest{
+ // TODO: Fill request struct fields.
+ // See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#CancelOperationRequest.
+ }
+ err = c.CancelOperation(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+}
+
+func ExampleClient_DeleteOperation() {
+ ctx := context.Background()
+ c, err := appgateways.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ defer c.Close()
+
+ req := &longrunningpb.DeleteOperationRequest{
+ // TODO: Fill request struct fields.
+ // See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#DeleteOperationRequest.
+ }
+ err = c.DeleteOperation(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+}
+
+func ExampleClient_GetOperation() {
+ ctx := context.Background()
+ c, err := appgateways.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ defer c.Close()
+
+ req := &longrunningpb.GetOperationRequest{
+ // TODO: Fill request struct fields.
+ // See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#GetOperationRequest.
+ }
+ resp, err := c.GetOperation(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+}
+
+func ExampleClient_ListOperations() {
+ ctx := context.Background()
+ c, err := appgateways.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ defer c.Close()
+
+ req := &longrunningpb.ListOperationsRequest{
+ // TODO: Fill request struct fields.
+ // See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#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
+ }
+}
diff --git a/beyondcorp/appgateways/apiv1/doc.go b/beyondcorp/appgateways/apiv1/doc.go
new file mode 100644
index 0000000..31de203
--- /dev/null
+++ b/beyondcorp/appgateways/apiv1/doc.go
@@ -0,0 +1,170 @@
+// Copyright 2022 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
+
+// Package appgateways is an auto-generated package for the
+// BeyondCorp API.
+//
+// Beyondcorp Enterprise provides identity and context aware access controls
+// for enterprise resources and enables zero-trust access. Using the
+// Beyondcorp Enterprise APIs, enterprises can set up multi-cloud and on-prem
+// connectivity using the App Connector hybrid connectivity solution.
+//
+// NOTE: This package is in beta. It is not stable, and may be subject to changes.
+//
+// Example usage
+//
+// To get started with this package, create a client.
+// ctx := context.Background()
+// c, err := appgateways.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.
+//
+// ctx := context.Background()
+// c, err := appgateways.NewClient(ctx)
+// if err != nil {
+// // TODO: Handle error.
+// }
+// defer c.Close()
+//
+// req := &appgatewayspb.ListAppGatewaysRequest{
+// // TODO: Fill request struct fields.
+// // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/beyondcorp/appgateways/v1#ListAppGatewaysRequest.
+// }
+// it := c.ListAppGateways(ctx, req)
+// for {
+// resp, err := it.Next()
+// if err == iterator.Done {
+// break
+// }
+// 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.
+//
+// For information about setting deadlines, reusing contexts, and more
+// please visit https://pkg.go.dev/cloud.google.com/go.
+package appgateways // import "cloud.google.com/go/beyondcorp/appgateways/apiv1"
+
+import (
+ "context"
+ "os"
+ "runtime"
+ "strconv"
+ "strings"
+ "unicode"
+
+ "google.golang.org/api/option"
+ "google.golang.org/grpc/metadata"
+)
+
+// For more information on implementing a client constructor hook, see
+// https://github.com/googleapis/google-cloud-go/wiki/Customizing-constructors.
+type clientHookParams struct{}
+type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error)
+
+var versionClient string
+
+func getVersionClient() string {
+ if versionClient == "" {
+ return "UNKNOWN"
+ }
+ return versionClient
+}
+
+func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
+ out, _ := metadata.FromOutgoingContext(ctx)
+ out = out.Copy()
+ for _, md := range mds {
+ for k, v := range md {
+ out[k] = append(out[k], v...)
+ }
+ }
+ return metadata.NewOutgoingContext(ctx, out)
+}
+
+func checkDisableDeadlines() (bool, error) {
+ raw, ok := os.LookupEnv("GOOGLE_API_GO_EXPERIMENTAL_DISABLE_DEFAULT_DEADLINE")
+ if !ok {
+ return false, nil
+ }
+
+ b, err := strconv.ParseBool(raw)
+ return b, err
+}
+
+// DefaultAuthScopes reports the default set of authentication scopes to use with this package.
+func DefaultAuthScopes() []string {
+ return []string{
+ "https://www.googleapis.com/auth/cloud-platform",
+ }
+}
+
+// versionGo returns the Go runtime version. The returned string
+// has no whitespace, suitable for reporting in header.
+func versionGo() string {
+ const develPrefix = "devel +"
+
+ s := runtime.Version()
+ if strings.HasPrefix(s, develPrefix) {
+ s = s[len(develPrefix):]
+ if p := strings.IndexFunc(s, unicode.IsSpace); p >= 0 {
+ s = s[:p]
+ }
+ return s
+ }
+
+ notSemverRune := func(r rune) bool {
+ return !strings.ContainsRune("0123456789.", r)
+ }
+
+ if strings.HasPrefix(s, "go1") {
+ s = s[2:]
+ var prerelease string
+ if p := strings.IndexFunc(s, notSemverRune); p >= 0 {
+ s, prerelease = s[:p], s[p:]
+ }
+ if strings.HasSuffix(s, ".") {
+ s += "0"
+ } else if strings.Count(s, ".") < 2 {
+ s += ".0"
+ }
+ if prerelease != "" {
+ s += "-" + prerelease
+ }
+ return s
+ }
+ return "UNKNOWN"
+}
diff --git a/beyondcorp/appgateways/apiv1/gapic_metadata.json b/beyondcorp/appgateways/apiv1/gapic_metadata.json
new file mode 100644
index 0000000..82c7168
--- /dev/null
+++ b/beyondcorp/appgateways/apiv1/gapic_metadata.json
@@ -0,0 +1,83 @@
+{
+ "schema": "1.0",
+ "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.",
+ "language": "go",
+ "protoPackage": "google.cloud.beyondcorp.appgateways.v1",
+ "libraryPackage": "cloud.google.com/go/beyondcorp/appgateways/apiv1",
+ "services": {
+ "AppGatewaysService": {
+ "clients": {
+ "grpc": {
+ "libraryClient": "Client",
+ "rpcs": {
+ "CancelOperation": {
+ "methods": [
+ "CancelOperation"
+ ]
+ },
+ "CreateAppGateway": {
+ "methods": [
+ "CreateAppGateway"
+ ]
+ },
+ "DeleteAppGateway": {
+ "methods": [
+ "DeleteAppGateway"
+ ]
+ },
+ "DeleteOperation": {
+ "methods": [
+ "DeleteOperation"
+ ]
+ },
+ "GetAppGateway": {
+ "methods": [
+ "GetAppGateway"
+ ]
+ },
+ "GetIamPolicy": {
+ "methods": [
+ "GetIamPolicy"
+ ]
+ },
+ "GetLocation": {
+ "methods": [
+ "GetLocation"
+ ]
+ },
+ "GetOperation": {
+ "methods": [
+ "GetOperation"
+ ]
+ },
+ "ListAppGateways": {
+ "methods": [
+ "ListAppGateways"
+ ]
+ },
+ "ListLocations": {
+ "methods": [
+ "ListLocations"
+ ]
+ },
+ "ListOperations": {
+ "methods": [
+ "ListOperations"
+ ]
+ },
+ "SetIamPolicy": {
+ "methods": [
+ "SetIamPolicy"
+ ]
+ },
+ "TestIamPermissions": {
+ "methods": [
+ "TestIamPermissions"
+ ]
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/beyondcorp/appgateways/apiv1/version.go b/beyondcorp/appgateways/apiv1/version.go
new file mode 100644
index 0000000..3135565
--- /dev/null
+++ b/beyondcorp/appgateways/apiv1/version.go
@@ -0,0 +1,23 @@
+// Copyright 2022 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Code generated by gapicgen. DO NOT EDIT.
+
+package appgateways
+
+import "cloud.google.com/go/beyondcorp/internal"
+
+func init() {
+ versionClient = internal.Version
+}
diff --git a/beyondcorp/clientconnectorservices/apiv1/client_connector_services_client.go b/beyondcorp/clientconnectorservices/apiv1/client_connector_services_client.go
new file mode 100644
index 0000000..313025f
--- /dev/null
+++ b/beyondcorp/clientconnectorservices/apiv1/client_connector_services_client.go
@@ -0,0 +1,1027 @@
+// Copyright 2022 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
+
+package clientconnectorservices
+
+import (
+ "context"
+ "fmt"
+ "math"
+ "net/url"
+ "time"
+
+ "cloud.google.com/go/longrunning"
+ lroauto "cloud.google.com/go/longrunning/autogen"
+ gax "github.com/googleapis/gax-go/v2"
+ "google.golang.org/api/iterator"
+ "google.golang.org/api/option"
+ "google.golang.org/api/option/internaloption"
+ gtransport "google.golang.org/api/transport/grpc"
+ clientconnectorservicespb "google.golang.org/genproto/googleapis/cloud/beyondcorp/clientconnectorservices/v1"
+ locationpb "google.golang.org/genproto/googleapis/cloud/location"
+ iampb "google.golang.org/genproto/googleapis/iam/v1"
+ longrunningpb "google.golang.org/genproto/googleapis/longrunning"
+ "google.golang.org/grpc"
+ "google.golang.org/grpc/metadata"
+ "google.golang.org/protobuf/proto"
+)
+
+var newClientHook clientHook
+
+// CallOptions contains the retry settings for each method of Client.
+type CallOptions struct {
+ ListClientConnectorServices []gax.CallOption
+ GetClientConnectorService []gax.CallOption
+ CreateClientConnectorService []gax.CallOption
+ UpdateClientConnectorService []gax.CallOption
+ DeleteClientConnectorService []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
+}
+
+func defaultGRPCClientOptions() []option.ClientOption {
+ return []option.ClientOption{
+ internaloption.WithDefaultEndpoint("beyondcorp.googleapis.com:443"),
+ internaloption.WithDefaultMTLSEndpoint("beyondcorp.mtls.googleapis.com:443"),
+ internaloption.WithDefaultAudience("https://beyondcorp.googleapis.com/"),
+ internaloption.WithDefaultScopes(DefaultAuthScopes()...),
+ internaloption.EnableJwtWithScope(),
+ option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
+ grpc.MaxCallRecvMsgSize(math.MaxInt32))),
+ }
+}
+
+func defaultCallOptions() *CallOptions {
+ return &CallOptions{
+ ListClientConnectorServices: []gax.CallOption{},
+ GetClientConnectorService: []gax.CallOption{},
+ CreateClientConnectorService: []gax.CallOption{},
+ UpdateClientConnectorService: []gax.CallOption{},
+ DeleteClientConnectorService: []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{},
+ }
+}
+
+// internalClient is an interface that defines the methods available from BeyondCorp API.
+type internalClient interface {
+ Close() error
+ setGoogleClientInfo(...string)
+ Connection() *grpc.ClientConn
+ ListClientConnectorServices(context.Context, *clientconnectorservicespb.ListClientConnectorServicesRequest, ...gax.CallOption) *ClientConnectorServiceIterator
+ GetClientConnectorService(context.Context, *clientconnectorservicespb.GetClientConnectorServiceRequest, ...gax.CallOption) (*clientconnectorservicespb.ClientConnectorService, error)
+ CreateClientConnectorService(context.Context, *clientconnectorservicespb.CreateClientConnectorServiceRequest, ...gax.CallOption) (*CreateClientConnectorServiceOperation, error)
+ CreateClientConnectorServiceOperation(name string) *CreateClientConnectorServiceOperation
+ UpdateClientConnectorService(context.Context, *clientconnectorservicespb.UpdateClientConnectorServiceRequest, ...gax.CallOption) (*UpdateClientConnectorServiceOperation, error)
+ UpdateClientConnectorServiceOperation(name string) *UpdateClientConnectorServiceOperation
+ DeleteClientConnectorService(context.Context, *clientconnectorservicespb.DeleteClientConnectorServiceRequest, ...gax.CallOption) (*DeleteClientConnectorServiceOperation, error)
+ DeleteClientConnectorServiceOperation(name string) *DeleteClientConnectorServiceOperation
+ GetLocation(context.Context, *locationpb.GetLocationRequest, ...gax.CallOption) (*locationpb.Location, error)
+ ListLocations(context.Context, *locationpb.ListLocationsRequest, ...gax.CallOption) *LocationIterator
+ GetIamPolicy(context.Context, *iampb.GetIamPolicyRequest, ...gax.CallOption) (*iampb.Policy, error)
+ SetIamPolicy(context.Context, *iampb.SetIamPolicyRequest, ...gax.CallOption) (*iampb.Policy, error)
+ TestIamPermissions(context.Context, *iampb.TestIamPermissionsRequest, ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error)
+ CancelOperation(context.Context, *longrunningpb.CancelOperationRequest, ...gax.CallOption) error
+ DeleteOperation(context.Context, *longrunningpb.DeleteOperationRequest, ...gax.CallOption) error
+ GetOperation(context.Context, *longrunningpb.GetOperationRequest, ...gax.CallOption) (*longrunningpb.Operation, error)
+ ListOperations(context.Context, *longrunningpb.ListOperationsRequest, ...gax.CallOption) *OperationIterator
+}
+
+// Client is a client for interacting with BeyondCorp API.
+// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
+//
+// API OverviewThe beyondcorp.googleapis.com service implements the Google Cloud
+// BeyondCorp API.
+//
+// Data ModelThe ClientConnectorServicesService exposes the following resources:
+//
+// Client Connector Services, named as follows:
+// projects/{project_id}/locations/{location_id}/client_connector_services/{client_connector_service_id}.
+type Client struct {
+ // The internal transport-dependent client.
+ internalClient internalClient
+
+ // 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
+}
+
+// Wrapper methods routed to the internal client.
+
+// Close closes the connection to the API service. The user should invoke this when
+// the client is no longer required.
+func (c *Client) Close() error {
+ return c.internalClient.Close()
+}
+
+// setGoogleClientInfo sets the name and version of the application in
+// the `x-goog-api-client` header passed on each request. Intended for
+// use by Google-written clients.
+func (c *Client) setGoogleClientInfo(keyval ...string) {
+ c.internalClient.setGoogleClientInfo(keyval...)
+}
+
+// Connection returns a connection to the API service.
+//
+// Deprecated.
+func (c *Client) Connection() *grpc.ClientConn {
+ return c.internalClient.Connection()
+}
+
+// ListClientConnectorServices lists ClientConnectorServices in a given project and location.
+func (c *Client) ListClientConnectorServices(ctx context.Context, req *clientconnectorservicespb.ListClientConnectorServicesRequest, opts ...gax.CallOption) *ClientConnectorServiceIterator {
+ return c.internalClient.ListClientConnectorServices(ctx, req, opts...)
+}
+
+// GetClientConnectorService gets details of a single ClientConnectorService.
+func (c *Client) GetClientConnectorService(ctx context.Context, req *clientconnectorservicespb.GetClientConnectorServiceRequest, opts ...gax.CallOption) (*clientconnectorservicespb.ClientConnectorService, error) {
+ return c.internalClient.GetClientConnectorService(ctx, req, opts...)
+}
+
+// CreateClientConnectorService creates a new ClientConnectorService in a given project and location.
+func (c *Client) CreateClientConnectorService(ctx context.Context, req *clientconnectorservicespb.CreateClientConnectorServiceRequest, opts ...gax.CallOption) (*CreateClientConnectorServiceOperation, error) {
+ return c.internalClient.CreateClientConnectorService(ctx, req, opts...)
+}
+
+// CreateClientConnectorServiceOperation returns a new CreateClientConnectorServiceOperation from a given name.
+// The name must be that of a previously created CreateClientConnectorServiceOperation, possibly from a different process.
+func (c *Client) CreateClientConnectorServiceOperation(name string) *CreateClientConnectorServiceOperation {
+ return c.internalClient.CreateClientConnectorServiceOperation(name)
+}
+
+// UpdateClientConnectorService updates the parameters of a single ClientConnectorService.
+func (c *Client) UpdateClientConnectorService(ctx context.Context, req *clientconnectorservicespb.UpdateClientConnectorServiceRequest, opts ...gax.CallOption) (*UpdateClientConnectorServiceOperation, error) {
+ return c.internalClient.UpdateClientConnectorService(ctx, req, opts...)
+}
+
+// UpdateClientConnectorServiceOperation returns a new UpdateClientConnectorServiceOperation from a given name.
+// The name must be that of a previously created UpdateClientConnectorServiceOperation, possibly from a different process.
+func (c *Client) UpdateClientConnectorServiceOperation(name string) *UpdateClientConnectorServiceOperation {
+ return c.internalClient.UpdateClientConnectorServiceOperation(name)
+}
+
+// DeleteClientConnectorService deletes a single ClientConnectorService.
+func (c *Client) DeleteClientConnectorService(ctx context.Context, req *clientconnectorservicespb.DeleteClientConnectorServiceRequest, opts ...gax.CallOption) (*DeleteClientConnectorServiceOperation, error) {
+ return c.internalClient.DeleteClientConnectorService(ctx, req, opts...)
+}
+
+// DeleteClientConnectorServiceOperation returns a new DeleteClientConnectorServiceOperation from a given name.
+// The name must be that of a previously created DeleteClientConnectorServiceOperation, possibly from a different process.
+func (c *Client) DeleteClientConnectorServiceOperation(name string) *DeleteClientConnectorServiceOperation {
+ return c.internalClient.DeleteClientConnectorServiceOperation(name)
+}
+
+// GetLocation gets information about a location.
+func (c *Client) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error) {
+ return c.internalClient.GetLocation(ctx, req, opts...)
+}
+
+// ListLocations lists information about the supported locations for this service.
+func (c *Client) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator {
+ return c.internalClient.ListLocations(ctx, req, opts...)
+}
+
+// GetIamPolicy gets the access control policy for a resource. Returns an empty policy
+// if the resource exists and does not have a policy set.
+func (c *Client) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) {
+ return c.internalClient.GetIamPolicy(ctx, req, opts...)
+}
+
+// SetIamPolicy sets the access control policy on the specified resource. Replaces
+// any existing policy.
+//
+// Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED
+// errors.
+func (c *Client) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) {
+ return c.internalClient.SetIamPolicy(ctx, req, opts...)
+}
+
+// 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.
+func (c *Client) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, opts ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error) {
+ return c.internalClient.TestIamPermissions(ctx, req, opts...)
+}
+
+// CancelOperation is a utility method from google.longrunning.Operations.
+func (c *Client) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error {
+ return c.internalClient.CancelOperation(ctx, req, opts...)
+}
+
+// DeleteOperation is a utility method from google.longrunning.Operations.
+func (c *Client) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error {
+ return c.internalClient.DeleteOperation(ctx, req, opts...)
+}
+
+// GetOperation is a utility method from google.longrunning.Operations.
+func (c *Client) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) {
+ return c.internalClient.GetOperation(ctx, req, opts...)
+}
+
+// ListOperations is a utility method from google.longrunning.Operations.
+func (c *Client) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator {
+ return c.internalClient.ListOperations(ctx, req, opts...)
+}
+
+// gRPCClient is a client for interacting with BeyondCorp API over gRPC transport.
+//
+// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
+type gRPCClient struct {
+ // Connection pool of gRPC connections to the service.
+ connPool gtransport.ConnPool
+
+ // flag to opt out of default deadlines via GOOGLE_API_GO_EXPERIMENTAL_DISABLE_DEFAULT_DEADLINE
+ disableDeadlines bool
+
+ // Points back to the CallOptions field of the containing Client
+ CallOptions **CallOptions
+
+ // The gRPC API client.
+ client clientconnectorservicespb.ClientConnectorServicesServiceClient
+
+ // 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
+
+ operationsClient longrunningpb.OperationsClient
+
+ iamPolicyClient iampb.IAMPolicyClient
+
+ locationsClient locationpb.LocationsClient
+
+ // The x-goog-* metadata to be sent with each request.
+ xGoogMetadata metadata.MD
+}
+
+// NewClient creates a new client connector services service client based on gRPC.
+// The returned client must be Closed when it is done being used to clean up its underlying connections.
+//
+// API OverviewThe beyondcorp.googleapis.com service implements the Google Cloud
+// BeyondCorp API.
+//
+// Data ModelThe ClientConnectorServicesService exposes the following resources:
+//
+// Client Connector Services, named as follows:
+// projects/{project_id}/locations/{location_id}/client_connector_services/{client_connector_service_id}.
+func NewClient(ctx context.Context, opts ...option.ClientOption) (*Client, error) {
+ clientOpts := defaultGRPCClientOptions()
+ if newClientHook != nil {
+ hookOpts, err := newClientHook(ctx, clientHookParams{})
+ if err != nil {
+ return nil, err
+ }
+ clientOpts = append(clientOpts, hookOpts...)
+ }
+
+ disableDeadlines, err := checkDisableDeadlines()
+ if err != nil {
+ return nil, err
+ }
+
+ connPool, err := gtransport.DialPool(ctx, append(clientOpts, opts...)...)
+ if err != nil {
+ return nil, err
+ }
+ client := Client{CallOptions: defaultCallOptions()}
+
+ c := &gRPCClient{
+ connPool: connPool,
+ disableDeadlines: disableDeadlines,
+ client: clientconnectorservicespb.NewClientConnectorServicesServiceClient(connPool),
+ CallOptions: &client.CallOptions,
+ operationsClient: longrunningpb.NewOperationsClient(connPool),
+ iamPolicyClient: iampb.NewIAMPolicyClient(connPool),
+ locationsClient: locationpb.NewLocationsClient(connPool),
+ }
+ c.setGoogleClientInfo()
+
+ client.internalClient = c
+
+ client.LROClient, err = lroauto.NewOperationsClient(ctx, gtransport.WithConnPool(connPool))
+ if err != nil {
+ // This error "should not happen", since we are just reusing old connection pool
+ // and never actually need to dial.
+ // If this does happen, we could leak connp. However, we cannot close conn:
+ // If the user invoked the constructor with option.WithGRPCConn,
+ // we would close a connection that's still in use.
+ // TODO: investigate error conditions.
+ return nil, err
+ }
+ c.LROClient = &client.LROClient
+ return &client, nil
+}
+
+// Connection returns a connection to the API service.
+//
+// Deprecated.
+func (c *gRPCClient) Connection() *grpc.ClientConn {
+ return c.connPool.Conn()
+}
+
+// setGoogleClientInfo sets the name and version of the application in
+// the `x-goog-api-client` header passed on each request. Intended for
+// use by Google-written clients.
+func (c *gRPCClient) setGoogleClientInfo(keyval ...string) {
+ kv := append([]string{"gl-go", versionGo()}, keyval...)
+ kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version)
+ c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
+}
+
+// Close closes the connection to the API service. The user should invoke this when
+// the client is no longer required.
+func (c *gRPCClient) Close() error {
+ return c.connPool.Close()
+}
+
+func (c *gRPCClient) ListClientConnectorServices(ctx context.Context, req *clientconnectorservicespb.ListClientConnectorServicesRequest, opts ...gax.CallOption) *ClientConnectorServiceIterator {
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent())))
+
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ opts = append((*c.CallOptions).ListClientConnectorServices[0:len((*c.CallOptions).ListClientConnectorServices):len((*c.CallOptions).ListClientConnectorServices)], opts...)
+ it := &ClientConnectorServiceIterator{}
+ req = proto.Clone(req).(*clientconnectorservicespb.ListClientConnectorServicesRequest)
+ it.InternalFetch = func(pageSize int, pageToken string) ([]*clientconnectorservicespb.ClientConnectorService, string, error) {
+ resp := &clientconnectorservicespb.ListClientConnectorServicesResponse{}
+ if pageToken != "" {
+ req.PageToken = pageToken
+ }
+ if pageSize > math.MaxInt32 {
+ req.PageSize = math.MaxInt32
+ } else if pageSize != 0 {
+ req.PageSize = int32(pageSize)
+ }
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.client.ListClientConnectorServices(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, "", err
+ }
+
+ it.Response = resp
+ return resp.GetClientConnectorServices(), resp.GetNextPageToken(), nil
+ }
+ fetch := func(pageSize int, pageToken string) (string, error) {
+ items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
+ if err != nil {
+ return "", err
+ }
+ it.items = append(it.items, items...)
+ return nextPageToken, nil
+ }
+
+ it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
+ it.pageInfo.MaxSize = int(req.GetPageSize())
+ it.pageInfo.Token = req.GetPageToken()
+
+ return it
+}
+
+func (c *gRPCClient) GetClientConnectorService(ctx context.Context, req *clientconnectorservicespb.GetClientConnectorServiceRequest, opts ...gax.CallOption) (*clientconnectorservicespb.ClientConnectorService, error) {
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName())))
+
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ opts = append((*c.CallOptions).GetClientConnectorService[0:len((*c.CallOptions).GetClientConnectorService):len((*c.CallOptions).GetClientConnectorService)], opts...)
+ var resp *clientconnectorservicespb.ClientConnectorService
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.client.GetClientConnectorService(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+func (c *gRPCClient) CreateClientConnectorService(ctx context.Context, req *clientconnectorservicespb.CreateClientConnectorServiceRequest, opts ...gax.CallOption) (*CreateClientConnectorServiceOperation, error) {
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent())))
+
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ opts = append((*c.CallOptions).CreateClientConnectorService[0:len((*c.CallOptions).CreateClientConnectorService):len((*c.CallOptions).CreateClientConnectorService)], opts...)
+ var resp *longrunningpb.Operation
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.client.CreateClientConnectorService(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return &CreateClientConnectorServiceOperation{
+ lro: longrunning.InternalNewOperation(*c.LROClient, resp),
+ }, nil
+}
+
+func (c *gRPCClient) UpdateClientConnectorService(ctx context.Context, req *clientconnectorservicespb.UpdateClientConnectorServiceRequest, opts ...gax.CallOption) (*UpdateClientConnectorServiceOperation, error) {
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "client_connector_service.name", url.QueryEscape(req.GetClientConnectorService().GetName())))
+
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ opts = append((*c.CallOptions).UpdateClientConnectorService[0:len((*c.CallOptions).UpdateClientConnectorService):len((*c.CallOptions).UpdateClientConnectorService)], opts...)
+ var resp *longrunningpb.Operation
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.client.UpdateClientConnectorService(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return &UpdateClientConnectorServiceOperation{
+ lro: longrunning.InternalNewOperation(*c.LROClient, resp),
+ }, nil
+}
+
+func (c *gRPCClient) DeleteClientConnectorService(ctx context.Context, req *clientconnectorservicespb.DeleteClientConnectorServiceRequest, opts ...gax.CallOption) (*DeleteClientConnectorServiceOperation, error) {
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName())))
+
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ opts = append((*c.CallOptions).DeleteClientConnectorService[0:len((*c.CallOptions).DeleteClientConnectorService):len((*c.CallOptions).DeleteClientConnectorService)], opts...)
+ var resp *longrunningpb.Operation
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.client.DeleteClientConnectorService(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return &DeleteClientConnectorServiceOperation{
+ lro: longrunning.InternalNewOperation(*c.LROClient, resp),
+ }, nil
+}
+
+func (c *gRPCClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error) {
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName())))
+
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ opts = append((*c.CallOptions).GetLocation[0:len((*c.CallOptions).GetLocation):len((*c.CallOptions).GetLocation)], opts...)
+ var resp *locationpb.Location
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.locationsClient.GetLocation(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+func (c *gRPCClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator {
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName())))
+
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ opts = append((*c.CallOptions).ListLocations[0:len((*c.CallOptions).ListLocations):len((*c.CallOptions).ListLocations)], opts...)
+ it := &LocationIterator{}
+ req = proto.Clone(req).(*locationpb.ListLocationsRequest)
+ it.InternalFetch = func(pageSize int, pageToken string) ([]*locationpb.Location, string, error) {
+ resp := &locationpb.ListLocationsResponse{}
+ if pageToken != "" {
+ req.PageToken = pageToken
+ }
+ if pageSize > math.MaxInt32 {
+ req.PageSize = math.MaxInt32
+ } else if pageSize != 0 {
+ req.PageSize = int32(pageSize)
+ }
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.locationsClient.ListLocations(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, "", err
+ }
+
+ it.Response = resp
+ return resp.GetLocations(), resp.GetNextPageToken(), nil
+ }
+ fetch := func(pageSize int, pageToken string) (string, error) {
+ items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
+ if err != nil {
+ return "", err
+ }
+ it.items = append(it.items, items...)
+ return nextPageToken, nil
+ }
+
+ it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
+ it.pageInfo.MaxSize = int(req.GetPageSize())
+ it.pageInfo.Token = req.GetPageToken()
+
+ return it
+}
+
+func (c *gRPCClient) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) {
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "resource", url.QueryEscape(req.GetResource())))
+
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ opts = append((*c.CallOptions).GetIamPolicy[0:len((*c.CallOptions).GetIamPolicy):len((*c.CallOptions).GetIamPolicy)], opts...)
+ var resp *iampb.Policy
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.iamPolicyClient.GetIamPolicy(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+func (c *gRPCClient) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) {
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "resource", url.QueryEscape(req.GetResource())))
+
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ opts = append((*c.CallOptions).SetIamPolicy[0:len((*c.CallOptions).SetIamPolicy):len((*c.CallOptions).SetIamPolicy)], opts...)
+ var resp *iampb.Policy
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.iamPolicyClient.SetIamPolicy(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+func (c *gRPCClient) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, opts ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error) {
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "resource", url.QueryEscape(req.GetResource())))
+
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ opts = append((*c.CallOptions).TestIamPermissions[0:len((*c.CallOptions).TestIamPermissions):len((*c.CallOptions).TestIamPermissions)], opts...)
+ var resp *iampb.TestIamPermissionsResponse
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.iamPolicyClient.TestIamPermissions(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+func (c *gRPCClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error {
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName())))
+
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ opts = append((*c.CallOptions).CancelOperation[0:len((*c.CallOptions).CancelOperation):len((*c.CallOptions).CancelOperation)], opts...)
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ _, err = c.operationsClient.CancelOperation(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ return err
+}
+
+func (c *gRPCClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error {
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName())))
+
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ opts = append((*c.CallOptions).DeleteOperation[0:len((*c.CallOptions).DeleteOperation):len((*c.CallOptions).DeleteOperation)], opts...)
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ _, err = c.operationsClient.DeleteOperation(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ return err
+}
+
+func (c *gRPCClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) {
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName())))
+
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ opts = append((*c.CallOptions).GetOperation[0:len((*c.CallOptions).GetOperation):len((*c.CallOptions).GetOperation)], opts...)
+ var resp *longrunningpb.Operation
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.operationsClient.GetOperation(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+func (c *gRPCClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator {
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName())))
+
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ opts = append((*c.CallOptions).ListOperations[0:len((*c.CallOptions).ListOperations):len((*c.CallOptions).ListOperations)], opts...)
+ it := &OperationIterator{}
+ req = proto.Clone(req).(*longrunningpb.ListOperationsRequest)
+ it.InternalFetch = func(pageSize int, pageToken string) ([]*longrunningpb.Operation, string, error) {
+ resp := &longrunningpb.ListOperationsResponse{}
+ if pageToken != "" {
+ req.PageToken = pageToken
+ }
+ if pageSize > math.MaxInt32 {
+ req.PageSize = math.MaxInt32
+ } else if pageSize != 0 {
+ req.PageSize = int32(pageSize)
+ }
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.operationsClient.ListOperations(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, "", err
+ }
+
+ it.Response = resp
+ return resp.GetOperations(), resp.GetNextPageToken(), nil
+ }
+ fetch := func(pageSize int, pageToken string) (string, error) {
+ items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
+ if err != nil {
+ return "", err
+ }
+ it.items = append(it.items, items...)
+ return nextPageToken, nil
+ }
+
+ it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
+ it.pageInfo.MaxSize = int(req.GetPageSize())
+ it.pageInfo.Token = req.GetPageToken()
+
+ return it
+}
+
+// CreateClientConnectorServiceOperation manages a long-running operation from CreateClientConnectorService.
+type CreateClientConnectorServiceOperation struct {
+ lro *longrunning.Operation
+}
+
+// CreateClientConnectorServiceOperation returns a new CreateClientConnectorServiceOperation from a given name.
+// The name must be that of a previously created CreateClientConnectorServiceOperation, possibly from a different process.
+func (c *gRPCClient) CreateClientConnectorServiceOperation(name string) *CreateClientConnectorServiceOperation {
+ return &CreateClientConnectorServiceOperation{
+ lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
+ }
+}
+
+// Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
+//
+// See documentation of Poll for error-handling information.
+func (op *CreateClientConnectorServiceOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*clientconnectorservicespb.ClientConnectorService, error) {
+ var resp clientconnectorservicespb.ClientConnectorService
+ if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
+ return nil, err
+ }
+ return &resp, nil
+}
+
+// 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 (op *CreateClientConnectorServiceOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*clientconnectorservicespb.ClientConnectorService, error) {
+ var resp clientconnectorservicespb.ClientConnectorService
+ if err := op.lro.Poll(ctx, &resp, opts...); err != nil {
+ return nil, err
+ }
+ if !op.Done() {
+ return nil, nil
+ }
+ return &resp, nil
+}
+
+// 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 (op *CreateClientConnectorServiceOperation) Metadata() (*clientconnectorservicespb.ClientConnectorServiceOperationMetadata, error) {
+ var meta clientconnectorservicespb.ClientConnectorServiceOperationMetadata
+ if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
+ return nil, nil
+ } else if err != nil {
+ return nil, err
+ }
+ return &meta, nil
+}
+
+// Done reports whether the long-running operation has completed.
+func (op *CreateClientConnectorServiceOperation) Done() bool {
+ return op.lro.Done()
+}
+
+// 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 (op *CreateClientConnectorServiceOperation) Name() string {
+ return op.lro.Name()
+}
+
+// DeleteClientConnectorServiceOperation manages a long-running operation from DeleteClientConnectorService.
+type DeleteClientConnectorServiceOperation struct {
+ lro *longrunning.Operation
+}
+
+// DeleteClientConnectorServiceOperation returns a new DeleteClientConnectorServiceOperation from a given name.
+// The name must be that of a previously created DeleteClientConnectorServiceOperation, possibly from a different process.
+func (c *gRPCClient) DeleteClientConnectorServiceOperation(name string) *DeleteClientConnectorServiceOperation {
+ return &DeleteClientConnectorServiceOperation{
+ lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
+ }
+}
+
+// Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
+//
+// See documentation of Poll for error-handling information.
+func (op *DeleteClientConnectorServiceOperation) Wait(ctx context.Context, opts ...gax.CallOption) error {
+ return op.lro.WaitWithInterval(ctx, nil, time.Minute, opts...)
+}
+
+// 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 (op *DeleteClientConnectorServiceOperation) Poll(ctx context.Context, opts ...gax.CallOption) error {
+ return op.lro.Poll(ctx, nil, opts...)
+}
+
+// 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 (op *DeleteClientConnectorServiceOperation) Metadata() (*clientconnectorservicespb.ClientConnectorServiceOperationMetadata, error) {
+ var meta clientconnectorservicespb.ClientConnectorServiceOperationMetadata
+ if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
+ return nil, nil
+ } else if err != nil {
+ return nil, err
+ }
+ return &meta, nil
+}
+
+// Done reports whether the long-running operation has completed.
+func (op *DeleteClientConnectorServiceOperation) Done() bool {
+ return op.lro.Done()
+}
+
+// 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 (op *DeleteClientConnectorServiceOperation) Name() string {
+ return op.lro.Name()
+}
+
+// UpdateClientConnectorServiceOperation manages a long-running operation from UpdateClientConnectorService.
+type UpdateClientConnectorServiceOperation struct {
+ lro *longrunning.Operation
+}
+
+// UpdateClientConnectorServiceOperation returns a new UpdateClientConnectorServiceOperation from a given name.
+// The name must be that of a previously created UpdateClientConnectorServiceOperation, possibly from a different process.
+func (c *gRPCClient) UpdateClientConnectorServiceOperation(name string) *UpdateClientConnectorServiceOperation {
+ return &UpdateClientConnectorServiceOperation{
+ lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
+ }
+}
+
+// Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
+//
+// See documentation of Poll for error-handling information.
+func (op *UpdateClientConnectorServiceOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*clientconnectorservicespb.ClientConnectorService, error) {
+ var resp clientconnectorservicespb.ClientConnectorService
+ if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
+ return nil, err
+ }
+ return &resp, nil
+}
+
+// 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 (op *UpdateClientConnectorServiceOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*clientconnectorservicespb.ClientConnectorService, error) {
+ var resp clientconnectorservicespb.ClientConnectorService
+ if err := op.lro.Poll(ctx, &resp, opts...); err != nil {
+ return nil, err
+ }
+ if !op.Done() {
+ return nil, nil
+ }
+ return &resp, nil
+}
+
+// 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 (op *UpdateClientConnectorServiceOperation) Metadata() (*clientconnectorservicespb.ClientConnectorServiceOperationMetadata, error) {
+ var meta clientconnectorservicespb.ClientConnectorServiceOperationMetadata
+ if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
+ return nil, nil
+ } else if err != nil {
+ return nil, err
+ }
+ return &meta, nil
+}
+
+// Done reports whether the long-running operation has completed.
+func (op *UpdateClientConnectorServiceOperation) Done() bool {
+ return op.lro.Done()
+}
+
+// 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 (op *UpdateClientConnectorServiceOperation) Name() string {
+ return op.lro.Name()
+}
+
+// ClientConnectorServiceIterator manages a stream of *clientconnectorservicespb.ClientConnectorService.
+type ClientConnectorServiceIterator struct {
+ items []*clientconnectorservicespb.ClientConnectorService
+ pageInfo *iterator.PageInfo
+ nextFunc func() error
+
+ // 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 []*clientconnectorservicespb.ClientConnectorService, nextPageToken string, err error)
+}
+
+// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
+func (it *ClientConnectorServiceIterator) PageInfo() *iterator.PageInfo {
+ return it.pageInfo
+}
+
+// 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 (it *ClientConnectorServiceIterator) Next() (*clientconnectorservicespb.ClientConnectorService, error) {
+ var item *clientconnectorservicespb.ClientConnectorService
+ if err := it.nextFunc(); err != nil {
+ return item, err
+ }
+ item = it.items[0]
+ it.items = it.items[1:]
+ return item, nil
+}
+
+func (it *ClientConnectorServiceIterator) bufLen() int {
+ return len(it.items)
+}
+
+func (it *ClientConnectorServiceIterator) takeBuf() interface{} {
+ b := it.items
+ it.items = nil
+ return b
+}
+
+// LocationIterator manages a stream of *locationpb.Location.
+type LocationIterator struct {
+ items []*locationpb.Location
+ pageInfo *iterator.PageInfo
+ nextFunc func() error
+
+ // 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)
+}
+
+// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
+func (it *LocationIterator) PageInfo() *iterator.PageInfo {
+ return it.pageInfo
+}
+
+// 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 (it *LocationIterator) Next() (*locationpb.Location, error) {
+ var item *locationpb.Location
+ if err := it.nextFunc(); err != nil {
+ return item, err
+ }
+ item = it.items[0]
+ it.items = it.items[1:]
+ return item, nil
+}
+
+func (it *LocationIterator) bufLen() int {
+ return len(it.items)
+}
+
+func (it *LocationIterator) takeBuf() interface{} {
+ b := it.items
+ it.items = nil
+ return b
+}
+
+// OperationIterator manages a stream of *longrunningpb.Operation.
+type OperationIterator struct {
+ items []*longrunningpb.Operation
+ pageInfo *iterator.PageInfo
+ nextFunc func() error
+
+ // 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)
+}
+
+// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
+func (it *OperationIterator) PageInfo() *iterator.PageInfo {
+ return it.pageInfo
+}
+
+// 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 (it *OperationIterator) Next() (*longrunningpb.Operation, error) {
+ var item *longrunningpb.Operation
+ if err := it.nextFunc(); err != nil {
+ return item, err
+ }
+ item = it.items[0]
+ it.items = it.items[1:]
+ return item, nil
+}
+
+func (it *OperationIterator) bufLen() int {
+ return len(it.items)
+}
+
+func (it *OperationIterator) takeBuf() interface{} {
+ b := it.items
+ it.items = nil
+ return b
+}
diff --git a/beyondcorp/clientconnectorservices/apiv1/client_connector_services_client_example_test.go b/beyondcorp/clientconnectorservices/apiv1/client_connector_services_client_example_test.go
new file mode 100644
index 0000000..cbbbc02
--- /dev/null
+++ b/beyondcorp/clientconnectorservices/apiv1/client_connector_services_client_example_test.go
@@ -0,0 +1,347 @@
+// Copyright 2022 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
+
+package clientconnectorservices_test
+
+import (
+ "context"
+
+ clientconnectorservices "cloud.google.com/go/beyondcorp/clientconnectorservices/apiv1"
+ "google.golang.org/api/iterator"
+ clientconnectorservicespb "google.golang.org/genproto/googleapis/cloud/beyondcorp/clientconnectorservices/v1"
+ locationpb "google.golang.org/genproto/googleapis/cloud/location"
+ iampb "google.golang.org/genproto/googleapis/iam/v1"
+ longrunningpb "google.golang.org/genproto/googleapis/longrunning"
+)
+
+func ExampleNewClient() {
+ ctx := context.Background()
+ c, err := clientconnectorservices.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ defer c.Close()
+
+ // TODO: Use client.
+ _ = c
+}
+
+func ExampleClient_ListClientConnectorServices() {
+ ctx := context.Background()
+ c, err := clientconnectorservices.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ defer c.Close()
+
+ req := &clientconnectorservicespb.ListClientConnectorServicesRequest{
+ // TODO: Fill request struct fields.
+ // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/beyondcorp/clientconnectorservices/v1#ListClientConnectorServicesRequest.
+ }
+ it := c.ListClientConnectorServices(ctx, req)
+ for {
+ resp, err := it.Next()
+ if err == iterator.Done {
+ break
+ }
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+ }
+}
+
+func ExampleClient_GetClientConnectorService() {
+ ctx := context.Background()
+ c, err := clientconnectorservices.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ defer c.Close()
+
+ req := &clientconnectorservicespb.GetClientConnectorServiceRequest{
+ // TODO: Fill request struct fields.
+ // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/beyondcorp/clientconnectorservices/v1#GetClientConnectorServiceRequest.
+ }
+ resp, err := c.GetClientConnectorService(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+}
+
+func ExampleClient_CreateClientConnectorService() {
+ ctx := context.Background()
+ c, err := clientconnectorservices.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ defer c.Close()
+
+ req := &clientconnectorservicespb.CreateClientConnectorServiceRequest{
+ // TODO: Fill request struct fields.
+ // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/beyondcorp/clientconnectorservices/v1#CreateClientConnectorServiceRequest.
+ }
+ op, err := c.CreateClientConnectorService(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ resp, err := op.Wait(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+}
+
+func ExampleClient_UpdateClientConnectorService() {
+ ctx := context.Background()
+ c, err := clientconnectorservices.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ defer c.Close()
+
+ req := &clientconnectorservicespb.UpdateClientConnectorServiceRequest{
+ // TODO: Fill request struct fields.
+ // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/beyondcorp/clientconnectorservices/v1#UpdateClientConnectorServiceRequest.
+ }
+ op, err := c.UpdateClientConnectorService(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ resp, err := op.Wait(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+}
+
+func ExampleClient_DeleteClientConnectorService() {
+ ctx := context.Background()
+ c, err := clientconnectorservices.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ defer c.Close()
+
+ req := &clientconnectorservicespb.DeleteClientConnectorServiceRequest{
+ // TODO: Fill request struct fields.
+ // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/beyondcorp/clientconnectorservices/v1#DeleteClientConnectorServiceRequest.
+ }
+ op, err := c.DeleteClientConnectorService(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ err = op.Wait(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+}
+
+func ExampleClient_GetLocation() {
+ ctx := context.Background()
+ c, err := clientconnectorservices.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 ExampleClient_ListLocations() {
+ ctx := context.Background()
+ c, err := clientconnectorservices.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
+ }
+}
+
+func ExampleClient_GetIamPolicy() {
+ ctx := context.Background()
+ c, err := clientconnectorservices.NewClient(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 ExampleClient_SetIamPolicy() {
+ ctx := context.Background()
+ c, err := clientconnectorservices.NewClient(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 ExampleClient_TestIamPermissions() {
+ ctx := context.Background()
+ c, err := clientconnectorservices.NewClient(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 ExampleClient_CancelOperation() {
+ ctx := context.Background()
+ c, err := clientconnectorservices.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ defer c.Close()
+
+ req := &longrunningpb.CancelOperationRequest{
+ // TODO: Fill request struct fields.
+ // See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#CancelOperationRequest.
+ }
+ err = c.CancelOperation(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+}
+
+func ExampleClient_DeleteOperation() {
+ ctx := context.Background()
+ c, err := clientconnectorservices.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ defer c.Close()
+
+ req := &longrunningpb.DeleteOperationRequest{
+ // TODO: Fill request struct fields.
+ // See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#DeleteOperationRequest.
+ }
+ err = c.DeleteOperation(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+}
+
+func ExampleClient_GetOperation() {
+ ctx := context.Background()
+ c, err := clientconnectorservices.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ defer c.Close()
+
+ req := &longrunningpb.GetOperationRequest{
+ // TODO: Fill request struct fields.
+ // See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#GetOperationRequest.
+ }
+ resp, err := c.GetOperation(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+}
+
+func ExampleClient_ListOperations() {
+ ctx := context.Background()
+ c, err := clientconnectorservices.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ defer c.Close()
+
+ req := &longrunningpb.ListOperationsRequest{
+ // TODO: Fill request struct fields.
+ // See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#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
+ }
+}
diff --git a/beyondcorp/clientconnectorservices/apiv1/doc.go b/beyondcorp/clientconnectorservices/apiv1/doc.go
new file mode 100644
index 0000000..21b0fbb
--- /dev/null
+++ b/beyondcorp/clientconnectorservices/apiv1/doc.go
@@ -0,0 +1,170 @@
+// Copyright 2022 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
+
+// Package clientconnectorservices is an auto-generated package for the
+// BeyondCorp API.
+//
+// Beyondcorp Enterprise provides identity and context aware access controls
+// for enterprise resources and enables zero-trust access. Using the
+// Beyondcorp Enterprise APIs, enterprises can set up multi-cloud and on-prem
+// connectivity using the App Connector hybrid connectivity solution.
+//
+// NOTE: This package is in beta. It is not stable, and may be subject to changes.
+//
+// Example usage
+//
+// To get started with this package, create a client.
+// ctx := context.Background()
+// c, err := clientconnectorservices.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.
+//
+// ctx := context.Background()
+// c, err := clientconnectorservices.NewClient(ctx)
+// if err != nil {
+// // TODO: Handle error.
+// }
+// defer c.Close()
+//
+// req := &clientconnectorservicespb.ListClientConnectorServicesRequest{
+// // TODO: Fill request struct fields.
+// // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/beyondcorp/clientconnectorservices/v1#ListClientConnectorServicesRequest.
+// }
+// it := c.ListClientConnectorServices(ctx, req)
+// for {
+// resp, err := it.Next()
+// if err == iterator.Done {
+// break
+// }
+// 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.
+//
+// For information about setting deadlines, reusing contexts, and more
+// please visit https://pkg.go.dev/cloud.google.com/go.
+package clientconnectorservices // import "cloud.google.com/go/beyondcorp/clientconnectorservices/apiv1"
+
+import (
+ "context"
+ "os"
+ "runtime"
+ "strconv"
+ "strings"
+ "unicode"
+
+ "google.golang.org/api/option"
+ "google.golang.org/grpc/metadata"
+)
+
+// For more information on implementing a client constructor hook, see
+// https://github.com/googleapis/google-cloud-go/wiki/Customizing-constructors.
+type clientHookParams struct{}
+type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error)
+
+var versionClient string
+
+func getVersionClient() string {
+ if versionClient == "" {
+ return "UNKNOWN"
+ }
+ return versionClient
+}
+
+func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
+ out, _ := metadata.FromOutgoingContext(ctx)
+ out = out.Copy()
+ for _, md := range mds {
+ for k, v := range md {
+ out[k] = append(out[k], v...)
+ }
+ }
+ return metadata.NewOutgoingContext(ctx, out)
+}
+
+func checkDisableDeadlines() (bool, error) {
+ raw, ok := os.LookupEnv("GOOGLE_API_GO_EXPERIMENTAL_DISABLE_DEFAULT_DEADLINE")
+ if !ok {
+ return false, nil
+ }
+
+ b, err := strconv.ParseBool(raw)
+ return b, err
+}
+
+// DefaultAuthScopes reports the default set of authentication scopes to use with this package.
+func DefaultAuthScopes() []string {
+ return []string{
+ "https://www.googleapis.com/auth/cloud-platform",
+ }
+}
+
+// versionGo returns the Go runtime version. The returned string
+// has no whitespace, suitable for reporting in header.
+func versionGo() string {
+ const develPrefix = "devel +"
+
+ s := runtime.Version()
+ if strings.HasPrefix(s, develPrefix) {
+ s = s[len(develPrefix):]
+ if p := strings.IndexFunc(s, unicode.IsSpace); p >= 0 {
+ s = s[:p]
+ }
+ return s
+ }
+
+ notSemverRune := func(r rune) bool {
+ return !strings.ContainsRune("0123456789.", r)
+ }
+
+ if strings.HasPrefix(s, "go1") {
+ s = s[2:]
+ var prerelease string
+ if p := strings.IndexFunc(s, notSemverRune); p >= 0 {
+ s, prerelease = s[:p], s[p:]
+ }
+ if strings.HasSuffix(s, ".") {
+ s += "0"
+ } else if strings.Count(s, ".") < 2 {
+ s += ".0"
+ }
+ if prerelease != "" {
+ s += "-" + prerelease
+ }
+ return s
+ }
+ return "UNKNOWN"
+}
diff --git a/beyondcorp/clientconnectorservices/apiv1/gapic_metadata.json b/beyondcorp/clientconnectorservices/apiv1/gapic_metadata.json
new file mode 100644
index 0000000..0e24b70
--- /dev/null
+++ b/beyondcorp/clientconnectorservices/apiv1/gapic_metadata.json
@@ -0,0 +1,88 @@
+{
+ "schema": "1.0",
+ "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.",
+ "language": "go",
+ "protoPackage": "google.cloud.beyondcorp.clientconnectorservices.v1",
+ "libraryPackage": "cloud.google.com/go/beyondcorp/clientconnectorservices/apiv1",
+ "services": {
+ "ClientConnectorServicesService": {
+ "clients": {
+ "grpc": {
+ "libraryClient": "Client",
+ "rpcs": {
+ "CancelOperation": {
+ "methods": [
+ "CancelOperation"
+ ]
+ },
+ "CreateClientConnectorService": {
+ "methods": [
+ "CreateClientConnectorService"
+ ]
+ },
+ "DeleteClientConnectorService": {
+ "methods": [
+ "DeleteClientConnectorService"
+ ]
+ },
+ "DeleteOperation": {
+ "methods": [
+ "DeleteOperation"
+ ]
+ },
+ "GetClientConnectorService": {
+ "methods": [
+ "GetClientConnectorService"
+ ]
+ },
+ "GetIamPolicy": {
+ "methods": [
+ "GetIamPolicy"
+ ]
+ },
+ "GetLocation": {
+ "methods": [
+ "GetLocation"
+ ]
+ },
+ "GetOperation": {
+ "methods": [
+ "GetOperation"
+ ]
+ },
+ "ListClientConnectorServices": {
+ "methods": [
+ "ListClientConnectorServices"
+ ]
+ },
+ "ListLocations": {
+ "methods": [
+ "ListLocations"
+ ]
+ },
+ "ListOperations": {
+ "methods": [
+ "ListOperations"
+ ]
+ },
+ "SetIamPolicy": {
+ "methods": [
+ "SetIamPolicy"
+ ]
+ },
+ "TestIamPermissions": {
+ "methods": [
+ "TestIamPermissions"
+ ]
+ },
+ "UpdateClientConnectorService": {
+ "methods": [
+ "UpdateClientConnectorService"
+ ]
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/beyondcorp/clientconnectorservices/apiv1/version.go b/beyondcorp/clientconnectorservices/apiv1/version.go
new file mode 100644
index 0000000..fb2838e
--- /dev/null
+++ b/beyondcorp/clientconnectorservices/apiv1/version.go
@@ -0,0 +1,23 @@
+// Copyright 2022 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Code generated by gapicgen. DO NOT EDIT.
+
+package clientconnectorservices
+
+import "cloud.google.com/go/beyondcorp/internal"
+
+func init() {
+ versionClient = internal.Version
+}
diff --git a/beyondcorp/clientgateways/apiv1/client_gateways_client.go b/beyondcorp/clientgateways/apiv1/client_gateways_client.go
new file mode 100644
index 0000000..59fae42
--- /dev/null
+++ b/beyondcorp/clientgateways/apiv1/client_gateways_client.go
@@ -0,0 +1,924 @@
+// Copyright 2022 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
+
+package clientgateways
+
+import (
+ "context"
+ "fmt"
+ "math"
+ "net/url"
+ "time"
+
+ "cloud.google.com/go/longrunning"
+ lroauto "cloud.google.com/go/longrunning/autogen"
+ gax "github.com/googleapis/gax-go/v2"
+ "google.golang.org/api/iterator"
+ "google.golang.org/api/option"
+ "google.golang.org/api/option/internaloption"
+ gtransport "google.golang.org/api/transport/grpc"
+ clientgatewayspb "google.golang.org/genproto/googleapis/cloud/beyondcorp/clientgateways/v1"
+ locationpb "google.golang.org/genproto/googleapis/cloud/location"
+ iampb "google.golang.org/genproto/googleapis/iam/v1"
+ longrunningpb "google.golang.org/genproto/googleapis/longrunning"
+ "google.golang.org/grpc"
+ "google.golang.org/grpc/metadata"
+ "google.golang.org/protobuf/proto"
+)
+
+var newClientHook clientHook
+
+// CallOptions contains the retry settings for each method of Client.
+type CallOptions struct {
+ ListClientGateways []gax.CallOption
+ GetClientGateway []gax.CallOption
+ CreateClientGateway []gax.CallOption
+ DeleteClientGateway []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
+}
+
+func defaultGRPCClientOptions() []option.ClientOption {
+ return []option.ClientOption{
+ internaloption.WithDefaultEndpoint("beyondcorp.googleapis.com:443"),
+ internaloption.WithDefaultMTLSEndpoint("beyondcorp.mtls.googleapis.com:443"),
+ internaloption.WithDefaultAudience("https://beyondcorp.googleapis.com/"),
+ internaloption.WithDefaultScopes(DefaultAuthScopes()...),
+ internaloption.EnableJwtWithScope(),
+ option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
+ grpc.MaxCallRecvMsgSize(math.MaxInt32))),
+ }
+}
+
+func defaultCallOptions() *CallOptions {
+ return &CallOptions{
+ ListClientGateways: []gax.CallOption{},
+ GetClientGateway: []gax.CallOption{},
+ CreateClientGateway: []gax.CallOption{},
+ DeleteClientGateway: []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{},
+ }
+}
+
+// internalClient is an interface that defines the methods available from BeyondCorp API.
+type internalClient interface {
+ Close() error
+ setGoogleClientInfo(...string)
+ Connection() *grpc.ClientConn
+ ListClientGateways(context.Context, *clientgatewayspb.ListClientGatewaysRequest, ...gax.CallOption) *ClientGatewayIterator
+ GetClientGateway(context.Context, *clientgatewayspb.GetClientGatewayRequest, ...gax.CallOption) (*clientgatewayspb.ClientGateway, error)
+ CreateClientGateway(context.Context, *clientgatewayspb.CreateClientGatewayRequest, ...gax.CallOption) (*CreateClientGatewayOperation, error)
+ CreateClientGatewayOperation(name string) *CreateClientGatewayOperation
+ DeleteClientGateway(context.Context, *clientgatewayspb.DeleteClientGatewayRequest, ...gax.CallOption) (*DeleteClientGatewayOperation, error)
+ DeleteClientGatewayOperation(name string) *DeleteClientGatewayOperation
+ GetLocation(context.Context, *locationpb.GetLocationRequest, ...gax.CallOption) (*locationpb.Location, error)
+ ListLocations(context.Context, *locationpb.ListLocationsRequest, ...gax.CallOption) *LocationIterator
+ GetIamPolicy(context.Context, *iampb.GetIamPolicyRequest, ...gax.CallOption) (*iampb.Policy, error)
+ SetIamPolicy(context.Context, *iampb.SetIamPolicyRequest, ...gax.CallOption) (*iampb.Policy, error)
+ TestIamPermissions(context.Context, *iampb.TestIamPermissionsRequest, ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error)
+ CancelOperation(context.Context, *longrunningpb.CancelOperationRequest, ...gax.CallOption) error
+ DeleteOperation(context.Context, *longrunningpb.DeleteOperationRequest, ...gax.CallOption) error
+ GetOperation(context.Context, *longrunningpb.GetOperationRequest, ...gax.CallOption) (*longrunningpb.Operation, error)
+ ListOperations(context.Context, *longrunningpb.ListOperationsRequest, ...gax.CallOption) *OperationIterator
+}
+
+// Client is a client for interacting with BeyondCorp API.
+// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
+//
+// API OverviewThe beyondcorp.googleapis.com service implements the Google Cloud
+// BeyondCorp API.
+//
+// Data ModelThe ClientGatewaysService exposes the following resources:
+//
+// Client Gateways, named as follows:
+// projects/{project_id}/locations/{location_id}/clientGateways/{client_gateway_id}.
+type Client struct {
+ // The internal transport-dependent client.
+ internalClient internalClient
+
+ // 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
+}
+
+// Wrapper methods routed to the internal client.
+
+// Close closes the connection to the API service. The user should invoke this when
+// the client is no longer required.
+func (c *Client) Close() error {
+ return c.internalClient.Close()
+}
+
+// setGoogleClientInfo sets the name and version of the application in
+// the `x-goog-api-client` header passed on each request. Intended for
+// use by Google-written clients.
+func (c *Client) setGoogleClientInfo(keyval ...string) {
+ c.internalClient.setGoogleClientInfo(keyval...)
+}
+
+// Connection returns a connection to the API service.
+//
+// Deprecated.
+func (c *Client) Connection() *grpc.ClientConn {
+ return c.internalClient.Connection()
+}
+
+// ListClientGateways lists ClientGateways in a given project and location.
+func (c *Client) ListClientGateways(ctx context.Context, req *clientgatewayspb.ListClientGatewaysRequest, opts ...gax.CallOption) *ClientGatewayIterator {
+ return c.internalClient.ListClientGateways(ctx, req, opts...)
+}
+
+// GetClientGateway gets details of a single ClientGateway.
+func (c *Client) GetClientGateway(ctx context.Context, req *clientgatewayspb.GetClientGatewayRequest, opts ...gax.CallOption) (*clientgatewayspb.ClientGateway, error) {
+ return c.internalClient.GetClientGateway(ctx, req, opts...)
+}
+
+// CreateClientGateway creates a new ClientGateway in a given project and location.
+func (c *Client) CreateClientGateway(ctx context.Context, req *clientgatewayspb.CreateClientGatewayRequest, opts ...gax.CallOption) (*CreateClientGatewayOperation, error) {
+ return c.internalClient.CreateClientGateway(ctx, req, opts...)
+}
+
+// CreateClientGatewayOperation returns a new CreateClientGatewayOperation from a given name.
+// The name must be that of a previously created CreateClientGatewayOperation, possibly from a different process.
+func (c *Client) CreateClientGatewayOperation(name string) *CreateClientGatewayOperation {
+ return c.internalClient.CreateClientGatewayOperation(name)
+}
+
+// DeleteClientGateway deletes a single ClientGateway.
+func (c *Client) DeleteClientGateway(ctx context.Context, req *clientgatewayspb.DeleteClientGatewayRequest, opts ...gax.CallOption) (*DeleteClientGatewayOperation, error) {
+ return c.internalClient.DeleteClientGateway(ctx, req, opts...)
+}
+
+// DeleteClientGatewayOperation returns a new DeleteClientGatewayOperation from a given name.
+// The name must be that of a previously created DeleteClientGatewayOperation, possibly from a different process.
+func (c *Client) DeleteClientGatewayOperation(name string) *DeleteClientGatewayOperation {
+ return c.internalClient.DeleteClientGatewayOperation(name)
+}
+
+// GetLocation gets information about a location.
+func (c *Client) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error) {
+ return c.internalClient.GetLocation(ctx, req, opts...)
+}
+
+// ListLocations lists information about the supported locations for this service.
+func (c *Client) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator {
+ return c.internalClient.ListLocations(ctx, req, opts...)
+}
+
+// GetIamPolicy gets the access control policy for a resource. Returns an empty policy
+// if the resource exists and does not have a policy set.
+func (c *Client) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) {
+ return c.internalClient.GetIamPolicy(ctx, req, opts...)
+}
+
+// SetIamPolicy sets the access control policy on the specified resource. Replaces
+// any existing policy.
+//
+// Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED
+// errors.
+func (c *Client) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) {
+ return c.internalClient.SetIamPolicy(ctx, req, opts...)
+}
+
+// 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.
+func (c *Client) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, opts ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error) {
+ return c.internalClient.TestIamPermissions(ctx, req, opts...)
+}
+
+// CancelOperation is a utility method from google.longrunning.Operations.
+func (c *Client) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error {
+ return c.internalClient.CancelOperation(ctx, req, opts...)
+}
+
+// DeleteOperation is a utility method from google.longrunning.Operations.
+func (c *Client) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error {
+ return c.internalClient.DeleteOperation(ctx, req, opts...)
+}
+
+// GetOperation is a utility method from google.longrunning.Operations.
+func (c *Client) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) {
+ return c.internalClient.GetOperation(ctx, req, opts...)
+}
+
+// ListOperations is a utility method from google.longrunning.Operations.
+func (c *Client) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator {
+ return c.internalClient.ListOperations(ctx, req, opts...)
+}
+
+// gRPCClient is a client for interacting with BeyondCorp API over gRPC transport.
+//
+// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
+type gRPCClient struct {
+ // Connection pool of gRPC connections to the service.
+ connPool gtransport.ConnPool
+
+ // flag to opt out of default deadlines via GOOGLE_API_GO_EXPERIMENTAL_DISABLE_DEFAULT_DEADLINE
+ disableDeadlines bool
+
+ // Points back to the CallOptions field of the containing Client
+ CallOptions **CallOptions
+
+ // The gRPC API client.
+ client clientgatewayspb.ClientGatewaysServiceClient
+
+ // 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
+
+ operationsClient longrunningpb.OperationsClient
+
+ iamPolicyClient iampb.IAMPolicyClient
+
+ locationsClient locationpb.LocationsClient
+
+ // The x-goog-* metadata to be sent with each request.
+ xGoogMetadata metadata.MD
+}
+
+// NewClient creates a new client gateways service client based on gRPC.
+// The returned client must be Closed when it is done being used to clean up its underlying connections.
+//
+// API OverviewThe beyondcorp.googleapis.com service implements the Google Cloud
+// BeyondCorp API.
+//
+// Data ModelThe ClientGatewaysService exposes the following resources:
+//
+// Client Gateways, named as follows:
+// projects/{project_id}/locations/{location_id}/clientGateways/{client_gateway_id}.
+func NewClient(ctx context.Context, opts ...option.ClientOption) (*Client, error) {
+ clientOpts := defaultGRPCClientOptions()
+ if newClientHook != nil {
+ hookOpts, err := newClientHook(ctx, clientHookParams{})
+ if err != nil {
+ return nil, err
+ }
+ clientOpts = append(clientOpts, hookOpts...)
+ }
+
+ disableDeadlines, err := checkDisableDeadlines()
+ if err != nil {
+ return nil, err
+ }
+
+ connPool, err := gtransport.DialPool(ctx, append(clientOpts, opts...)...)
+ if err != nil {
+ return nil, err
+ }
+ client := Client{CallOptions: defaultCallOptions()}
+
+ c := &gRPCClient{
+ connPool: connPool,
+ disableDeadlines: disableDeadlines,
+ client: clientgatewayspb.NewClientGatewaysServiceClient(connPool),
+ CallOptions: &client.CallOptions,
+ operationsClient: longrunningpb.NewOperationsClient(connPool),
+ iamPolicyClient: iampb.NewIAMPolicyClient(connPool),
+ locationsClient: locationpb.NewLocationsClient(connPool),
+ }
+ c.setGoogleClientInfo()
+
+ client.internalClient = c
+
+ client.LROClient, err = lroauto.NewOperationsClient(ctx, gtransport.WithConnPool(connPool))
+ if err != nil {
+ // This error "should not happen", since we are just reusing old connection pool
+ // and never actually need to dial.
+ // If this does happen, we could leak connp. However, we cannot close conn:
+ // If the user invoked the constructor with option.WithGRPCConn,
+ // we would close a connection that's still in use.
+ // TODO: investigate error conditions.
+ return nil, err
+ }
+ c.LROClient = &client.LROClient
+ return &client, nil
+}
+
+// Connection returns a connection to the API service.
+//
+// Deprecated.
+func (c *gRPCClient) Connection() *grpc.ClientConn {
+ return c.connPool.Conn()
+}
+
+// setGoogleClientInfo sets the name and version of the application in
+// the `x-goog-api-client` header passed on each request. Intended for
+// use by Google-written clients.
+func (c *gRPCClient) setGoogleClientInfo(keyval ...string) {
+ kv := append([]string{"gl-go", versionGo()}, keyval...)
+ kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version)
+ c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
+}
+
+// Close closes the connection to the API service. The user should invoke this when
+// the client is no longer required.
+func (c *gRPCClient) Close() error {
+ return c.connPool.Close()
+}
+
+func (c *gRPCClient) ListClientGateways(ctx context.Context, req *clientgatewayspb.ListClientGatewaysRequest, opts ...gax.CallOption) *ClientGatewayIterator {
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent())))
+
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ opts = append((*c.CallOptions).ListClientGateways[0:len((*c.CallOptions).ListClientGateways):len((*c.CallOptions).ListClientGateways)], opts...)
+ it := &ClientGatewayIterator{}
+ req = proto.Clone(req).(*clientgatewayspb.ListClientGatewaysRequest)
+ it.InternalFetch = func(pageSize int, pageToken string) ([]*clientgatewayspb.ClientGateway, string, error) {
+ resp := &clientgatewayspb.ListClientGatewaysResponse{}
+ if pageToken != "" {
+ req.PageToken = pageToken
+ }
+ if pageSize > math.MaxInt32 {
+ req.PageSize = math.MaxInt32
+ } else if pageSize != 0 {
+ req.PageSize = int32(pageSize)
+ }
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.client.ListClientGateways(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, "", err
+ }
+
+ it.Response = resp
+ return resp.GetClientGateways(), resp.GetNextPageToken(), nil
+ }
+ fetch := func(pageSize int, pageToken string) (string, error) {
+ items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
+ if err != nil {
+ return "", err
+ }
+ it.items = append(it.items, items...)
+ return nextPageToken, nil
+ }
+
+ it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
+ it.pageInfo.MaxSize = int(req.GetPageSize())
+ it.pageInfo.Token = req.GetPageToken()
+
+ return it
+}
+
+func (c *gRPCClient) GetClientGateway(ctx context.Context, req *clientgatewayspb.GetClientGatewayRequest, opts ...gax.CallOption) (*clientgatewayspb.ClientGateway, error) {
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName())))
+
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ opts = append((*c.CallOptions).GetClientGateway[0:len((*c.CallOptions).GetClientGateway):len((*c.CallOptions).GetClientGateway)], opts...)
+ var resp *clientgatewayspb.ClientGateway
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.client.GetClientGateway(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+func (c *gRPCClient) CreateClientGateway(ctx context.Context, req *clientgatewayspb.CreateClientGatewayRequest, opts ...gax.CallOption) (*CreateClientGatewayOperation, error) {
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent())))
+
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ opts = append((*c.CallOptions).CreateClientGateway[0:len((*c.CallOptions).CreateClientGateway):len((*c.CallOptions).CreateClientGateway)], opts...)
+ var resp *longrunningpb.Operation
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.client.CreateClientGateway(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return &CreateClientGatewayOperation{
+ lro: longrunning.InternalNewOperation(*c.LROClient, resp),
+ }, nil
+}
+
+func (c *gRPCClient) DeleteClientGateway(ctx context.Context, req *clientgatewayspb.DeleteClientGatewayRequest, opts ...gax.CallOption) (*DeleteClientGatewayOperation, error) {
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName())))
+
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ opts = append((*c.CallOptions).DeleteClientGateway[0:len((*c.CallOptions).DeleteClientGateway):len((*c.CallOptions).DeleteClientGateway)], opts...)
+ var resp *longrunningpb.Operation
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.client.DeleteClientGateway(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return &DeleteClientGatewayOperation{
+ lro: longrunning.InternalNewOperation(*c.LROClient, resp),
+ }, nil
+}
+
+func (c *gRPCClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error) {
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName())))
+
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ opts = append((*c.CallOptions).GetLocation[0:len((*c.CallOptions).GetLocation):len((*c.CallOptions).GetLocation)], opts...)
+ var resp *locationpb.Location
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.locationsClient.GetLocation(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+func (c *gRPCClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator {
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName())))
+
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ opts = append((*c.CallOptions).ListLocations[0:len((*c.CallOptions).ListLocations):len((*c.CallOptions).ListLocations)], opts...)
+ it := &LocationIterator{}
+ req = proto.Clone(req).(*locationpb.ListLocationsRequest)
+ it.InternalFetch = func(pageSize int, pageToken string) ([]*locationpb.Location, string, error) {
+ resp := &locationpb.ListLocationsResponse{}
+ if pageToken != "" {
+ req.PageToken = pageToken
+ }
+ if pageSize > math.MaxInt32 {
+ req.PageSize = math.MaxInt32
+ } else if pageSize != 0 {
+ req.PageSize = int32(pageSize)
+ }
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.locationsClient.ListLocations(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, "", err
+ }
+
+ it.Response = resp
+ return resp.GetLocations(), resp.GetNextPageToken(), nil
+ }
+ fetch := func(pageSize int, pageToken string) (string, error) {
+ items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
+ if err != nil {
+ return "", err
+ }
+ it.items = append(it.items, items...)
+ return nextPageToken, nil
+ }
+
+ it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
+ it.pageInfo.MaxSize = int(req.GetPageSize())
+ it.pageInfo.Token = req.GetPageToken()
+
+ return it
+}
+
+func (c *gRPCClient) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) {
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "resource", url.QueryEscape(req.GetResource())))
+
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ opts = append((*c.CallOptions).GetIamPolicy[0:len((*c.CallOptions).GetIamPolicy):len((*c.CallOptions).GetIamPolicy)], opts...)
+ var resp *iampb.Policy
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.iamPolicyClient.GetIamPolicy(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+func (c *gRPCClient) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) {
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "resource", url.QueryEscape(req.GetResource())))
+
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ opts = append((*c.CallOptions).SetIamPolicy[0:len((*c.CallOptions).SetIamPolicy):len((*c.CallOptions).SetIamPolicy)], opts...)
+ var resp *iampb.Policy
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.iamPolicyClient.SetIamPolicy(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+func (c *gRPCClient) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, opts ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error) {
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "resource", url.QueryEscape(req.GetResource())))
+
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ opts = append((*c.CallOptions).TestIamPermissions[0:len((*c.CallOptions).TestIamPermissions):len((*c.CallOptions).TestIamPermissions)], opts...)
+ var resp *iampb.TestIamPermissionsResponse
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.iamPolicyClient.TestIamPermissions(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+func (c *gRPCClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error {
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName())))
+
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ opts = append((*c.CallOptions).CancelOperation[0:len((*c.CallOptions).CancelOperation):len((*c.CallOptions).CancelOperation)], opts...)
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ _, err = c.operationsClient.CancelOperation(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ return err
+}
+
+func (c *gRPCClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error {
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName())))
+
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ opts = append((*c.CallOptions).DeleteOperation[0:len((*c.CallOptions).DeleteOperation):len((*c.CallOptions).DeleteOperation)], opts...)
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ _, err = c.operationsClient.DeleteOperation(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ return err
+}
+
+func (c *gRPCClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) {
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName())))
+
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ opts = append((*c.CallOptions).GetOperation[0:len((*c.CallOptions).GetOperation):len((*c.CallOptions).GetOperation)], opts...)
+ var resp *longrunningpb.Operation
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.operationsClient.GetOperation(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+func (c *gRPCClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator {
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName())))
+
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ opts = append((*c.CallOptions).ListOperations[0:len((*c.CallOptions).ListOperations):len((*c.CallOptions).ListOperations)], opts...)
+ it := &OperationIterator{}
+ req = proto.Clone(req).(*longrunningpb.ListOperationsRequest)
+ it.InternalFetch = func(pageSize int, pageToken string) ([]*longrunningpb.Operation, string, error) {
+ resp := &longrunningpb.ListOperationsResponse{}
+ if pageToken != "" {
+ req.PageToken = pageToken
+ }
+ if pageSize > math.MaxInt32 {
+ req.PageSize = math.MaxInt32
+ } else if pageSize != 0 {
+ req.PageSize = int32(pageSize)
+ }
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.operationsClient.ListOperations(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, "", err
+ }
+
+ it.Response = resp
+ return resp.GetOperations(), resp.GetNextPageToken(), nil
+ }
+ fetch := func(pageSize int, pageToken string) (string, error) {
+ items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
+ if err != nil {
+ return "", err
+ }
+ it.items = append(it.items, items...)
+ return nextPageToken, nil
+ }
+
+ it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
+ it.pageInfo.MaxSize = int(req.GetPageSize())
+ it.pageInfo.Token = req.GetPageToken()
+
+ return it
+}
+
+// CreateClientGatewayOperation manages a long-running operation from CreateClientGateway.
+type CreateClientGatewayOperation struct {
+ lro *longrunning.Operation
+}
+
+// CreateClientGatewayOperation returns a new CreateClientGatewayOperation from a given name.
+// The name must be that of a previously created CreateClientGatewayOperation, possibly from a different process.
+func (c *gRPCClient) CreateClientGatewayOperation(name string) *CreateClientGatewayOperation {
+ return &CreateClientGatewayOperation{
+ lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
+ }
+}
+
+// Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
+//
+// See documentation of Poll for error-handling information.
+func (op *CreateClientGatewayOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*clientgatewayspb.ClientGateway, error) {
+ var resp clientgatewayspb.ClientGateway
+ if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
+ return nil, err
+ }
+ return &resp, nil
+}
+
+// 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 (op *CreateClientGatewayOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*clientgatewayspb.ClientGateway, error) {
+ var resp clientgatewayspb.ClientGateway
+ if err := op.lro.Poll(ctx, &resp, opts...); err != nil {
+ return nil, err
+ }
+ if !op.Done() {
+ return nil, nil
+ }
+ return &resp, nil
+}
+
+// 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 (op *CreateClientGatewayOperation) Metadata() (*clientgatewayspb.ClientGatewayOperationMetadata, error) {
+ var meta clientgatewayspb.ClientGatewayOperationMetadata
+ if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
+ return nil, nil
+ } else if err != nil {
+ return nil, err
+ }
+ return &meta, nil
+}
+
+// Done reports whether the long-running operation has completed.
+func (op *CreateClientGatewayOperation) Done() bool {
+ return op.lro.Done()
+}
+
+// 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 (op *CreateClientGatewayOperation) Name() string {
+ return op.lro.Name()
+}
+
+// DeleteClientGatewayOperation manages a long-running operation from DeleteClientGateway.
+type DeleteClientGatewayOperation struct {
+ lro *longrunning.Operation
+}
+
+// DeleteClientGatewayOperation returns a new DeleteClientGatewayOperation from a given name.
+// The name must be that of a previously created DeleteClientGatewayOperation, possibly from a different process.
+func (c *gRPCClient) DeleteClientGatewayOperation(name string) *DeleteClientGatewayOperation {
+ return &DeleteClientGatewayOperation{
+ lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
+ }
+}
+
+// Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
+//
+// See documentation of Poll for error-handling information.
+func (op *DeleteClientGatewayOperation) Wait(ctx context.Context, opts ...gax.CallOption) error {
+ return op.lro.WaitWithInterval(ctx, nil, time.Minute, opts...)
+}
+
+// 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 (op *DeleteClientGatewayOperation) Poll(ctx context.Context, opts ...gax.CallOption) error {
+ return op.lro.Poll(ctx, nil, opts...)
+}
+
+// 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 (op *DeleteClientGatewayOperation) Metadata() (*clientgatewayspb.ClientGatewayOperationMetadata, error) {
+ var meta clientgatewayspb.ClientGatewayOperationMetadata
+ if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
+ return nil, nil
+ } else if err != nil {
+ return nil, err
+ }
+ return &meta, nil
+}
+
+// Done reports whether the long-running operation has completed.
+func (op *DeleteClientGatewayOperation) Done() bool {
+ return op.lro.Done()
+}
+
+// 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 (op *DeleteClientGatewayOperation) Name() string {
+ return op.lro.Name()
+}
+
+// ClientGatewayIterator manages a stream of *clientgatewayspb.ClientGateway.
+type ClientGatewayIterator struct {
+ items []*clientgatewayspb.ClientGateway
+ pageInfo *iterator.PageInfo
+ nextFunc func() error
+
+ // 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 []*clientgatewayspb.ClientGateway, nextPageToken string, err error)
+}
+
+// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
+func (it *ClientGatewayIterator) PageInfo() *iterator.PageInfo {
+ return it.pageInfo
+}
+
+// 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 (it *ClientGatewayIterator) Next() (*clientgatewayspb.ClientGateway, error) {
+ var item *clientgatewayspb.ClientGateway
+ if err := it.nextFunc(); err != nil {
+ return item, err
+ }
+ item = it.items[0]
+ it.items = it.items[1:]
+ return item, nil
+}
+
+func (it *ClientGatewayIterator) bufLen() int {
+ return len(it.items)
+}
+
+func (it *ClientGatewayIterator) takeBuf() interface{} {
+ b := it.items
+ it.items = nil
+ return b
+}
+
+// LocationIterator manages a stream of *locationpb.Location.
+type LocationIterator struct {
+ items []*locationpb.Location
+ pageInfo *iterator.PageInfo
+ nextFunc func() error
+
+ // 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)
+}
+
+// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
+func (it *LocationIterator) PageInfo() *iterator.PageInfo {
+ return it.pageInfo
+}
+
+// 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 (it *LocationIterator) Next() (*locationpb.Location, error) {
+ var item *locationpb.Location
+ if err := it.nextFunc(); err != nil {
+ return item, err
+ }
+ item = it.items[0]
+ it.items = it.items[1:]
+ return item, nil
+}
+
+func (it *LocationIterator) bufLen() int {
+ return len(it.items)
+}
+
+func (it *LocationIterator) takeBuf() interface{} {
+ b := it.items
+ it.items = nil
+ return b
+}
+
+// OperationIterator manages a stream of *longrunningpb.Operation.
+type OperationIterator struct {
+ items []*longrunningpb.Operation
+ pageInfo *iterator.PageInfo
+ nextFunc func() error
+
+ // 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)
+}
+
+// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
+func (it *OperationIterator) PageInfo() *iterator.PageInfo {
+ return it.pageInfo
+}
+
+// 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 (it *OperationIterator) Next() (*longrunningpb.Operation, error) {
+ var item *longrunningpb.Operation
+ if err := it.nextFunc(); err != nil {
+ return item, err
+ }
+ item = it.items[0]
+ it.items = it.items[1:]
+ return item, nil
+}
+
+func (it *OperationIterator) bufLen() int {
+ return len(it.items)
+}
+
+func (it *OperationIterator) takeBuf() interface{} {
+ b := it.items
+ it.items = nil
+ return b
+}
diff --git a/beyondcorp/clientgateways/apiv1/client_gateways_client_example_test.go b/beyondcorp/clientgateways/apiv1/client_gateways_client_example_test.go
new file mode 100644
index 0000000..7731a8b
--- /dev/null
+++ b/beyondcorp/clientgateways/apiv1/client_gateways_client_example_test.go
@@ -0,0 +1,322 @@
+// Copyright 2022 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
+
+package clientgateways_test
+
+import (
+ "context"
+
+ clientgateways "cloud.google.com/go/beyondcorp/clientgateways/apiv1"
+ "google.golang.org/api/iterator"
+ clientgatewayspb "google.golang.org/genproto/googleapis/cloud/beyondcorp/clientgateways/v1"
+ locationpb "google.golang.org/genproto/googleapis/cloud/location"
+ iampb "google.golang.org/genproto/googleapis/iam/v1"
+ longrunningpb "google.golang.org/genproto/googleapis/longrunning"
+)
+
+func ExampleNewClient() {
+ ctx := context.Background()
+ c, err := clientgateways.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ defer c.Close()
+
+ // TODO: Use client.
+ _ = c
+}
+
+func ExampleClient_ListClientGateways() {
+ ctx := context.Background()
+ c, err := clientgateways.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ defer c.Close()
+
+ req := &clientgatewayspb.ListClientGatewaysRequest{
+ // TODO: Fill request struct fields.
+ // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/beyondcorp/clientgateways/v1#ListClientGatewaysRequest.
+ }
+ it := c.ListClientGateways(ctx, req)
+ for {
+ resp, err := it.Next()
+ if err == iterator.Done {
+ break
+ }
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+ }
+}
+
+func ExampleClient_GetClientGateway() {
+ ctx := context.Background()
+ c, err := clientgateways.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ defer c.Close()
+
+ req := &clientgatewayspb.GetClientGatewayRequest{
+ // TODO: Fill request struct fields.
+ // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/beyondcorp/clientgateways/v1#GetClientGatewayRequest.
+ }
+ resp, err := c.GetClientGateway(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+}
+
+func ExampleClient_CreateClientGateway() {
+ ctx := context.Background()
+ c, err := clientgateways.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ defer c.Close()
+
+ req := &clientgatewayspb.CreateClientGatewayRequest{
+ // TODO: Fill request struct fields.
+ // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/beyondcorp/clientgateways/v1#CreateClientGatewayRequest.
+ }
+ op, err := c.CreateClientGateway(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ resp, err := op.Wait(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+}
+
+func ExampleClient_DeleteClientGateway() {
+ ctx := context.Background()
+ c, err := clientgateways.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ defer c.Close()
+
+ req := &clientgatewayspb.DeleteClientGatewayRequest{
+ // TODO: Fill request struct fields.
+ // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/beyondcorp/clientgateways/v1#DeleteClientGatewayRequest.
+ }
+ op, err := c.DeleteClientGateway(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+
+ err = op.Wait(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+}
+
+func ExampleClient_GetLocation() {
+ ctx := context.Background()
+ c, err := clientgateways.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 ExampleClient_ListLocations() {
+ ctx := context.Background()
+ c, err := clientgateways.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
+ }
+}
+
+func ExampleClient_GetIamPolicy() {
+ ctx := context.Background()
+ c, err := clientgateways.NewClient(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 ExampleClient_SetIamPolicy() {
+ ctx := context.Background()
+ c, err := clientgateways.NewClient(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 ExampleClient_TestIamPermissions() {
+ ctx := context.Background()
+ c, err := clientgateways.NewClient(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 ExampleClient_CancelOperation() {
+ ctx := context.Background()
+ c, err := clientgateways.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ defer c.Close()
+
+ req := &longrunningpb.CancelOperationRequest{
+ // TODO: Fill request struct fields.
+ // See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#CancelOperationRequest.
+ }
+ err = c.CancelOperation(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+}
+
+func ExampleClient_DeleteOperation() {
+ ctx := context.Background()
+ c, err := clientgateways.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ defer c.Close()
+
+ req := &longrunningpb.DeleteOperationRequest{
+ // TODO: Fill request struct fields.
+ // See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#DeleteOperationRequest.
+ }
+ err = c.DeleteOperation(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+}
+
+func ExampleClient_GetOperation() {
+ ctx := context.Background()
+ c, err := clientgateways.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ defer c.Close()
+
+ req := &longrunningpb.GetOperationRequest{
+ // TODO: Fill request struct fields.
+ // See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#GetOperationRequest.
+ }
+ resp, err := c.GetOperation(ctx, req)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ // TODO: Use resp.
+ _ = resp
+}
+
+func ExampleClient_ListOperations() {
+ ctx := context.Background()
+ c, err := clientgateways.NewClient(ctx)
+ if err != nil {
+ // TODO: Handle error.
+ }
+ defer c.Close()
+
+ req := &longrunningpb.ListOperationsRequest{
+ // TODO: Fill request struct fields.
+ // See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#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
+ }
+}
diff --git a/beyondcorp/clientgateways/apiv1/doc.go b/beyondcorp/clientgateways/apiv1/doc.go
new file mode 100644
index 0000000..e2f3200
--- /dev/null
+++ b/beyondcorp/clientgateways/apiv1/doc.go
@@ -0,0 +1,170 @@
+// Copyright 2022 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
+
+// Package clientgateways is an auto-generated package for the
+// BeyondCorp API.
+//
+// Beyondcorp Enterprise provides identity and context aware access controls
+// for enterprise resources and enables zero-trust access. Using the
+// Beyondcorp Enterprise APIs, enterprises can set up multi-cloud and on-prem
+// connectivity using the App Connector hybrid connectivity solution.
+//
+// NOTE: This package is in beta. It is not stable, and may be subject to changes.
+//
+// Example usage
+//
+// To get started with this package, create a client.
+// ctx := context.Background()
+// c, err := clientgateways.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.
+//
+// ctx := context.Background()
+// c, err := clientgateways.NewClient(ctx)
+// if err != nil {
+// // TODO: Handle error.
+// }
+// defer c.Close()
+//
+// req := &clientgatewayspb.ListClientGatewaysRequest{
+// // TODO: Fill request struct fields.
+// // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/beyondcorp/clientgateways/v1#ListClientGatewaysRequest.
+// }
+// it := c.ListClientGateways(ctx, req)
+// for {
+// resp, err := it.Next()
+// if err == iterator.Done {
+// break
+// }
+// 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.
+//
+// For information about setting deadlines, reusing contexts, and more
+// please visit https://pkg.go.dev/cloud.google.com/go.
+package clientgateways // import "cloud.google.com/go/beyondcorp/clientgateways/apiv1"
+
+import (
+ "context"
+ "os"
+ "runtime"
+ "strconv"
+ "strings"
+ "unicode"
+
+ "google.golang.org/api/option"
+ "google.golang.org/grpc/metadata"
+)
+
+// For more information on implementing a client constructor hook, see
+// https://github.com/googleapis/google-cloud-go/wiki/Customizing-constructors.
+type clientHookParams struct{}
+type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error)
+
+var versionClient string
+
+func getVersionClient() string {
+ if versionClient == "" {
+ return "UNKNOWN"
+ }
+ return versionClient
+}
+
+func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
+ out, _ := metadata.FromOutgoingContext(ctx)
+ out = out.Copy()
+ for _, md := range mds {
+ for k, v := range md {
+ out[k] = append(out[k], v...)
+ }
+ }
+ return metadata.NewOutgoingContext(ctx, out)
+}
+
+func checkDisableDeadlines() (bool, error) {
+ raw, ok := os.LookupEnv("GOOGLE_API_GO_EXPERIMENTAL_DISABLE_DEFAULT_DEADLINE")
+ if !ok {
+ return false, nil
+ }
+
+ b, err := strconv.ParseBool(raw)
+ return b, err
+}
+
+// DefaultAuthScopes reports the default set of authentication scopes to use with this package.
+func DefaultAuthScopes() []string {
+ return []string{
+ "https://www.googleapis.com/auth/cloud-platform",
+ }
+}
+
+// versionGo returns the Go runtime version. The returned string
+// has no whitespace, suitable for reporting in header.
+func versionGo() string {
+ const develPrefix = "devel +"
+
+ s := runtime.Version()
+ if strings.HasPrefix(s, develPrefix) {
+ s = s[len(develPrefix):]
+ if p := strings.IndexFunc(s, unicode.IsSpace); p >= 0 {
+ s = s[:p]
+ }
+ return s
+ }
+
+ notSemverRune := func(r rune) bool {
+ return !strings.ContainsRune("0123456789.", r)
+ }
+
+ if strings.HasPrefix(s, "go1") {
+ s = s[2:]
+ var prerelease string
+ if p := strings.IndexFunc(s, notSemverRune); p >= 0 {
+ s, prerelease = s[:p], s[p:]
+ }
+ if strings.HasSuffix(s, ".") {
+ s += "0"
+ } else if strings.Count(s, ".") < 2 {
+ s += ".0"
+ }
+ if prerelease != "" {
+ s += "-" + prerelease
+ }
+ return s
+ }
+ return "UNKNOWN"
+}
diff --git a/beyondcorp/clientgateways/apiv1/gapic_metadata.json b/beyondcorp/clientgateways/apiv1/gapic_metadata.json
new file mode 100644
index 0000000..1bc3c7c
--- /dev/null
+++ b/beyondcorp/clientgateways/apiv1/gapic_metadata.json
@@ -0,0 +1,83 @@
+{
+ "schema": "1.0",
+ "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.",
+ "language": "go",
+ "protoPackage": "google.cloud.beyondcorp.clientgateways.v1",
+ "libraryPackage": "cloud.google.com/go/beyondcorp/clientgateways/apiv1",
+ "services": {
+ "ClientGatewaysService": {
+ "clients": {
+ "grpc": {
+ "libraryClient": "Client",
+ "rpcs": {
+ "CancelOperation": {
+ "methods": [
+ "CancelOperation"
+ ]
+ },
+ "CreateClientGateway": {
+ "methods": [
+ "CreateClientGateway"
+ ]
+ },
+ "DeleteClientGateway": {
+ "methods": [
+ "DeleteClientGateway"
+ ]
+ },
+ "DeleteOperation": {
+ "methods": [
+ "DeleteOperation"
+ ]
+ },
+ "GetClientGateway": {
+ "methods": [
+ "GetClientGateway"
+ ]
+ },
+ "GetIamPolicy": {
+ "methods": [
+ "GetIamPolicy"
+ ]
+ },
+ "GetLocation": {
+ "methods": [
+ "GetLocation"
+ ]
+ },
+ "GetOperation": {
+ "methods": [
+ "GetOperation"
+ ]
+ },
+ "ListClientGateways": {
+ "methods": [
+ "ListClientGateways"
+ ]
+ },
+ "ListLocations": {
+ "methods": [
+ "ListLocations"
+ ]
+ },
+ "ListOperations": {
+ "methods": [
+ "ListOperations"
+ ]
+ },
+ "SetIamPolicy": {
+ "methods": [
+ "SetIamPolicy"
+ ]
+ },
+ "TestIamPermissions": {
+ "methods": [
+ "TestIamPermissions"
+ ]
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/beyondcorp/clientgateways/apiv1/version.go b/beyondcorp/clientgateways/apiv1/version.go
new file mode 100644
index 0000000..18e6e07
--- /dev/null
+++ b/beyondcorp/clientgateways/apiv1/version.go
@@ -0,0 +1,23 @@
+// Copyright 2022 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Code generated by gapicgen. DO NOT EDIT.
+
+package clientgateways
+
+import "cloud.google.com/go/beyondcorp/internal"
+
+func init() {
+ versionClient = internal.Version
+}
diff --git a/internal/.repo-metadata-full.json b/internal/.repo-metadata-full.json
index 54e5f79..6a70c12 100644
--- a/internal/.repo-metadata-full.json
+++ b/internal/.repo-metadata-full.json
@@ -179,6 +179,42 @@
"release_level": "beta",
"library_type": "GAPIC_AUTO"
},
+ "cloud.google.com/go/beyondcorp/appconnectors/apiv1": {
+ "distribution_name": "cloud.google.com/go/beyondcorp/appconnectors/apiv1",
+ "description": "BeyondCorp API",
+ "language": "Go",
+ "client_library_type": "generated",
+ "docs_url": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/beyondcorp/latest/appconnectors/apiv1",
+ "release_level": "beta",
+ "library_type": "GAPIC_AUTO"
+ },
+ "cloud.google.com/go/beyondcorp/appgateways/apiv1": {
+ "distribution_name": "cloud.google.com/go/beyondcorp/appgateways/apiv1",
+ "description": "BeyondCorp API",
+ "language": "Go",
+ "client_library_type": "generated",
+ "docs_url": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/beyondcorp/latest/appgateways/apiv1",
+ "release_level": "beta",
+ "library_type": "GAPIC_AUTO"
+ },
+ "cloud.google.com/go/beyondcorp/clientconnectorservices/apiv1": {
+ "distribution_name": "cloud.google.com/go/beyondcorp/clientconnectorservices/apiv1",
+ "description": "BeyondCorp API",
+ "language": "Go",
+ "client_library_type": "generated",
+ "docs_url": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/beyondcorp/latest/clientconnectorservices/apiv1",
+ "release_level": "beta",
+ "library_type": "GAPIC_AUTO"
+ },
+ "cloud.google.com/go/beyondcorp/clientgateways/apiv1": {
+ "distribution_name": "cloud.google.com/go/beyondcorp/clientgateways/apiv1",
+ "description": "BeyondCorp API",
+ "language": "Go",
+ "client_library_type": "generated",
+ "docs_url": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/beyondcorp/latest/clientgateways/apiv1",
+ "release_level": "beta",
+ "library_type": "GAPIC_AUTO"
+ },
"cloud.google.com/go/bigquery": {
"distribution_name": "cloud.google.com/go/bigquery",
"description": "BigQuery",
diff --git a/internal/gapicgen/generator/config.go b/internal/gapicgen/generator/config.go
index 4c9463c..7a65fc7 100644
--- a/internal/gapicgen/generator/config.go
+++ b/internal/gapicgen/generator/config.go
@@ -1588,6 +1588,42 @@
// GA after 2022/08/12
ReleaseLevel: "beta",
},
+ {
+ InputDirectoryPath: "google/cloud/beyondcorp/appconnectors/v1",
+ Pkg: "appconnectors",
+ ImportPath: "cloud.google.com/go/beyondcorp/appconnectors/apiv1",
+ GRPCServiceConfigPath: "beyondcorp-appconnectors_grpc_service_config.json",
+ ApiServiceConfigPath: "beyondcorp_v1.yaml",
+ // GA after 2022/08/12
+ ReleaseLevel: "beta",
+ },
+ {
+ InputDirectoryPath: "google/cloud/beyondcorp/appgateways/v1",
+ Pkg: "appgateways",
+ ImportPath: "cloud.google.com/go/beyondcorp/appgateways/apiv1",
+ GRPCServiceConfigPath: "beyondcorp-appgateways_grpc_service_config.json",
+ ApiServiceConfigPath: "beyondcorp_v1.yaml",
+ // GA after 2022/08/12
+ ReleaseLevel: "beta",
+ },
+ {
+ InputDirectoryPath: "google/cloud/beyondcorp/clientconnectorservices/v1",
+ Pkg: "clientconnectorservices",
+ ImportPath: "cloud.google.com/go/beyondcorp/clientconnectorservices/apiv1",
+ GRPCServiceConfigPath: "beyondcorp-clientconnectorservices_grpc_service_config.json",
+ ApiServiceConfigPath: "beyondcorp_v1.yaml",
+ // GA after 2022/08/12
+ ReleaseLevel: "beta",
+ },
+ {
+ InputDirectoryPath: "google/cloud/beyondcorp/clientgateways/v1",
+ Pkg: "clientgateways",
+ ImportPath: "cloud.google.com/go/beyondcorp/clientgateways/apiv1",
+ GRPCServiceConfigPath: "beyondcorp-clientgateways_grpc_service_config.json",
+ ApiServiceConfigPath: "beyondcorp_v1.yaml",
+ // GA after 2022/08/12
+ ReleaseLevel: "beta",
+ },
// Non-Cloud APIs
{