...

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

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

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

View as plain text