...

Source file src/google.golang.org/api/vpcaccess/v1/vpcaccess-gen.go

Documentation: google.golang.org/api/vpcaccess/v1

     1  // Copyright 2024 Google LLC.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  // Code generated file. DO NOT EDIT.
     6  
     7  // Package vpcaccess provides access to the Serverless VPC Access API.
     8  //
     9  // For product documentation, see: https://cloud.google.com/vpc/docs/configure-serverless-vpc-access
    10  //
    11  // # Library status
    12  //
    13  // These client libraries are officially supported by Google. However, this
    14  // library is considered complete and is in maintenance mode. This means
    15  // that we will address critical bugs and security issues but will not add
    16  // any new features.
    17  //
    18  // When possible, we recommend using our newer
    19  // [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go)
    20  // that are still actively being worked and iterated on.
    21  //
    22  // # Creating a client
    23  //
    24  // Usage example:
    25  //
    26  //	import "google.golang.org/api/vpcaccess/v1"
    27  //	...
    28  //	ctx := context.Background()
    29  //	vpcaccessService, err := vpcaccess.NewService(ctx)
    30  //
    31  // In this example, Google Application Default Credentials are used for
    32  // authentication. For information on how to create and obtain Application
    33  // Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
    34  //
    35  // # Other authentication options
    36  //
    37  // To use an API key for authentication (note: some APIs do not support API
    38  // keys), use [google.golang.org/api/option.WithAPIKey]:
    39  //
    40  //	vpcaccessService, err := vpcaccess.NewService(ctx, option.WithAPIKey("AIza..."))
    41  //
    42  // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth
    43  // flow, use [google.golang.org/api/option.WithTokenSource]:
    44  //
    45  //	config := &oauth2.Config{...}
    46  //	// ...
    47  //	token, err := config.Exchange(ctx, ...)
    48  //	vpcaccessService, err := vpcaccess.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
    49  //
    50  // See [google.golang.org/api/option.ClientOption] for details on options.
    51  package vpcaccess // import "google.golang.org/api/vpcaccess/v1"
    52  
    53  import (
    54  	"bytes"
    55  	"context"
    56  	"encoding/json"
    57  	"errors"
    58  	"fmt"
    59  	"io"
    60  	"net/http"
    61  	"net/url"
    62  	"strconv"
    63  	"strings"
    64  
    65  	googleapi "google.golang.org/api/googleapi"
    66  	internal "google.golang.org/api/internal"
    67  	gensupport "google.golang.org/api/internal/gensupport"
    68  	option "google.golang.org/api/option"
    69  	internaloption "google.golang.org/api/option/internaloption"
    70  	htransport "google.golang.org/api/transport/http"
    71  )
    72  
    73  // Always reference these packages, just in case the auto-generated code
    74  // below doesn't.
    75  var _ = bytes.NewBuffer
    76  var _ = strconv.Itoa
    77  var _ = fmt.Sprintf
    78  var _ = json.NewDecoder
    79  var _ = io.Copy
    80  var _ = url.Parse
    81  var _ = gensupport.MarshalJSON
    82  var _ = googleapi.Version
    83  var _ = errors.New
    84  var _ = strings.Replace
    85  var _ = context.Canceled
    86  var _ = internaloption.WithDefaultEndpoint
    87  var _ = internal.Version
    88  
    89  const apiId = "vpcaccess:v1"
    90  const apiName = "vpcaccess"
    91  const apiVersion = "v1"
    92  const basePath = "https://vpcaccess.googleapis.com/"
    93  const basePathTemplate = "https://vpcaccess.UNIVERSE_DOMAIN/"
    94  const mtlsBasePath = "https://vpcaccess.mtls.googleapis.com/"
    95  
    96  // OAuth2 scopes used by this API.
    97  const (
    98  	// See, edit, configure, and delete your Google Cloud data and see the email
    99  	// address for your Google Account.
   100  	CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
   101  )
   102  
   103  // NewService creates a new Service.
   104  func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
   105  	scopesOption := internaloption.WithDefaultScopes(
   106  		"https://www.googleapis.com/auth/cloud-platform",
   107  	)
   108  	// NOTE: prepend, so we don't override user-specified scopes.
   109  	opts = append([]option.ClientOption{scopesOption}, opts...)
   110  	opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
   111  	opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
   112  	opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
   113  	opts = append(opts, internaloption.EnableNewAuthLibrary())
   114  	client, endpoint, err := htransport.NewClient(ctx, opts...)
   115  	if err != nil {
   116  		return nil, err
   117  	}
   118  	s, err := New(client)
   119  	if err != nil {
   120  		return nil, err
   121  	}
   122  	if endpoint != "" {
   123  		s.BasePath = endpoint
   124  	}
   125  	return s, nil
   126  }
   127  
   128  // New creates a new Service. It uses the provided http.Client for requests.
   129  //
   130  // Deprecated: please use NewService instead.
   131  // To provide a custom HTTP client, use option.WithHTTPClient.
   132  // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
   133  func New(client *http.Client) (*Service, error) {
   134  	if client == nil {
   135  		return nil, errors.New("client is nil")
   136  	}
   137  	s := &Service{client: client, BasePath: basePath}
   138  	s.Projects = NewProjectsService(s)
   139  	return s, nil
   140  }
   141  
   142  type Service struct {
   143  	client    *http.Client
   144  	BasePath  string // API endpoint base URL
   145  	UserAgent string // optional additional User-Agent fragment
   146  
   147  	Projects *ProjectsService
   148  }
   149  
   150  func (s *Service) userAgent() string {
   151  	if s.UserAgent == "" {
   152  		return googleapi.UserAgent
   153  	}
   154  	return googleapi.UserAgent + " " + s.UserAgent
   155  }
   156  
   157  func NewProjectsService(s *Service) *ProjectsService {
   158  	rs := &ProjectsService{s: s}
   159  	rs.Locations = NewProjectsLocationsService(s)
   160  	return rs
   161  }
   162  
   163  type ProjectsService struct {
   164  	s *Service
   165  
   166  	Locations *ProjectsLocationsService
   167  }
   168  
   169  func NewProjectsLocationsService(s *Service) *ProjectsLocationsService {
   170  	rs := &ProjectsLocationsService{s: s}
   171  	rs.Connectors = NewProjectsLocationsConnectorsService(s)
   172  	rs.Operations = NewProjectsLocationsOperationsService(s)
   173  	return rs
   174  }
   175  
   176  type ProjectsLocationsService struct {
   177  	s *Service
   178  
   179  	Connectors *ProjectsLocationsConnectorsService
   180  
   181  	Operations *ProjectsLocationsOperationsService
   182  }
   183  
   184  func NewProjectsLocationsConnectorsService(s *Service) *ProjectsLocationsConnectorsService {
   185  	rs := &ProjectsLocationsConnectorsService{s: s}
   186  	return rs
   187  }
   188  
   189  type ProjectsLocationsConnectorsService struct {
   190  	s *Service
   191  }
   192  
   193  func NewProjectsLocationsOperationsService(s *Service) *ProjectsLocationsOperationsService {
   194  	rs := &ProjectsLocationsOperationsService{s: s}
   195  	return rs
   196  }
   197  
   198  type ProjectsLocationsOperationsService struct {
   199  	s *Service
   200  }
   201  
   202  // Connector: Definition of a Serverless VPC Access connector.
   203  type Connector struct {
   204  	// ConnectedProjects: Output only. List of projects using the connector.
   205  	ConnectedProjects []string `json:"connectedProjects,omitempty"`
   206  	// IpCidrRange: The range of internal addresses that follows RFC 4632 notation.
   207  	// Example: `10.132.0.0/28`.
   208  	IpCidrRange string `json:"ipCidrRange,omitempty"`
   209  	// MachineType: Machine type of VM Instance underlying connector. Default is
   210  	// e2-micro
   211  	MachineType string `json:"machineType,omitempty"`
   212  	// MaxInstances: Maximum value of instances in autoscaling group underlying the
   213  	// connector.
   214  	MaxInstances int64 `json:"maxInstances,omitempty"`
   215  	// MaxThroughput: Maximum throughput of the connector in Mbps. Refers to the
   216  	// expected throughput when using an `e2-micro` machine type. Value must be a
   217  	// multiple of 100 from 300 through 1000. Must be higher than the value
   218  	// specified by --min-throughput. If both max-throughput and max-instances are
   219  	// provided, max-instances takes precedence over max-throughput. The use of
   220  	// `max-throughput` is discouraged in favor of `max-instances`.
   221  	MaxThroughput int64 `json:"maxThroughput,omitempty"`
   222  	// MinInstances: Minimum value of instances in autoscaling group underlying the
   223  	// connector.
   224  	MinInstances int64 `json:"minInstances,omitempty"`
   225  	// MinThroughput: Minimum throughput of the connector in Mbps. Refers to the
   226  	// expected throughput when using an `e2-micro` machine type. Value must be a
   227  	// multiple of 100 from 200 through 900. Must be lower than the value specified
   228  	// by --max-throughput. If both min-throughput and min-instances are provided,
   229  	// min-instances takes precedence over min-throughput. The use of
   230  	// `min-throughput` is discouraged in favor of `min-instances`.
   231  	MinThroughput int64 `json:"minThroughput,omitempty"`
   232  	// Name: The resource name in the format `projects/*/locations/*/connectors/*`.
   233  	Name string `json:"name,omitempty"`
   234  	// Network: Name of a VPC network.
   235  	Network string `json:"network,omitempty"`
   236  	// State: Output only. State of the VPC access connector.
   237  	//
   238  	// Possible values:
   239  	//   "STATE_UNSPECIFIED" - Invalid state.
   240  	//   "READY" - Connector is deployed and ready to receive traffic.
   241  	//   "CREATING" - An Insert operation is in progress. Transient condition.
   242  	//   "DELETING" - A Delete operation is in progress. Transient condition.
   243  	//   "ERROR" - Connector is in a bad state, manual deletion recommended.
   244  	//   "UPDATING" - The connector is being updated.
   245  	State string `json:"state,omitempty"`
   246  	// Subnet: The subnet in which to house the VPC Access Connector.
   247  	Subnet *Subnet `json:"subnet,omitempty"`
   248  
   249  	// ServerResponse contains the HTTP response code and headers from the server.
   250  	googleapi.ServerResponse `json:"-"`
   251  	// ForceSendFields is a list of field names (e.g. "ConnectedProjects") to
   252  	// unconditionally include in API requests. By default, fields with empty or
   253  	// default values are omitted from API requests. See
   254  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   255  	// details.
   256  	ForceSendFields []string `json:"-"`
   257  	// NullFields is a list of field names (e.g. "ConnectedProjects") to include in
   258  	// API requests with the JSON null value. By default, fields with empty values
   259  	// are omitted from API requests. See
   260  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   261  	NullFields []string `json:"-"`
   262  }
   263  
   264  func (s *Connector) MarshalJSON() ([]byte, error) {
   265  	type NoMethod Connector
   266  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   267  }
   268  
   269  // ListConnectorsResponse: Response for listing Serverless VPC Access
   270  // connectors.
   271  type ListConnectorsResponse struct {
   272  	// Connectors: List of Serverless VPC Access connectors.
   273  	Connectors []*Connector `json:"connectors,omitempty"`
   274  	// NextPageToken: Continuation token.
   275  	NextPageToken string `json:"nextPageToken,omitempty"`
   276  
   277  	// ServerResponse contains the HTTP response code and headers from the server.
   278  	googleapi.ServerResponse `json:"-"`
   279  	// ForceSendFields is a list of field names (e.g. "Connectors") to
   280  	// unconditionally include in API requests. By default, fields with empty or
   281  	// default values are omitted from API requests. See
   282  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   283  	// details.
   284  	ForceSendFields []string `json:"-"`
   285  	// NullFields is a list of field names (e.g. "Connectors") to include in API
   286  	// requests with the JSON null value. By default, fields with empty values are
   287  	// omitted from API requests. See
   288  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   289  	NullFields []string `json:"-"`
   290  }
   291  
   292  func (s *ListConnectorsResponse) MarshalJSON() ([]byte, error) {
   293  	type NoMethod ListConnectorsResponse
   294  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   295  }
   296  
   297  // ListLocationsResponse: The response message for Locations.ListLocations.
   298  type ListLocationsResponse struct {
   299  	// Locations: A list of locations that matches the specified filter in the
   300  	// request.
   301  	Locations []*Location `json:"locations,omitempty"`
   302  	// NextPageToken: The standard List next-page token.
   303  	NextPageToken string `json:"nextPageToken,omitempty"`
   304  
   305  	// ServerResponse contains the HTTP response code and headers from the server.
   306  	googleapi.ServerResponse `json:"-"`
   307  	// ForceSendFields is a list of field names (e.g. "Locations") to
   308  	// unconditionally include in API requests. By default, fields with empty or
   309  	// default values are omitted from API requests. See
   310  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   311  	// details.
   312  	ForceSendFields []string `json:"-"`
   313  	// NullFields is a list of field names (e.g. "Locations") to include in API
   314  	// requests with the JSON null value. By default, fields with empty values are
   315  	// omitted from API requests. See
   316  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   317  	NullFields []string `json:"-"`
   318  }
   319  
   320  func (s *ListLocationsResponse) MarshalJSON() ([]byte, error) {
   321  	type NoMethod ListLocationsResponse
   322  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   323  }
   324  
   325  // ListOperationsResponse: The response message for Operations.ListOperations.
   326  type ListOperationsResponse struct {
   327  	// NextPageToken: The standard List next-page token.
   328  	NextPageToken string `json:"nextPageToken,omitempty"`
   329  	// Operations: A list of operations that matches the specified filter in the
   330  	// request.
   331  	Operations []*Operation `json:"operations,omitempty"`
   332  
   333  	// ServerResponse contains the HTTP response code and headers from the server.
   334  	googleapi.ServerResponse `json:"-"`
   335  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
   336  	// unconditionally include in API requests. By default, fields with empty or
   337  	// default values are omitted from API requests. See
   338  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   339  	// details.
   340  	ForceSendFields []string `json:"-"`
   341  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
   342  	// requests with the JSON null value. By default, fields with empty values are
   343  	// omitted from API requests. See
   344  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   345  	NullFields []string `json:"-"`
   346  }
   347  
   348  func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) {
   349  	type NoMethod ListOperationsResponse
   350  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   351  }
   352  
   353  // Location: A resource that represents a Google Cloud location.
   354  type Location struct {
   355  	// DisplayName: The friendly name for this location, typically a nearby city
   356  	// name. For example, "Tokyo".
   357  	DisplayName string `json:"displayName,omitempty"`
   358  	// Labels: Cross-service attributes for the location. For example
   359  	// {"cloud.googleapis.com/region": "us-east1"}
   360  	Labels map[string]string `json:"labels,omitempty"`
   361  	// LocationId: The canonical id for this location. For example: "us-east1".
   362  	LocationId string `json:"locationId,omitempty"`
   363  	// Metadata: Service-specific metadata. For example the available capacity at
   364  	// the given location.
   365  	Metadata googleapi.RawMessage `json:"metadata,omitempty"`
   366  	// Name: Resource name for the location, which may vary between
   367  	// implementations. For example:
   368  	// "projects/example-project/locations/us-east1"
   369  	Name string `json:"name,omitempty"`
   370  	// ForceSendFields is a list of field names (e.g. "DisplayName") to
   371  	// unconditionally include in API requests. By default, fields with empty or
   372  	// default values are omitted from API requests. See
   373  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   374  	// details.
   375  	ForceSendFields []string `json:"-"`
   376  	// NullFields is a list of field names (e.g. "DisplayName") to include in API
   377  	// requests with the JSON null value. By default, fields with empty values are
   378  	// omitted from API requests. See
   379  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   380  	NullFields []string `json:"-"`
   381  }
   382  
   383  func (s *Location) MarshalJSON() ([]byte, error) {
   384  	type NoMethod Location
   385  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   386  }
   387  
   388  // Operation: This resource represents a long-running operation that is the
   389  // result of a network API call.
   390  type Operation struct {
   391  	// Done: If the value is `false`, it means the operation is still in progress.
   392  	// If `true`, the operation is completed, and either `error` or `response` is
   393  	// available.
   394  	Done bool `json:"done,omitempty"`
   395  	// Error: The error result of the operation in case of failure or cancellation.
   396  	Error *Status `json:"error,omitempty"`
   397  	// Metadata: Service-specific metadata associated with the operation. It
   398  	// typically contains progress information and common metadata such as create
   399  	// time. Some services might not provide such metadata. Any method that returns
   400  	// a long-running operation should document the metadata type, if any.
   401  	Metadata googleapi.RawMessage `json:"metadata,omitempty"`
   402  	// Name: The server-assigned name, which is only unique within the same service
   403  	// that originally returns it. If you use the default HTTP mapping, the `name`
   404  	// should be a resource name ending with `operations/{unique_id}`.
   405  	Name string `json:"name,omitempty"`
   406  	// Response: The normal, successful response of the operation. If the original
   407  	// method returns no data on success, such as `Delete`, the response is
   408  	// `google.protobuf.Empty`. If the original method is standard
   409  	// `Get`/`Create`/`Update`, the response should be the resource. For other
   410  	// methods, the response should have the type `XxxResponse`, where `Xxx` is the
   411  	// original method name. For example, if the original method name is
   412  	// `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
   413  	Response googleapi.RawMessage `json:"response,omitempty"`
   414  
   415  	// ServerResponse contains the HTTP response code and headers from the server.
   416  	googleapi.ServerResponse `json:"-"`
   417  	// ForceSendFields is a list of field names (e.g. "Done") to unconditionally
   418  	// include in API requests. By default, fields with empty or default values are
   419  	// omitted from API requests. See
   420  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   421  	// details.
   422  	ForceSendFields []string `json:"-"`
   423  	// NullFields is a list of field names (e.g. "Done") to include in API requests
   424  	// with the JSON null value. By default, fields with empty values are omitted
   425  	// from API requests. See
   426  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   427  	NullFields []string `json:"-"`
   428  }
   429  
   430  func (s *Operation) MarshalJSON() ([]byte, error) {
   431  	type NoMethod Operation
   432  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   433  }
   434  
   435  // OperationMetadata: Metadata for google.longrunning.Operation.
   436  type OperationMetadata struct {
   437  	// CreateTime: Output only. Time when the operation was created.
   438  	CreateTime string `json:"createTime,omitempty"`
   439  	// EndTime: Output only. Time when the operation completed.
   440  	EndTime string `json:"endTime,omitempty"`
   441  	// Method: Output only. Method that initiated the operation e.g.
   442  	// google.cloud.vpcaccess.v1.Connectors.CreateConnector.
   443  	Method string `json:"method,omitempty"`
   444  	// Target: Output only. Name of the resource that this operation is acting on
   445  	// e.g. projects/my-project/locations/us-central1/connectors/v1.
   446  	Target string `json:"target,omitempty"`
   447  	// ForceSendFields is a list of field names (e.g. "CreateTime") to
   448  	// unconditionally include in API requests. By default, fields with empty or
   449  	// default values are omitted from API requests. See
   450  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   451  	// details.
   452  	ForceSendFields []string `json:"-"`
   453  	// NullFields is a list of field names (e.g. "CreateTime") to include in API
   454  	// requests with the JSON null value. By default, fields with empty values are
   455  	// omitted from API requests. See
   456  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   457  	NullFields []string `json:"-"`
   458  }
   459  
   460  func (s *OperationMetadata) MarshalJSON() ([]byte, error) {
   461  	type NoMethod OperationMetadata
   462  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   463  }
   464  
   465  // OperationMetadataV1Alpha1: Metadata for google.longrunning.Operation.
   466  type OperationMetadataV1Alpha1 struct {
   467  	// EndTime: Output only. Time when the operation completed.
   468  	EndTime string `json:"endTime,omitempty"`
   469  	// InsertTime: Output only. Time when the operation was created.
   470  	InsertTime string `json:"insertTime,omitempty"`
   471  	// Method: Output only. Method that initiated the operation e.g.
   472  	// google.cloud.vpcaccess.v1alpha1.Connectors.CreateConnector.
   473  	Method string `json:"method,omitempty"`
   474  	// Target: Output only. Name of the resource that this operation is acting on
   475  	// e.g. projects/my-project/locations/us-central1/connectors/v1.
   476  	Target string `json:"target,omitempty"`
   477  	// ForceSendFields is a list of field names (e.g. "EndTime") to unconditionally
   478  	// include in API requests. By default, fields with empty or default values are
   479  	// omitted from API requests. See
   480  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   481  	// details.
   482  	ForceSendFields []string `json:"-"`
   483  	// NullFields is a list of field names (e.g. "EndTime") to include in API
   484  	// requests with the JSON null value. By default, fields with empty values are
   485  	// omitted from API requests. See
   486  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   487  	NullFields []string `json:"-"`
   488  }
   489  
   490  func (s *OperationMetadataV1Alpha1) MarshalJSON() ([]byte, error) {
   491  	type NoMethod OperationMetadataV1Alpha1
   492  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   493  }
   494  
   495  // OperationMetadataV1Beta1: Metadata for google.longrunning.Operation.
   496  type OperationMetadataV1Beta1 struct {
   497  	// CreateTime: Output only. Time when the operation was created.
   498  	CreateTime string `json:"createTime,omitempty"`
   499  	// EndTime: Output only. Time when the operation completed.
   500  	EndTime string `json:"endTime,omitempty"`
   501  	// Method: Output only. Method that initiated the operation e.g.
   502  	// google.cloud.vpcaccess.v1beta1.Connectors.CreateConnector.
   503  	Method string `json:"method,omitempty"`
   504  	// Target: Output only. Name of the resource that this operation is acting on
   505  	// e.g. projects/my-project/locations/us-central1/connectors/v1.
   506  	Target string `json:"target,omitempty"`
   507  	// ForceSendFields is a list of field names (e.g. "CreateTime") to
   508  	// unconditionally include in API requests. By default, fields with empty or
   509  	// default values are omitted from API requests. See
   510  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   511  	// details.
   512  	ForceSendFields []string `json:"-"`
   513  	// NullFields is a list of field names (e.g. "CreateTime") to include in API
   514  	// requests with the JSON null value. By default, fields with empty values are
   515  	// omitted from API requests. See
   516  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   517  	NullFields []string `json:"-"`
   518  }
   519  
   520  func (s *OperationMetadataV1Beta1) MarshalJSON() ([]byte, error) {
   521  	type NoMethod OperationMetadataV1Beta1
   522  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   523  }
   524  
   525  // Status: The `Status` type defines a logical error model that is suitable for
   526  // different programming environments, including REST APIs and RPC APIs. It is
   527  // used by gRPC (https://github.com/grpc). Each `Status` message contains three
   528  // pieces of data: error code, error message, and error details. You can find
   529  // out more about this error model and how to work with it in the API Design
   530  // Guide (https://cloud.google.com/apis/design/errors).
   531  type Status struct {
   532  	// Code: The status code, which should be an enum value of google.rpc.Code.
   533  	Code int64 `json:"code,omitempty"`
   534  	// Details: A list of messages that carry the error details. There is a common
   535  	// set of message types for APIs to use.
   536  	Details []googleapi.RawMessage `json:"details,omitempty"`
   537  	// Message: A developer-facing error message, which should be in English. Any
   538  	// user-facing error message should be localized and sent in the
   539  	// google.rpc.Status.details field, or localized by the client.
   540  	Message string `json:"message,omitempty"`
   541  	// ForceSendFields is a list of field names (e.g. "Code") to unconditionally
   542  	// include in API requests. By default, fields with empty or default values are
   543  	// omitted from API requests. See
   544  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   545  	// details.
   546  	ForceSendFields []string `json:"-"`
   547  	// NullFields is a list of field names (e.g. "Code") to include in API requests
   548  	// with the JSON null value. By default, fields with empty values are omitted
   549  	// from API requests. See
   550  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   551  	NullFields []string `json:"-"`
   552  }
   553  
   554  func (s *Status) MarshalJSON() ([]byte, error) {
   555  	type NoMethod Status
   556  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   557  }
   558  
   559  // Subnet: The subnet in which to house the connector
   560  type Subnet struct {
   561  	// Name: Subnet name (relative, not fully qualified). E.g. if the full subnet
   562  	// selfLink is
   563  	// https://compute.googleapis.com/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetName}
   564  	// the correct input for this field would be {subnetName}
   565  	Name string `json:"name,omitempty"`
   566  	// ProjectId: Project in which the subnet exists. If not set, this project is
   567  	// assumed to be the project for which the connector create request was issued.
   568  	ProjectId string `json:"projectId,omitempty"`
   569  	// ForceSendFields is a list of field names (e.g. "Name") to unconditionally
   570  	// include in API requests. By default, fields with empty or default values are
   571  	// omitted from API requests. See
   572  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   573  	// details.
   574  	ForceSendFields []string `json:"-"`
   575  	// NullFields is a list of field names (e.g. "Name") to include in API requests
   576  	// with the JSON null value. By default, fields with empty values are omitted
   577  	// from API requests. See
   578  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   579  	NullFields []string `json:"-"`
   580  }
   581  
   582  func (s *Subnet) MarshalJSON() ([]byte, error) {
   583  	type NoMethod Subnet
   584  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   585  }
   586  
   587  type ProjectsLocationsListCall struct {
   588  	s            *Service
   589  	name         string
   590  	urlParams_   gensupport.URLParams
   591  	ifNoneMatch_ string
   592  	ctx_         context.Context
   593  	header_      http.Header
   594  }
   595  
   596  // List: Lists information about the supported locations for this service.
   597  //
   598  // - name: The resource that owns the locations collection, if applicable.
   599  func (r *ProjectsLocationsService) List(name string) *ProjectsLocationsListCall {
   600  	c := &ProjectsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
   601  	c.name = name
   602  	return c
   603  }
   604  
   605  // Filter sets the optional parameter "filter": A filter to narrow down results
   606  // to a preferred subset. The filtering language accepts strings like
   607  // "displayName=tokyo", and is documented in more detail in AIP-160
   608  // (https://google.aip.dev/160).
   609  func (c *ProjectsLocationsListCall) Filter(filter string) *ProjectsLocationsListCall {
   610  	c.urlParams_.Set("filter", filter)
   611  	return c
   612  }
   613  
   614  // PageSize sets the optional parameter "pageSize": The maximum number of
   615  // results to return. If not set, the service selects a default.
   616  func (c *ProjectsLocationsListCall) PageSize(pageSize int64) *ProjectsLocationsListCall {
   617  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
   618  	return c
   619  }
   620  
   621  // PageToken sets the optional parameter "pageToken": A page token received
   622  // from the `next_page_token` field in the response. Send that page token to
   623  // receive the subsequent page.
   624  func (c *ProjectsLocationsListCall) PageToken(pageToken string) *ProjectsLocationsListCall {
   625  	c.urlParams_.Set("pageToken", pageToken)
   626  	return c
   627  }
   628  
   629  // Fields allows partial responses to be retrieved. See
   630  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
   631  // details.
   632  func (c *ProjectsLocationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsListCall {
   633  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
   634  	return c
   635  }
   636  
   637  // IfNoneMatch sets an optional parameter which makes the operation fail if the
   638  // object's ETag matches the given value. This is useful for getting updates
   639  // only after the object has changed since the last request.
   640  func (c *ProjectsLocationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsListCall {
   641  	c.ifNoneMatch_ = entityTag
   642  	return c
   643  }
   644  
   645  // Context sets the context to be used in this call's Do method.
   646  func (c *ProjectsLocationsListCall) Context(ctx context.Context) *ProjectsLocationsListCall {
   647  	c.ctx_ = ctx
   648  	return c
   649  }
   650  
   651  // Header returns a http.Header that can be modified by the caller to add
   652  // headers to the request.
   653  func (c *ProjectsLocationsListCall) Header() http.Header {
   654  	if c.header_ == nil {
   655  		c.header_ = make(http.Header)
   656  	}
   657  	return c.header_
   658  }
   659  
   660  func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error) {
   661  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
   662  	if c.ifNoneMatch_ != "" {
   663  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
   664  	}
   665  	var body io.Reader = nil
   666  	c.urlParams_.Set("alt", alt)
   667  	c.urlParams_.Set("prettyPrint", "false")
   668  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations")
   669  	urls += "?" + c.urlParams_.Encode()
   670  	req, err := http.NewRequest("GET", urls, body)
   671  	if err != nil {
   672  		return nil, err
   673  	}
   674  	req.Header = reqHeaders
   675  	googleapi.Expand(req.URL, map[string]string{
   676  		"name": c.name,
   677  	})
   678  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
   679  }
   680  
   681  // Do executes the "vpcaccess.projects.locations.list" call.
   682  // Any non-2xx status code is an error. Response headers are in either
   683  // *ListLocationsResponse.ServerResponse.Header or (if a response was returned
   684  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
   685  // check whether the returned error was because http.StatusNotModified was
   686  // returned.
   687  func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) {
   688  	gensupport.SetOptions(c.urlParams_, opts...)
   689  	res, err := c.doRequest("json")
   690  	if res != nil && res.StatusCode == http.StatusNotModified {
   691  		if res.Body != nil {
   692  			res.Body.Close()
   693  		}
   694  		return nil, gensupport.WrapError(&googleapi.Error{
   695  			Code:   res.StatusCode,
   696  			Header: res.Header,
   697  		})
   698  	}
   699  	if err != nil {
   700  		return nil, err
   701  	}
   702  	defer googleapi.CloseBody(res)
   703  	if err := googleapi.CheckResponse(res); err != nil {
   704  		return nil, gensupport.WrapError(err)
   705  	}
   706  	ret := &ListLocationsResponse{
   707  		ServerResponse: googleapi.ServerResponse{
   708  			Header:         res.Header,
   709  			HTTPStatusCode: res.StatusCode,
   710  		},
   711  	}
   712  	target := &ret
   713  	if err := gensupport.DecodeResponse(target, res); err != nil {
   714  		return nil, err
   715  	}
   716  	return ret, nil
   717  }
   718  
   719  // Pages invokes f for each page of results.
   720  // A non-nil error returned from f will halt the iteration.
   721  // The provided context supersedes any context provided to the Context method.
   722  func (c *ProjectsLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error {
   723  	c.ctx_ = ctx
   724  	defer c.PageToken(c.urlParams_.Get("pageToken"))
   725  	for {
   726  		x, err := c.Do()
   727  		if err != nil {
   728  			return err
   729  		}
   730  		if err := f(x); err != nil {
   731  			return err
   732  		}
   733  		if x.NextPageToken == "" {
   734  			return nil
   735  		}
   736  		c.PageToken(x.NextPageToken)
   737  	}
   738  }
   739  
   740  type ProjectsLocationsConnectorsCreateCall struct {
   741  	s          *Service
   742  	parent     string
   743  	connector  *Connector
   744  	urlParams_ gensupport.URLParams
   745  	ctx_       context.Context
   746  	header_    http.Header
   747  }
   748  
   749  // Create: Creates a Serverless VPC Access connector, returns an operation.
   750  //
   751  //   - parent: The project ID and location in which the configuration should be
   752  //     created, specified in the format `projects/*/locations/*`.
   753  func (r *ProjectsLocationsConnectorsService) Create(parent string, connector *Connector) *ProjectsLocationsConnectorsCreateCall {
   754  	c := &ProjectsLocationsConnectorsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
   755  	c.parent = parent
   756  	c.connector = connector
   757  	return c
   758  }
   759  
   760  // ConnectorId sets the optional parameter "connectorId": Required. The ID to
   761  // use for this connector.
   762  func (c *ProjectsLocationsConnectorsCreateCall) ConnectorId(connectorId string) *ProjectsLocationsConnectorsCreateCall {
   763  	c.urlParams_.Set("connectorId", connectorId)
   764  	return c
   765  }
   766  
   767  // Fields allows partial responses to be retrieved. See
   768  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
   769  // details.
   770  func (c *ProjectsLocationsConnectorsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsConnectorsCreateCall {
   771  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
   772  	return c
   773  }
   774  
   775  // Context sets the context to be used in this call's Do method.
   776  func (c *ProjectsLocationsConnectorsCreateCall) Context(ctx context.Context) *ProjectsLocationsConnectorsCreateCall {
   777  	c.ctx_ = ctx
   778  	return c
   779  }
   780  
   781  // Header returns a http.Header that can be modified by the caller to add
   782  // headers to the request.
   783  func (c *ProjectsLocationsConnectorsCreateCall) Header() http.Header {
   784  	if c.header_ == nil {
   785  		c.header_ = make(http.Header)
   786  	}
   787  	return c.header_
   788  }
   789  
   790  func (c *ProjectsLocationsConnectorsCreateCall) doRequest(alt string) (*http.Response, error) {
   791  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
   792  	var body io.Reader = nil
   793  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.connector)
   794  	if err != nil {
   795  		return nil, err
   796  	}
   797  	c.urlParams_.Set("alt", alt)
   798  	c.urlParams_.Set("prettyPrint", "false")
   799  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/connectors")
   800  	urls += "?" + c.urlParams_.Encode()
   801  	req, err := http.NewRequest("POST", urls, body)
   802  	if err != nil {
   803  		return nil, err
   804  	}
   805  	req.Header = reqHeaders
   806  	googleapi.Expand(req.URL, map[string]string{
   807  		"parent": c.parent,
   808  	})
   809  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
   810  }
   811  
   812  // Do executes the "vpcaccess.projects.locations.connectors.create" call.
   813  // Any non-2xx status code is an error. Response headers are in either
   814  // *Operation.ServerResponse.Header or (if a response was returned at all) in
   815  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
   816  // whether the returned error was because http.StatusNotModified was returned.
   817  func (c *ProjectsLocationsConnectorsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
   818  	gensupport.SetOptions(c.urlParams_, opts...)
   819  	res, err := c.doRequest("json")
   820  	if res != nil && res.StatusCode == http.StatusNotModified {
   821  		if res.Body != nil {
   822  			res.Body.Close()
   823  		}
   824  		return nil, gensupport.WrapError(&googleapi.Error{
   825  			Code:   res.StatusCode,
   826  			Header: res.Header,
   827  		})
   828  	}
   829  	if err != nil {
   830  		return nil, err
   831  	}
   832  	defer googleapi.CloseBody(res)
   833  	if err := googleapi.CheckResponse(res); err != nil {
   834  		return nil, gensupport.WrapError(err)
   835  	}
   836  	ret := &Operation{
   837  		ServerResponse: googleapi.ServerResponse{
   838  			Header:         res.Header,
   839  			HTTPStatusCode: res.StatusCode,
   840  		},
   841  	}
   842  	target := &ret
   843  	if err := gensupport.DecodeResponse(target, res); err != nil {
   844  		return nil, err
   845  	}
   846  	return ret, nil
   847  }
   848  
   849  type ProjectsLocationsConnectorsDeleteCall struct {
   850  	s          *Service
   851  	name       string
   852  	urlParams_ gensupport.URLParams
   853  	ctx_       context.Context
   854  	header_    http.Header
   855  }
   856  
   857  // Delete: Deletes a Serverless VPC Access connector. Returns NOT_FOUND if the
   858  // resource does not exist.
   859  //
   860  // - name: Name of a Serverless VPC Access connector to delete.
   861  func (r *ProjectsLocationsConnectorsService) Delete(name string) *ProjectsLocationsConnectorsDeleteCall {
   862  	c := &ProjectsLocationsConnectorsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
   863  	c.name = name
   864  	return c
   865  }
   866  
   867  // Fields allows partial responses to be retrieved. See
   868  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
   869  // details.
   870  func (c *ProjectsLocationsConnectorsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsConnectorsDeleteCall {
   871  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
   872  	return c
   873  }
   874  
   875  // Context sets the context to be used in this call's Do method.
   876  func (c *ProjectsLocationsConnectorsDeleteCall) Context(ctx context.Context) *ProjectsLocationsConnectorsDeleteCall {
   877  	c.ctx_ = ctx
   878  	return c
   879  }
   880  
   881  // Header returns a http.Header that can be modified by the caller to add
   882  // headers to the request.
   883  func (c *ProjectsLocationsConnectorsDeleteCall) Header() http.Header {
   884  	if c.header_ == nil {
   885  		c.header_ = make(http.Header)
   886  	}
   887  	return c.header_
   888  }
   889  
   890  func (c *ProjectsLocationsConnectorsDeleteCall) doRequest(alt string) (*http.Response, error) {
   891  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
   892  	var body io.Reader = nil
   893  	c.urlParams_.Set("alt", alt)
   894  	c.urlParams_.Set("prettyPrint", "false")
   895  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
   896  	urls += "?" + c.urlParams_.Encode()
   897  	req, err := http.NewRequest("DELETE", urls, body)
   898  	if err != nil {
   899  		return nil, err
   900  	}
   901  	req.Header = reqHeaders
   902  	googleapi.Expand(req.URL, map[string]string{
   903  		"name": c.name,
   904  	})
   905  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
   906  }
   907  
   908  // Do executes the "vpcaccess.projects.locations.connectors.delete" call.
   909  // Any non-2xx status code is an error. Response headers are in either
   910  // *Operation.ServerResponse.Header or (if a response was returned at all) in
   911  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
   912  // whether the returned error was because http.StatusNotModified was returned.
   913  func (c *ProjectsLocationsConnectorsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
   914  	gensupport.SetOptions(c.urlParams_, opts...)
   915  	res, err := c.doRequest("json")
   916  	if res != nil && res.StatusCode == http.StatusNotModified {
   917  		if res.Body != nil {
   918  			res.Body.Close()
   919  		}
   920  		return nil, gensupport.WrapError(&googleapi.Error{
   921  			Code:   res.StatusCode,
   922  			Header: res.Header,
   923  		})
   924  	}
   925  	if err != nil {
   926  		return nil, err
   927  	}
   928  	defer googleapi.CloseBody(res)
   929  	if err := googleapi.CheckResponse(res); err != nil {
   930  		return nil, gensupport.WrapError(err)
   931  	}
   932  	ret := &Operation{
   933  		ServerResponse: googleapi.ServerResponse{
   934  			Header:         res.Header,
   935  			HTTPStatusCode: res.StatusCode,
   936  		},
   937  	}
   938  	target := &ret
   939  	if err := gensupport.DecodeResponse(target, res); err != nil {
   940  		return nil, err
   941  	}
   942  	return ret, nil
   943  }
   944  
   945  type ProjectsLocationsConnectorsGetCall struct {
   946  	s            *Service
   947  	name         string
   948  	urlParams_   gensupport.URLParams
   949  	ifNoneMatch_ string
   950  	ctx_         context.Context
   951  	header_      http.Header
   952  }
   953  
   954  // Get: Gets a Serverless VPC Access connector. Returns NOT_FOUND if the
   955  // resource does not exist.
   956  //
   957  // - name: Name of a Serverless VPC Access connector to get.
   958  func (r *ProjectsLocationsConnectorsService) Get(name string) *ProjectsLocationsConnectorsGetCall {
   959  	c := &ProjectsLocationsConnectorsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
   960  	c.name = name
   961  	return c
   962  }
   963  
   964  // Fields allows partial responses to be retrieved. See
   965  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
   966  // details.
   967  func (c *ProjectsLocationsConnectorsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsConnectorsGetCall {
   968  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
   969  	return c
   970  }
   971  
   972  // IfNoneMatch sets an optional parameter which makes the operation fail if the
   973  // object's ETag matches the given value. This is useful for getting updates
   974  // only after the object has changed since the last request.
   975  func (c *ProjectsLocationsConnectorsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsConnectorsGetCall {
   976  	c.ifNoneMatch_ = entityTag
   977  	return c
   978  }
   979  
   980  // Context sets the context to be used in this call's Do method.
   981  func (c *ProjectsLocationsConnectorsGetCall) Context(ctx context.Context) *ProjectsLocationsConnectorsGetCall {
   982  	c.ctx_ = ctx
   983  	return c
   984  }
   985  
   986  // Header returns a http.Header that can be modified by the caller to add
   987  // headers to the request.
   988  func (c *ProjectsLocationsConnectorsGetCall) Header() http.Header {
   989  	if c.header_ == nil {
   990  		c.header_ = make(http.Header)
   991  	}
   992  	return c.header_
   993  }
   994  
   995  func (c *ProjectsLocationsConnectorsGetCall) doRequest(alt string) (*http.Response, error) {
   996  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
   997  	if c.ifNoneMatch_ != "" {
   998  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
   999  	}
  1000  	var body io.Reader = nil
  1001  	c.urlParams_.Set("alt", alt)
  1002  	c.urlParams_.Set("prettyPrint", "false")
  1003  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  1004  	urls += "?" + c.urlParams_.Encode()
  1005  	req, err := http.NewRequest("GET", urls, body)
  1006  	if err != nil {
  1007  		return nil, err
  1008  	}
  1009  	req.Header = reqHeaders
  1010  	googleapi.Expand(req.URL, map[string]string{
  1011  		"name": c.name,
  1012  	})
  1013  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1014  }
  1015  
  1016  // Do executes the "vpcaccess.projects.locations.connectors.get" call.
  1017  // Any non-2xx status code is an error. Response headers are in either
  1018  // *Connector.ServerResponse.Header or (if a response was returned at all) in
  1019  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1020  // whether the returned error was because http.StatusNotModified was returned.
  1021  func (c *ProjectsLocationsConnectorsGetCall) Do(opts ...googleapi.CallOption) (*Connector, error) {
  1022  	gensupport.SetOptions(c.urlParams_, opts...)
  1023  	res, err := c.doRequest("json")
  1024  	if res != nil && res.StatusCode == http.StatusNotModified {
  1025  		if res.Body != nil {
  1026  			res.Body.Close()
  1027  		}
  1028  		return nil, gensupport.WrapError(&googleapi.Error{
  1029  			Code:   res.StatusCode,
  1030  			Header: res.Header,
  1031  		})
  1032  	}
  1033  	if err != nil {
  1034  		return nil, err
  1035  	}
  1036  	defer googleapi.CloseBody(res)
  1037  	if err := googleapi.CheckResponse(res); err != nil {
  1038  		return nil, gensupport.WrapError(err)
  1039  	}
  1040  	ret := &Connector{
  1041  		ServerResponse: googleapi.ServerResponse{
  1042  			Header:         res.Header,
  1043  			HTTPStatusCode: res.StatusCode,
  1044  		},
  1045  	}
  1046  	target := &ret
  1047  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1048  		return nil, err
  1049  	}
  1050  	return ret, nil
  1051  }
  1052  
  1053  type ProjectsLocationsConnectorsListCall struct {
  1054  	s            *Service
  1055  	parent       string
  1056  	urlParams_   gensupport.URLParams
  1057  	ifNoneMatch_ string
  1058  	ctx_         context.Context
  1059  	header_      http.Header
  1060  }
  1061  
  1062  // List: Lists Serverless VPC Access connectors.
  1063  //
  1064  // - parent: The project and location from which the routes should be listed.
  1065  func (r *ProjectsLocationsConnectorsService) List(parent string) *ProjectsLocationsConnectorsListCall {
  1066  	c := &ProjectsLocationsConnectorsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1067  	c.parent = parent
  1068  	return c
  1069  }
  1070  
  1071  // PageSize sets the optional parameter "pageSize": Maximum number of functions
  1072  // to return per call.
  1073  func (c *ProjectsLocationsConnectorsListCall) PageSize(pageSize int64) *ProjectsLocationsConnectorsListCall {
  1074  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  1075  	return c
  1076  }
  1077  
  1078  // PageToken sets the optional parameter "pageToken": Continuation token.
  1079  func (c *ProjectsLocationsConnectorsListCall) PageToken(pageToken string) *ProjectsLocationsConnectorsListCall {
  1080  	c.urlParams_.Set("pageToken", pageToken)
  1081  	return c
  1082  }
  1083  
  1084  // Fields allows partial responses to be retrieved. See
  1085  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1086  // details.
  1087  func (c *ProjectsLocationsConnectorsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsConnectorsListCall {
  1088  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1089  	return c
  1090  }
  1091  
  1092  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1093  // object's ETag matches the given value. This is useful for getting updates
  1094  // only after the object has changed since the last request.
  1095  func (c *ProjectsLocationsConnectorsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsConnectorsListCall {
  1096  	c.ifNoneMatch_ = entityTag
  1097  	return c
  1098  }
  1099  
  1100  // Context sets the context to be used in this call's Do method.
  1101  func (c *ProjectsLocationsConnectorsListCall) Context(ctx context.Context) *ProjectsLocationsConnectorsListCall {
  1102  	c.ctx_ = ctx
  1103  	return c
  1104  }
  1105  
  1106  // Header returns a http.Header that can be modified by the caller to add
  1107  // headers to the request.
  1108  func (c *ProjectsLocationsConnectorsListCall) Header() http.Header {
  1109  	if c.header_ == nil {
  1110  		c.header_ = make(http.Header)
  1111  	}
  1112  	return c.header_
  1113  }
  1114  
  1115  func (c *ProjectsLocationsConnectorsListCall) doRequest(alt string) (*http.Response, error) {
  1116  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1117  	if c.ifNoneMatch_ != "" {
  1118  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1119  	}
  1120  	var body io.Reader = nil
  1121  	c.urlParams_.Set("alt", alt)
  1122  	c.urlParams_.Set("prettyPrint", "false")
  1123  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/connectors")
  1124  	urls += "?" + c.urlParams_.Encode()
  1125  	req, err := http.NewRequest("GET", urls, body)
  1126  	if err != nil {
  1127  		return nil, err
  1128  	}
  1129  	req.Header = reqHeaders
  1130  	googleapi.Expand(req.URL, map[string]string{
  1131  		"parent": c.parent,
  1132  	})
  1133  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1134  }
  1135  
  1136  // Do executes the "vpcaccess.projects.locations.connectors.list" call.
  1137  // Any non-2xx status code is an error. Response headers are in either
  1138  // *ListConnectorsResponse.ServerResponse.Header or (if a response was returned
  1139  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1140  // check whether the returned error was because http.StatusNotModified was
  1141  // returned.
  1142  func (c *ProjectsLocationsConnectorsListCall) Do(opts ...googleapi.CallOption) (*ListConnectorsResponse, error) {
  1143  	gensupport.SetOptions(c.urlParams_, opts...)
  1144  	res, err := c.doRequest("json")
  1145  	if res != nil && res.StatusCode == http.StatusNotModified {
  1146  		if res.Body != nil {
  1147  			res.Body.Close()
  1148  		}
  1149  		return nil, gensupport.WrapError(&googleapi.Error{
  1150  			Code:   res.StatusCode,
  1151  			Header: res.Header,
  1152  		})
  1153  	}
  1154  	if err != nil {
  1155  		return nil, err
  1156  	}
  1157  	defer googleapi.CloseBody(res)
  1158  	if err := googleapi.CheckResponse(res); err != nil {
  1159  		return nil, gensupport.WrapError(err)
  1160  	}
  1161  	ret := &ListConnectorsResponse{
  1162  		ServerResponse: googleapi.ServerResponse{
  1163  			Header:         res.Header,
  1164  			HTTPStatusCode: res.StatusCode,
  1165  		},
  1166  	}
  1167  	target := &ret
  1168  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1169  		return nil, err
  1170  	}
  1171  	return ret, nil
  1172  }
  1173  
  1174  // Pages invokes f for each page of results.
  1175  // A non-nil error returned from f will halt the iteration.
  1176  // The provided context supersedes any context provided to the Context method.
  1177  func (c *ProjectsLocationsConnectorsListCall) Pages(ctx context.Context, f func(*ListConnectorsResponse) error) error {
  1178  	c.ctx_ = ctx
  1179  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  1180  	for {
  1181  		x, err := c.Do()
  1182  		if err != nil {
  1183  			return err
  1184  		}
  1185  		if err := f(x); err != nil {
  1186  			return err
  1187  		}
  1188  		if x.NextPageToken == "" {
  1189  			return nil
  1190  		}
  1191  		c.PageToken(x.NextPageToken)
  1192  	}
  1193  }
  1194  
  1195  type ProjectsLocationsConnectorsPatchCall struct {
  1196  	s          *Service
  1197  	name       string
  1198  	connector  *Connector
  1199  	urlParams_ gensupport.URLParams
  1200  	ctx_       context.Context
  1201  	header_    http.Header
  1202  }
  1203  
  1204  // Patch: Updates a Serverless VPC Access connector, returns an operation.
  1205  //
  1206  //   - name: The resource name in the format
  1207  //     `projects/*/locations/*/connectors/*`.
  1208  func (r *ProjectsLocationsConnectorsService) Patch(name string, connector *Connector) *ProjectsLocationsConnectorsPatchCall {
  1209  	c := &ProjectsLocationsConnectorsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1210  	c.name = name
  1211  	c.connector = connector
  1212  	return c
  1213  }
  1214  
  1215  // UpdateMask sets the optional parameter "updateMask": The fields to update on
  1216  // the entry group. If absent or empty, all modifiable fields are updated.
  1217  func (c *ProjectsLocationsConnectorsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsConnectorsPatchCall {
  1218  	c.urlParams_.Set("updateMask", updateMask)
  1219  	return c
  1220  }
  1221  
  1222  // Fields allows partial responses to be retrieved. See
  1223  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1224  // details.
  1225  func (c *ProjectsLocationsConnectorsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsConnectorsPatchCall {
  1226  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1227  	return c
  1228  }
  1229  
  1230  // Context sets the context to be used in this call's Do method.
  1231  func (c *ProjectsLocationsConnectorsPatchCall) Context(ctx context.Context) *ProjectsLocationsConnectorsPatchCall {
  1232  	c.ctx_ = ctx
  1233  	return c
  1234  }
  1235  
  1236  // Header returns a http.Header that can be modified by the caller to add
  1237  // headers to the request.
  1238  func (c *ProjectsLocationsConnectorsPatchCall) Header() http.Header {
  1239  	if c.header_ == nil {
  1240  		c.header_ = make(http.Header)
  1241  	}
  1242  	return c.header_
  1243  }
  1244  
  1245  func (c *ProjectsLocationsConnectorsPatchCall) doRequest(alt string) (*http.Response, error) {
  1246  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1247  	var body io.Reader = nil
  1248  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.connector)
  1249  	if err != nil {
  1250  		return nil, err
  1251  	}
  1252  	c.urlParams_.Set("alt", alt)
  1253  	c.urlParams_.Set("prettyPrint", "false")
  1254  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  1255  	urls += "?" + c.urlParams_.Encode()
  1256  	req, err := http.NewRequest("PATCH", urls, body)
  1257  	if err != nil {
  1258  		return nil, err
  1259  	}
  1260  	req.Header = reqHeaders
  1261  	googleapi.Expand(req.URL, map[string]string{
  1262  		"name": c.name,
  1263  	})
  1264  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1265  }
  1266  
  1267  // Do executes the "vpcaccess.projects.locations.connectors.patch" call.
  1268  // Any non-2xx status code is an error. Response headers are in either
  1269  // *Operation.ServerResponse.Header or (if a response was returned at all) in
  1270  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1271  // whether the returned error was because http.StatusNotModified was returned.
  1272  func (c *ProjectsLocationsConnectorsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  1273  	gensupport.SetOptions(c.urlParams_, opts...)
  1274  	res, err := c.doRequest("json")
  1275  	if res != nil && res.StatusCode == http.StatusNotModified {
  1276  		if res.Body != nil {
  1277  			res.Body.Close()
  1278  		}
  1279  		return nil, gensupport.WrapError(&googleapi.Error{
  1280  			Code:   res.StatusCode,
  1281  			Header: res.Header,
  1282  		})
  1283  	}
  1284  	if err != nil {
  1285  		return nil, err
  1286  	}
  1287  	defer googleapi.CloseBody(res)
  1288  	if err := googleapi.CheckResponse(res); err != nil {
  1289  		return nil, gensupport.WrapError(err)
  1290  	}
  1291  	ret := &Operation{
  1292  		ServerResponse: googleapi.ServerResponse{
  1293  			Header:         res.Header,
  1294  			HTTPStatusCode: res.StatusCode,
  1295  		},
  1296  	}
  1297  	target := &ret
  1298  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1299  		return nil, err
  1300  	}
  1301  	return ret, nil
  1302  }
  1303  
  1304  type ProjectsLocationsOperationsGetCall struct {
  1305  	s            *Service
  1306  	name         string
  1307  	urlParams_   gensupport.URLParams
  1308  	ifNoneMatch_ string
  1309  	ctx_         context.Context
  1310  	header_      http.Header
  1311  }
  1312  
  1313  // Get: Gets the latest state of a long-running operation. Clients can use this
  1314  // method to poll the operation result at intervals as recommended by the API
  1315  // service.
  1316  //
  1317  // - name: The name of the operation resource.
  1318  func (r *ProjectsLocationsOperationsService) Get(name string) *ProjectsLocationsOperationsGetCall {
  1319  	c := &ProjectsLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1320  	c.name = name
  1321  	return c
  1322  }
  1323  
  1324  // Fields allows partial responses to be retrieved. See
  1325  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1326  // details.
  1327  func (c *ProjectsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsGetCall {
  1328  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1329  	return c
  1330  }
  1331  
  1332  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1333  // object's ETag matches the given value. This is useful for getting updates
  1334  // only after the object has changed since the last request.
  1335  func (c *ProjectsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsGetCall {
  1336  	c.ifNoneMatch_ = entityTag
  1337  	return c
  1338  }
  1339  
  1340  // Context sets the context to be used in this call's Do method.
  1341  func (c *ProjectsLocationsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsOperationsGetCall {
  1342  	c.ctx_ = ctx
  1343  	return c
  1344  }
  1345  
  1346  // Header returns a http.Header that can be modified by the caller to add
  1347  // headers to the request.
  1348  func (c *ProjectsLocationsOperationsGetCall) Header() http.Header {
  1349  	if c.header_ == nil {
  1350  		c.header_ = make(http.Header)
  1351  	}
  1352  	return c.header_
  1353  }
  1354  
  1355  func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  1356  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1357  	if c.ifNoneMatch_ != "" {
  1358  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1359  	}
  1360  	var body io.Reader = nil
  1361  	c.urlParams_.Set("alt", alt)
  1362  	c.urlParams_.Set("prettyPrint", "false")
  1363  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  1364  	urls += "?" + c.urlParams_.Encode()
  1365  	req, err := http.NewRequest("GET", urls, body)
  1366  	if err != nil {
  1367  		return nil, err
  1368  	}
  1369  	req.Header = reqHeaders
  1370  	googleapi.Expand(req.URL, map[string]string{
  1371  		"name": c.name,
  1372  	})
  1373  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1374  }
  1375  
  1376  // Do executes the "vpcaccess.projects.locations.operations.get" call.
  1377  // Any non-2xx status code is an error. Response headers are in either
  1378  // *Operation.ServerResponse.Header or (if a response was returned at all) in
  1379  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1380  // whether the returned error was because http.StatusNotModified was returned.
  1381  func (c *ProjectsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  1382  	gensupport.SetOptions(c.urlParams_, opts...)
  1383  	res, err := c.doRequest("json")
  1384  	if res != nil && res.StatusCode == http.StatusNotModified {
  1385  		if res.Body != nil {
  1386  			res.Body.Close()
  1387  		}
  1388  		return nil, gensupport.WrapError(&googleapi.Error{
  1389  			Code:   res.StatusCode,
  1390  			Header: res.Header,
  1391  		})
  1392  	}
  1393  	if err != nil {
  1394  		return nil, err
  1395  	}
  1396  	defer googleapi.CloseBody(res)
  1397  	if err := googleapi.CheckResponse(res); err != nil {
  1398  		return nil, gensupport.WrapError(err)
  1399  	}
  1400  	ret := &Operation{
  1401  		ServerResponse: googleapi.ServerResponse{
  1402  			Header:         res.Header,
  1403  			HTTPStatusCode: res.StatusCode,
  1404  		},
  1405  	}
  1406  	target := &ret
  1407  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1408  		return nil, err
  1409  	}
  1410  	return ret, nil
  1411  }
  1412  
  1413  type ProjectsLocationsOperationsListCall struct {
  1414  	s            *Service
  1415  	name         string
  1416  	urlParams_   gensupport.URLParams
  1417  	ifNoneMatch_ string
  1418  	ctx_         context.Context
  1419  	header_      http.Header
  1420  }
  1421  
  1422  // List: Lists operations that match the specified filter in the request. If
  1423  // the server doesn't support this method, it returns `UNIMPLEMENTED`.
  1424  //
  1425  // - name: The name of the operation's parent resource.
  1426  func (r *ProjectsLocationsOperationsService) List(name string) *ProjectsLocationsOperationsListCall {
  1427  	c := &ProjectsLocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1428  	c.name = name
  1429  	return c
  1430  }
  1431  
  1432  // Filter sets the optional parameter "filter": The standard list filter.
  1433  func (c *ProjectsLocationsOperationsListCall) Filter(filter string) *ProjectsLocationsOperationsListCall {
  1434  	c.urlParams_.Set("filter", filter)
  1435  	return c
  1436  }
  1437  
  1438  // PageSize sets the optional parameter "pageSize": The standard list page
  1439  // size.
  1440  func (c *ProjectsLocationsOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsOperationsListCall {
  1441  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  1442  	return c
  1443  }
  1444  
  1445  // PageToken sets the optional parameter "pageToken": The standard list page
  1446  // token.
  1447  func (c *ProjectsLocationsOperationsListCall) PageToken(pageToken string) *ProjectsLocationsOperationsListCall {
  1448  	c.urlParams_.Set("pageToken", pageToken)
  1449  	return c
  1450  }
  1451  
  1452  // Fields allows partial responses to be retrieved. See
  1453  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1454  // details.
  1455  func (c *ProjectsLocationsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsListCall {
  1456  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1457  	return c
  1458  }
  1459  
  1460  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1461  // object's ETag matches the given value. This is useful for getting updates
  1462  // only after the object has changed since the last request.
  1463  func (c *ProjectsLocationsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsListCall {
  1464  	c.ifNoneMatch_ = entityTag
  1465  	return c
  1466  }
  1467  
  1468  // Context sets the context to be used in this call's Do method.
  1469  func (c *ProjectsLocationsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsOperationsListCall {
  1470  	c.ctx_ = ctx
  1471  	return c
  1472  }
  1473  
  1474  // Header returns a http.Header that can be modified by the caller to add
  1475  // headers to the request.
  1476  func (c *ProjectsLocationsOperationsListCall) Header() http.Header {
  1477  	if c.header_ == nil {
  1478  		c.header_ = make(http.Header)
  1479  	}
  1480  	return c.header_
  1481  }
  1482  
  1483  func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Response, error) {
  1484  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1485  	if c.ifNoneMatch_ != "" {
  1486  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1487  	}
  1488  	var body io.Reader = nil
  1489  	c.urlParams_.Set("alt", alt)
  1490  	c.urlParams_.Set("prettyPrint", "false")
  1491  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations")
  1492  	urls += "?" + c.urlParams_.Encode()
  1493  	req, err := http.NewRequest("GET", urls, body)
  1494  	if err != nil {
  1495  		return nil, err
  1496  	}
  1497  	req.Header = reqHeaders
  1498  	googleapi.Expand(req.URL, map[string]string{
  1499  		"name": c.name,
  1500  	})
  1501  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1502  }
  1503  
  1504  // Do executes the "vpcaccess.projects.locations.operations.list" call.
  1505  // Any non-2xx status code is an error. Response headers are in either
  1506  // *ListOperationsResponse.ServerResponse.Header or (if a response was returned
  1507  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1508  // check whether the returned error was because http.StatusNotModified was
  1509  // returned.
  1510  func (c *ProjectsLocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) {
  1511  	gensupport.SetOptions(c.urlParams_, opts...)
  1512  	res, err := c.doRequest("json")
  1513  	if res != nil && res.StatusCode == http.StatusNotModified {
  1514  		if res.Body != nil {
  1515  			res.Body.Close()
  1516  		}
  1517  		return nil, gensupport.WrapError(&googleapi.Error{
  1518  			Code:   res.StatusCode,
  1519  			Header: res.Header,
  1520  		})
  1521  	}
  1522  	if err != nil {
  1523  		return nil, err
  1524  	}
  1525  	defer googleapi.CloseBody(res)
  1526  	if err := googleapi.CheckResponse(res); err != nil {
  1527  		return nil, gensupport.WrapError(err)
  1528  	}
  1529  	ret := &ListOperationsResponse{
  1530  		ServerResponse: googleapi.ServerResponse{
  1531  			Header:         res.Header,
  1532  			HTTPStatusCode: res.StatusCode,
  1533  		},
  1534  	}
  1535  	target := &ret
  1536  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1537  		return nil, err
  1538  	}
  1539  	return ret, nil
  1540  }
  1541  
  1542  // Pages invokes f for each page of results.
  1543  // A non-nil error returned from f will halt the iteration.
  1544  // The provided context supersedes any context provided to the Context method.
  1545  func (c *ProjectsLocationsOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error {
  1546  	c.ctx_ = ctx
  1547  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  1548  	for {
  1549  		x, err := c.Do()
  1550  		if err != nil {
  1551  			return err
  1552  		}
  1553  		if err := f(x); err != nil {
  1554  			return err
  1555  		}
  1556  		if x.NextPageToken == "" {
  1557  			return nil
  1558  		}
  1559  		c.PageToken(x.NextPageToken)
  1560  	}
  1561  }
  1562  

View as plain text