...

Source file src/google.golang.org/api/networkconnectivity/v1alpha1/networkconnectivity-gen.go

Documentation: google.golang.org/api/networkconnectivity/v1alpha1

     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 networkconnectivity provides access to the Network Connectivity API.
     8  //
     9  // For product documentation, see: https://cloud.google.com/network-connectivity/docs/reference/networkconnectivity/rest
    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/networkconnectivity/v1alpha1"
    27  //	...
    28  //	ctx := context.Background()
    29  //	networkconnectivityService, err := networkconnectivity.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  //	networkconnectivityService, err := networkconnectivity.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  //	networkconnectivityService, err := networkconnectivity.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
    49  //
    50  // See [google.golang.org/api/option.ClientOption] for details on options.
    51  package networkconnectivity // import "google.golang.org/api/networkconnectivity/v1alpha1"
    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 = "networkconnectivity:v1alpha1"
    90  const apiName = "networkconnectivity"
    91  const apiVersion = "v1alpha1"
    92  const basePath = "https://networkconnectivity.googleapis.com/"
    93  const basePathTemplate = "https://networkconnectivity.UNIVERSE_DOMAIN/"
    94  const mtlsBasePath = "https://networkconnectivity.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.Global = NewProjectsLocationsGlobalService(s)
   172  	rs.InternalRanges = NewProjectsLocationsInternalRangesService(s)
   173  	rs.Operations = NewProjectsLocationsOperationsService(s)
   174  	rs.Spokes = NewProjectsLocationsSpokesService(s)
   175  	return rs
   176  }
   177  
   178  type ProjectsLocationsService struct {
   179  	s *Service
   180  
   181  	Global *ProjectsLocationsGlobalService
   182  
   183  	InternalRanges *ProjectsLocationsInternalRangesService
   184  
   185  	Operations *ProjectsLocationsOperationsService
   186  
   187  	Spokes *ProjectsLocationsSpokesService
   188  }
   189  
   190  func NewProjectsLocationsGlobalService(s *Service) *ProjectsLocationsGlobalService {
   191  	rs := &ProjectsLocationsGlobalService{s: s}
   192  	rs.Hubs = NewProjectsLocationsGlobalHubsService(s)
   193  	return rs
   194  }
   195  
   196  type ProjectsLocationsGlobalService struct {
   197  	s *Service
   198  
   199  	Hubs *ProjectsLocationsGlobalHubsService
   200  }
   201  
   202  func NewProjectsLocationsGlobalHubsService(s *Service) *ProjectsLocationsGlobalHubsService {
   203  	rs := &ProjectsLocationsGlobalHubsService{s: s}
   204  	return rs
   205  }
   206  
   207  type ProjectsLocationsGlobalHubsService struct {
   208  	s *Service
   209  }
   210  
   211  func NewProjectsLocationsInternalRangesService(s *Service) *ProjectsLocationsInternalRangesService {
   212  	rs := &ProjectsLocationsInternalRangesService{s: s}
   213  	return rs
   214  }
   215  
   216  type ProjectsLocationsInternalRangesService struct {
   217  	s *Service
   218  }
   219  
   220  func NewProjectsLocationsOperationsService(s *Service) *ProjectsLocationsOperationsService {
   221  	rs := &ProjectsLocationsOperationsService{s: s}
   222  	return rs
   223  }
   224  
   225  type ProjectsLocationsOperationsService struct {
   226  	s *Service
   227  }
   228  
   229  func NewProjectsLocationsSpokesService(s *Service) *ProjectsLocationsSpokesService {
   230  	rs := &ProjectsLocationsSpokesService{s: s}
   231  	return rs
   232  }
   233  
   234  type ProjectsLocationsSpokesService struct {
   235  	s *Service
   236  }
   237  
   238  // AuditConfig: Specifies the audit configuration for a service. The
   239  // configuration determines which permission types are logged, and what
   240  // identities, if any, are exempted from logging. An AuditConfig must have one
   241  // or more AuditLogConfigs. If there are AuditConfigs for both `allServices`
   242  // and a specific service, the union of the two AuditConfigs is used for that
   243  // service: the log_types specified in each AuditConfig are enabled, and the
   244  // exempted_members in each AuditLogConfig are exempted. Example Policy with
   245  // multiple AuditConfigs: { "audit_configs": [ { "service": "allServices",
   246  // "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [
   247  // "user:jose@example.com" ] }, { "log_type": "DATA_WRITE" }, { "log_type":
   248  // "ADMIN_READ" } ] }, { "service": "sampleservice.googleapis.com",
   249  // "audit_log_configs": [ { "log_type": "DATA_READ" }, { "log_type":
   250  // "DATA_WRITE", "exempted_members": [ "user:aliya@example.com" ] } ] } ] } For
   251  // sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ
   252  // logging. It also exempts `jose@example.com` from DATA_READ logging, and
   253  // `aliya@example.com` from DATA_WRITE logging.
   254  type AuditConfig struct {
   255  	// AuditLogConfigs: The configuration for logging of each type of permission.
   256  	AuditLogConfigs []*AuditLogConfig `json:"auditLogConfigs,omitempty"`
   257  	// Service: Specifies a service that will be enabled for audit logging. For
   258  	// example, `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices`
   259  	// is a special value that covers all services.
   260  	Service string `json:"service,omitempty"`
   261  	// ForceSendFields is a list of field names (e.g. "AuditLogConfigs") to
   262  	// unconditionally include in API requests. By default, fields with empty or
   263  	// default values are omitted from API requests. See
   264  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   265  	// details.
   266  	ForceSendFields []string `json:"-"`
   267  	// NullFields is a list of field names (e.g. "AuditLogConfigs") to include in
   268  	// API requests with the JSON null value. By default, fields with empty values
   269  	// are omitted from API requests. See
   270  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   271  	NullFields []string `json:"-"`
   272  }
   273  
   274  func (s *AuditConfig) MarshalJSON() ([]byte, error) {
   275  	type NoMethod AuditConfig
   276  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   277  }
   278  
   279  // AuditLogConfig: Provides the configuration for logging a type of
   280  // permissions. Example: { "audit_log_configs": [ { "log_type": "DATA_READ",
   281  // "exempted_members": [ "user:jose@example.com" ] }, { "log_type":
   282  // "DATA_WRITE" } ] } This enables 'DATA_READ' and 'DATA_WRITE' logging, while
   283  // exempting jose@example.com from DATA_READ logging.
   284  type AuditLogConfig struct {
   285  	// ExemptedMembers: Specifies the identities that do not cause logging for this
   286  	// type of permission. Follows the same format of Binding.members.
   287  	ExemptedMembers []string `json:"exemptedMembers,omitempty"`
   288  	// LogType: The log type that this config enables.
   289  	//
   290  	// Possible values:
   291  	//   "LOG_TYPE_UNSPECIFIED" - Default case. Should never be this.
   292  	//   "ADMIN_READ" - Admin reads. Example: CloudIAM getIamPolicy
   293  	//   "DATA_WRITE" - Data writes. Example: CloudSQL Users create
   294  	//   "DATA_READ" - Data reads. Example: CloudSQL Users list
   295  	LogType string `json:"logType,omitempty"`
   296  	// ForceSendFields is a list of field names (e.g. "ExemptedMembers") to
   297  	// unconditionally include in API requests. By default, fields with empty or
   298  	// default values are omitted from API requests. See
   299  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   300  	// details.
   301  	ForceSendFields []string `json:"-"`
   302  	// NullFields is a list of field names (e.g. "ExemptedMembers") to include in
   303  	// API requests with the JSON null value. By default, fields with empty values
   304  	// are omitted from API requests. See
   305  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   306  	NullFields []string `json:"-"`
   307  }
   308  
   309  func (s *AuditLogConfig) MarshalJSON() ([]byte, error) {
   310  	type NoMethod AuditLogConfig
   311  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   312  }
   313  
   314  // Binding: Associates `members`, or principals, with a `role`.
   315  type Binding struct {
   316  	// Condition: The condition that is associated with this binding. If the
   317  	// condition evaluates to `true`, then this binding applies to the current
   318  	// request. If the condition evaluates to `false`, then this binding does not
   319  	// apply to the current request. However, a different role binding might grant
   320  	// the same role to one or more of the principals in this binding. To learn
   321  	// which resources support conditions in their IAM policies, see the IAM
   322  	// documentation
   323  	// (https://cloud.google.com/iam/help/conditions/resource-policies).
   324  	Condition *Expr `json:"condition,omitempty"`
   325  	// Members: Specifies the principals requesting access for a Google Cloud
   326  	// resource. `members` can have the following values: * `allUsers`: A special
   327  	// identifier that represents anyone who is on the internet; with or without a
   328  	// Google account. * `allAuthenticatedUsers`: A special identifier that
   329  	// represents anyone who is authenticated with a Google account or a service
   330  	// account. Does not include identities that come from external identity
   331  	// providers (IdPs) through identity federation. * `user:{emailid}`: An email
   332  	// address that represents a specific Google account. For example,
   333  	// `alice@example.com` . * `serviceAccount:{emailid}`: An email address that
   334  	// represents a Google service account. For example,
   335  	// `my-other-app@appspot.gserviceaccount.com`. *
   336  	// `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: An
   337  	// identifier for a Kubernetes service account
   338  	// (https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts).
   339  	// For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. *
   340  	// `group:{emailid}`: An email address that represents a Google group. For
   341  	// example, `admins@example.com`. * `domain:{domain}`: The G Suite domain
   342  	// (primary) that represents all the users of that domain. For example,
   343  	// `google.com` or `example.com`. *
   344  	// `principal://iam.googleapis.com/locations/global/workforcePools/{pool_id}/sub
   345  	// ject/{subject_attribute_value}`: A single identity in a workforce identity
   346  	// pool. *
   347  	// `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/
   348  	// group/{group_id}`: All workforce identities in a group. *
   349  	// `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/
   350  	// attribute.{attribute_name}/{attribute_value}`: All workforce identities with
   351  	// a specific attribute value. *
   352  	// `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/
   353  	// *`: All identities in a workforce identity pool. *
   354  	// `principal://iam.googleapis.com/projects/{project_number}/locations/global/wo
   355  	// rkloadIdentityPools/{pool_id}/subject/{subject_attribute_value}`: A single
   356  	// identity in a workload identity pool. *
   357  	// `principalSet://iam.googleapis.com/projects/{project_number}/locations/global
   358  	// /workloadIdentityPools/{pool_id}/group/{group_id}`: A workload identity pool
   359  	// group. *
   360  	// `principalSet://iam.googleapis.com/projects/{project_number}/locations/global
   361  	// /workloadIdentityPools/{pool_id}/attribute.{attribute_name}/{attribute_value}
   362  	// `: All identities in a workload identity pool with a certain attribute. *
   363  	// `principalSet://iam.googleapis.com/projects/{project_number}/locations/global
   364  	// /workloadIdentityPools/{pool_id}/*`: All identities in a workload identity
   365  	// pool. * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus
   366  	// unique identifier) representing a user that has been recently deleted. For
   367  	// example, `alice@example.com?uid=123456789012345678901`. If the user is
   368  	// recovered, this value reverts to `user:{emailid}` and the recovered user
   369  	// retains the role in the binding. *
   370  	// `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus
   371  	// unique identifier) representing a service account that has been recently
   372  	// deleted. For example,
   373  	// `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the
   374  	// service account is undeleted, this value reverts to
   375  	// `serviceAccount:{emailid}` and the undeleted service account retains the
   376  	// role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email
   377  	// address (plus unique identifier) representing a Google group that has been
   378  	// recently deleted. For example,
   379  	// `admins@example.com?uid=123456789012345678901`. If the group is recovered,
   380  	// this value reverts to `group:{emailid}` and the recovered group retains the
   381  	// role in the binding. *
   382  	// `deleted:principal://iam.googleapis.com/locations/global/workforcePools/{pool
   383  	// _id}/subject/{subject_attribute_value}`: Deleted single identity in a
   384  	// workforce identity pool. For example,
   385  	// `deleted:principal://iam.googleapis.com/locations/global/workforcePools/my-po
   386  	// ol-id/subject/my-subject-attribute-value`.
   387  	Members []string `json:"members,omitempty"`
   388  	// Role: Role that is assigned to the list of `members`, or principals. For
   389  	// example, `roles/viewer`, `roles/editor`, or `roles/owner`. For an overview
   390  	// of the IAM roles and permissions, see the IAM documentation
   391  	// (https://cloud.google.com/iam/docs/roles-overview). For a list of the
   392  	// available pre-defined roles, see here
   393  	// (https://cloud.google.com/iam/docs/understanding-roles).
   394  	Role string `json:"role,omitempty"`
   395  	// ForceSendFields is a list of field names (e.g. "Condition") to
   396  	// unconditionally include in API requests. By default, fields with empty or
   397  	// default values are omitted from API requests. See
   398  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   399  	// details.
   400  	ForceSendFields []string `json:"-"`
   401  	// NullFields is a list of field names (e.g. "Condition") to include in API
   402  	// requests with the JSON null value. By default, fields with empty values are
   403  	// omitted from API requests. See
   404  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   405  	NullFields []string `json:"-"`
   406  }
   407  
   408  func (s *Binding) MarshalJSON() ([]byte, error) {
   409  	type NoMethod Binding
   410  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   411  }
   412  
   413  // Empty: A generic empty message that you can re-use to avoid defining
   414  // duplicated empty messages in your APIs. A typical example is to use it as
   415  // the request or the response type of an API method. For instance: service Foo
   416  // { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }
   417  type Empty struct {
   418  	// ServerResponse contains the HTTP response code and headers from the server.
   419  	googleapi.ServerResponse `json:"-"`
   420  }
   421  
   422  // Expr: Represents a textual expression in the Common Expression Language
   423  // (CEL) syntax. CEL is a C-like expression language. The syntax and semantics
   424  // of CEL are documented at https://github.com/google/cel-spec. Example
   425  // (Comparison): title: "Summary size limit" description: "Determines if a
   426  // summary is less than 100 chars" expression: "document.summary.size() < 100"
   427  // Example (Equality): title: "Requestor is owner" description: "Determines if
   428  // requestor is the document owner" expression: "document.owner ==
   429  // request.auth.claims.email" Example (Logic): title: "Public documents"
   430  // description: "Determine whether the document should be publicly visible"
   431  // expression: "document.type != 'private' && document.type != 'internal'"
   432  // Example (Data Manipulation): title: "Notification string" description:
   433  // "Create a notification string with a timestamp." expression: "'New message
   434  // received at ' + string(document.create_time)" The exact variables and
   435  // functions that may be referenced within an expression are determined by the
   436  // service that evaluates it. See the service documentation for additional
   437  // information.
   438  type Expr struct {
   439  	// Description: Optional. Description of the expression. This is a longer text
   440  	// which describes the expression, e.g. when hovered over it in a UI.
   441  	Description string `json:"description,omitempty"`
   442  	// Expression: Textual representation of an expression in Common Expression
   443  	// Language syntax.
   444  	Expression string `json:"expression,omitempty"`
   445  	// Location: Optional. String indicating the location of the expression for
   446  	// error reporting, e.g. a file name and a position in the file.
   447  	Location string `json:"location,omitempty"`
   448  	// Title: Optional. Title for the expression, i.e. a short string describing
   449  	// its purpose. This can be used e.g. in UIs which allow to enter the
   450  	// expression.
   451  	Title string `json:"title,omitempty"`
   452  	// ForceSendFields is a list of field names (e.g. "Description") to
   453  	// unconditionally include in API requests. By default, fields with empty or
   454  	// default values are omitted from API requests. See
   455  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   456  	// details.
   457  	ForceSendFields []string `json:"-"`
   458  	// NullFields is a list of field names (e.g. "Description") to include in API
   459  	// requests with the JSON null value. By default, fields with empty values are
   460  	// omitted from API requests. See
   461  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   462  	NullFields []string `json:"-"`
   463  }
   464  
   465  func (s *Expr) MarshalJSON() ([]byte, error) {
   466  	type NoMethod Expr
   467  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   468  }
   469  
   470  // GoogleLongrunningCancelOperationRequest: The request message for
   471  // Operations.CancelOperation.
   472  type GoogleLongrunningCancelOperationRequest struct {
   473  }
   474  
   475  // GoogleLongrunningListOperationsResponse: The response message for
   476  // Operations.ListOperations.
   477  type GoogleLongrunningListOperationsResponse struct {
   478  	// NextPageToken: The standard List next-page token.
   479  	NextPageToken string `json:"nextPageToken,omitempty"`
   480  	// Operations: A list of operations that matches the specified filter in the
   481  	// request.
   482  	Operations []*GoogleLongrunningOperation `json:"operations,omitempty"`
   483  
   484  	// ServerResponse contains the HTTP response code and headers from the server.
   485  	googleapi.ServerResponse `json:"-"`
   486  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
   487  	// unconditionally include in API requests. By default, fields with empty or
   488  	// default values are omitted from API requests. See
   489  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   490  	// details.
   491  	ForceSendFields []string `json:"-"`
   492  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
   493  	// requests with the JSON null value. By default, fields with empty values are
   494  	// omitted from API requests. See
   495  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   496  	NullFields []string `json:"-"`
   497  }
   498  
   499  func (s *GoogleLongrunningListOperationsResponse) MarshalJSON() ([]byte, error) {
   500  	type NoMethod GoogleLongrunningListOperationsResponse
   501  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   502  }
   503  
   504  // GoogleLongrunningOperation: This resource represents a long-running
   505  // operation that is the result of a network API call.
   506  type GoogleLongrunningOperation struct {
   507  	// Done: If the value is `false`, it means the operation is still in progress.
   508  	// If `true`, the operation is completed, and either `error` or `response` is
   509  	// available.
   510  	Done bool `json:"done,omitempty"`
   511  	// Error: The error result of the operation in case of failure or cancellation.
   512  	Error *GoogleRpcStatus `json:"error,omitempty"`
   513  	// Metadata: Service-specific metadata associated with the operation. It
   514  	// typically contains progress information and common metadata such as create
   515  	// time. Some services might not provide such metadata. Any method that returns
   516  	// a long-running operation should document the metadata type, if any.
   517  	Metadata googleapi.RawMessage `json:"metadata,omitempty"`
   518  	// Name: The server-assigned name, which is only unique within the same service
   519  	// that originally returns it. If you use the default HTTP mapping, the `name`
   520  	// should be a resource name ending with `operations/{unique_id}`.
   521  	Name string `json:"name,omitempty"`
   522  	// Response: The normal, successful response of the operation. If the original
   523  	// method returns no data on success, such as `Delete`, the response is
   524  	// `google.protobuf.Empty`. If the original method is standard
   525  	// `Get`/`Create`/`Update`, the response should be the resource. For other
   526  	// methods, the response should have the type `XxxResponse`, where `Xxx` is the
   527  	// original method name. For example, if the original method name is
   528  	// `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
   529  	Response googleapi.RawMessage `json:"response,omitempty"`
   530  
   531  	// ServerResponse contains the HTTP response code and headers from the server.
   532  	googleapi.ServerResponse `json:"-"`
   533  	// ForceSendFields is a list of field names (e.g. "Done") to unconditionally
   534  	// include in API requests. By default, fields with empty or default values are
   535  	// omitted from API requests. See
   536  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   537  	// details.
   538  	ForceSendFields []string `json:"-"`
   539  	// NullFields is a list of field names (e.g. "Done") to include in API requests
   540  	// with the JSON null value. By default, fields with empty values are omitted
   541  	// from API requests. See
   542  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   543  	NullFields []string `json:"-"`
   544  }
   545  
   546  func (s *GoogleLongrunningOperation) MarshalJSON() ([]byte, error) {
   547  	type NoMethod GoogleLongrunningOperation
   548  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   549  }
   550  
   551  // GoogleRpcStatus: The `Status` type defines a logical error model that is
   552  // suitable for different programming environments, including REST APIs and RPC
   553  // APIs. It is used by gRPC (https://github.com/grpc). Each `Status` message
   554  // contains three pieces of data: error code, error message, and error details.
   555  // You can find out more about this error model and how to work with it in the
   556  // API Design Guide (https://cloud.google.com/apis/design/errors).
   557  type GoogleRpcStatus struct {
   558  	// Code: The status code, which should be an enum value of google.rpc.Code.
   559  	Code int64 `json:"code,omitempty"`
   560  	// Details: A list of messages that carry the error details. There is a common
   561  	// set of message types for APIs to use.
   562  	Details []googleapi.RawMessage `json:"details,omitempty"`
   563  	// Message: A developer-facing error message, which should be in English. Any
   564  	// user-facing error message should be localized and sent in the
   565  	// google.rpc.Status.details field, or localized by the client.
   566  	Message string `json:"message,omitempty"`
   567  	// ForceSendFields is a list of field names (e.g. "Code") to unconditionally
   568  	// include in API requests. By default, fields with empty or default values are
   569  	// omitted from API requests. See
   570  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   571  	// details.
   572  	ForceSendFields []string `json:"-"`
   573  	// NullFields is a list of field names (e.g. "Code") to include in API requests
   574  	// with the JSON null value. By default, fields with empty values are omitted
   575  	// from API requests. See
   576  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   577  	NullFields []string `json:"-"`
   578  }
   579  
   580  func (s *GoogleRpcStatus) MarshalJSON() ([]byte, error) {
   581  	type NoMethod GoogleRpcStatus
   582  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   583  }
   584  
   585  // Hub: Network Connectivity Center is a hub-and-spoke abstraction for network
   586  // connectivity management in Google Cloud. It reduces operational complexity
   587  // through a simple, centralized connectivity management model. Following is
   588  // the resource message of a hub.
   589  type Hub struct {
   590  	// CreateTime: Time when the Hub was created.
   591  	CreateTime string `json:"createTime,omitempty"`
   592  	// Description: Short description of the hub resource.
   593  	Description string `json:"description,omitempty"`
   594  	// Labels: User-defined labels.
   595  	Labels map[string]string `json:"labels,omitempty"`
   596  	// Name: Immutable. The name of a Hub resource.
   597  	Name string `json:"name,omitempty"`
   598  	// Spokes: Output only. A list of the URIs of all attached spokes. This field
   599  	// is deprecated and will not be included in future API versions. Call
   600  	// ListSpokes on each region instead.
   601  	Spokes []string `json:"spokes,omitempty"`
   602  	// State: Output only. The current lifecycle state of this Hub.
   603  	//
   604  	// Possible values:
   605  	//   "STATE_UNSPECIFIED" - No state information available
   606  	//   "CREATING" - The resource's create operation is in progress
   607  	//   "ACTIVE" - The resource is active
   608  	//   "DELETING" - The resource's Delete operation is in progress
   609  	//   "UPDATING" - The resource's Update operation is in progress
   610  	State string `json:"state,omitempty"`
   611  	// UniqueId: Output only. Google-generated UUID for this resource. This is
   612  	// unique across all Hub resources. If a Hub resource is deleted and another
   613  	// with the same name is created, it gets a different unique_id.
   614  	UniqueId string `json:"uniqueId,omitempty"`
   615  	// UpdateTime: Time when the Hub was updated.
   616  	UpdateTime string `json:"updateTime,omitempty"`
   617  
   618  	// ServerResponse contains the HTTP response code and headers from the server.
   619  	googleapi.ServerResponse `json:"-"`
   620  	// ForceSendFields is a list of field names (e.g. "CreateTime") to
   621  	// unconditionally include in API requests. By default, fields with empty or
   622  	// default values are omitted from API requests. See
   623  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   624  	// details.
   625  	ForceSendFields []string `json:"-"`
   626  	// NullFields is a list of field names (e.g. "CreateTime") to include in API
   627  	// requests with the JSON null value. By default, fields with empty values are
   628  	// omitted from API requests. See
   629  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   630  	NullFields []string `json:"-"`
   631  }
   632  
   633  func (s *Hub) MarshalJSON() ([]byte, error) {
   634  	type NoMethod Hub
   635  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   636  }
   637  
   638  // InternalRange: The internal range resource for IPAM operations within a VPC
   639  // network. Used to represent a private address range along with behavioral
   640  // characterstics of that range (its usage and peering behavior). Networking
   641  // resources can link to this range if they are created as belonging to it.
   642  type InternalRange struct {
   643  	// CreateTime: Time when the internal range was created.
   644  	CreateTime string `json:"createTime,omitempty"`
   645  	// Description: A description of this resource.
   646  	Description string `json:"description,omitempty"`
   647  	// IpCidrRange: IP range that this internal range defines.
   648  	IpCidrRange string `json:"ipCidrRange,omitempty"`
   649  	// Labels: User-defined labels.
   650  	Labels map[string]string `json:"labels,omitempty"`
   651  	// Name: Immutable. The name of an internal range. Format:
   652  	// projects/{project}/locations/{location}/internalRanges/{internal_range} See:
   653  	// https://google.aip.dev/122#fields-representing-resource-names
   654  	Name string `json:"name,omitempty"`
   655  	// Network: The URL or resource ID of the network in which to reserve the
   656  	// internal range. The network cannot be deleted if there are any reserved
   657  	// internal ranges referring to it. Legacy networks are not supported. For
   658  	// example:
   659  	// https://www.googleapis.com/compute/v1/projects/{project}/locations/global/networks/{network}
   660  	// projects/{project}/locations/global/networks/{network} {network}
   661  	Network string `json:"network,omitempty"`
   662  	// Overlaps: Optional. Types of resources that are allowed to overlap with the
   663  	// current internal range.
   664  	//
   665  	// Possible values:
   666  	//   "OVERLAP_UNSPECIFIED" - No overlap overrides.
   667  	//   "OVERLAP_ROUTE_RANGE" - Allow creation of static routes more specific than
   668  	// the current internal range.
   669  	//   "OVERLAP_EXISTING_SUBNET_RANGE" - Allow creation of internal ranges that
   670  	// overlap with existing subnets.
   671  	Overlaps []string `json:"overlaps,omitempty"`
   672  	// Peering: The type of peering set for this internal range.
   673  	//
   674  	// Possible values:
   675  	//   "PEERING_UNSPECIFIED" - If Peering is left unspecified in
   676  	// CreateInternalRange or UpdateInternalRange, it will be defaulted to
   677  	// FOR_SELF.
   678  	//   "FOR_SELF" - This is the default behavior and represents the case that
   679  	// this internal range is intended to be used in the VPC in which it is created
   680  	// and is accessible from its peers. This implies that peers or peers-of-peers
   681  	// cannot use this range.
   682  	//   "FOR_PEER" - This behavior can be set when the internal range is being
   683  	// reserved for usage by the peers. This means that no resource within the VPC
   684  	// in which it is being created can use this to associate with a VPC resource,
   685  	// but one of the peers can. This represents donating a range for peers to use.
   686  	//   "NOT_SHARED" - This behavior can be set when the internal range is being
   687  	// reserved for usage by the VPC in which it is created but not shared with the
   688  	// peers. In a sense it is local to the VPC. This can be used to create
   689  	// internal ranges for various purposes like HTTP_INTERNAL_LOAD_BALANCER or for
   690  	// Interconnect routes that are not shared with peers. This also implies that
   691  	// peers cannot use this range in a way that is visible to this VPC, but can
   692  	// re-use this range as long as it is NOT_SHARED from the peer VPC, too.
   693  	Peering string `json:"peering,omitempty"`
   694  	// PrefixLength: An alternative to ip_cidr_range. Can be set when trying to
   695  	// create a reservation that automatically finds a free range of the given
   696  	// size. If both ip_cidr_range and prefix_length are set, there is an error if
   697  	// the range sizes do not match. Can also be used during updates to change the
   698  	// range size.
   699  	PrefixLength int64 `json:"prefixLength,omitempty"`
   700  	// TargetCidrRange: Optional. Can be set to narrow down or pick a different
   701  	// address space while searching for a free range. If not set, defaults to the
   702  	// "10.0.0.0/8" address space. This can be used to search in other rfc-1918
   703  	// address spaces like "172.16.0.0/12" and "192.168.0.0/16" or non-rfc-1918
   704  	// address spaces used in the VPC.
   705  	TargetCidrRange []string `json:"targetCidrRange,omitempty"`
   706  	// UpdateTime: Time when the internal range was updated.
   707  	UpdateTime string `json:"updateTime,omitempty"`
   708  	// Usage: The type of usage set for this internal range.
   709  	//
   710  	// Possible values:
   711  	//   "USAGE_UNSPECIFIED" - Unspecified usage is allowed in calls which identify
   712  	// the resource by other fields and do not need Usage set to complete. These
   713  	// are, i.e.: GetInternalRange and DeleteInternalRange. Usage needs to be
   714  	// specified explicitly in CreateInternalRange or UpdateInternalRange calls.
   715  	//   "FOR_VPC" - A VPC resource can use the reserved CIDR block by associating
   716  	// it with the internal range resource if usage is set to FOR_VPC.
   717  	//   "EXTERNAL_TO_VPC" - Ranges created with EXTERNAL_TO_VPC cannot be
   718  	// associated with VPC resources and are meant to block out address ranges for
   719  	// various use cases such as usage on-premises, with dynamic route
   720  	// announcements via Interconnect.
   721  	Usage string `json:"usage,omitempty"`
   722  	// Users: Output only. The list of resources that refer to this internal range.
   723  	// Resources that use the internal range for their range allocation are
   724  	// referred to as users of the range. Other resources mark themselves as users
   725  	// while doing so by creating a reference to this internal range. Having a
   726  	// user, based on this reference, prevents deletion of the internal range that
   727  	// is referred to. Can be empty.
   728  	Users []string `json:"users,omitempty"`
   729  
   730  	// ServerResponse contains the HTTP response code and headers from the server.
   731  	googleapi.ServerResponse `json:"-"`
   732  	// ForceSendFields is a list of field names (e.g. "CreateTime") to
   733  	// unconditionally include in API requests. By default, fields with empty or
   734  	// default values are omitted from API requests. See
   735  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   736  	// details.
   737  	ForceSendFields []string `json:"-"`
   738  	// NullFields is a list of field names (e.g. "CreateTime") to include in API
   739  	// requests with the JSON null value. By default, fields with empty values are
   740  	// omitted from API requests. See
   741  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   742  	NullFields []string `json:"-"`
   743  }
   744  
   745  func (s *InternalRange) MarshalJSON() ([]byte, error) {
   746  	type NoMethod InternalRange
   747  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   748  }
   749  
   750  // ListHubsResponse: Response for HubService.ListHubs method.
   751  type ListHubsResponse struct {
   752  	// Hubs: Hubs to be returned.
   753  	Hubs []*Hub `json:"hubs,omitempty"`
   754  	// NextPageToken: The next pagination token in the List response. It should be
   755  	// used as page_token for the following request. An empty value means no more
   756  	// result.
   757  	NextPageToken string `json:"nextPageToken,omitempty"`
   758  	// Unreachable: Locations that could not be reached.
   759  	Unreachable []string `json:"unreachable,omitempty"`
   760  
   761  	// ServerResponse contains the HTTP response code and headers from the server.
   762  	googleapi.ServerResponse `json:"-"`
   763  	// ForceSendFields is a list of field names (e.g. "Hubs") to unconditionally
   764  	// include in API requests. By default, fields with empty or default values are
   765  	// omitted from API requests. See
   766  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   767  	// details.
   768  	ForceSendFields []string `json:"-"`
   769  	// NullFields is a list of field names (e.g. "Hubs") to include in API requests
   770  	// with the JSON null value. By default, fields with empty values are omitted
   771  	// from API requests. See
   772  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   773  	NullFields []string `json:"-"`
   774  }
   775  
   776  func (s *ListHubsResponse) MarshalJSON() ([]byte, error) {
   777  	type NoMethod ListHubsResponse
   778  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   779  }
   780  
   781  // ListInternalRangesResponse: Response for InternalRange.ListInternalRanges
   782  type ListInternalRangesResponse struct {
   783  	// InternalRanges: Internal range to be returned.
   784  	InternalRanges []*InternalRange `json:"internalRanges,omitempty"`
   785  	// NextPageToken: The next pagination token in the List response. It should be
   786  	// used as page_token for the following request. An empty value means no more
   787  	// result.
   788  	NextPageToken string `json:"nextPageToken,omitempty"`
   789  	// Unreachable: Locations that could not be reached.
   790  	Unreachable []string `json:"unreachable,omitempty"`
   791  
   792  	// ServerResponse contains the HTTP response code and headers from the server.
   793  	googleapi.ServerResponse `json:"-"`
   794  	// ForceSendFields is a list of field names (e.g. "InternalRanges") to
   795  	// unconditionally include in API requests. By default, fields with empty or
   796  	// default values are omitted from API requests. See
   797  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   798  	// details.
   799  	ForceSendFields []string `json:"-"`
   800  	// NullFields is a list of field names (e.g. "InternalRanges") to include in
   801  	// API requests with the JSON null value. By default, fields with empty values
   802  	// are omitted from API requests. See
   803  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   804  	NullFields []string `json:"-"`
   805  }
   806  
   807  func (s *ListInternalRangesResponse) MarshalJSON() ([]byte, error) {
   808  	type NoMethod ListInternalRangesResponse
   809  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   810  }
   811  
   812  // ListLocationsResponse: The response message for Locations.ListLocations.
   813  type ListLocationsResponse struct {
   814  	// Locations: A list of locations that matches the specified filter in the
   815  	// request.
   816  	Locations []*Location `json:"locations,omitempty"`
   817  	// NextPageToken: The standard List next-page token.
   818  	NextPageToken string `json:"nextPageToken,omitempty"`
   819  
   820  	// ServerResponse contains the HTTP response code and headers from the server.
   821  	googleapi.ServerResponse `json:"-"`
   822  	// ForceSendFields is a list of field names (e.g. "Locations") to
   823  	// unconditionally include in API requests. By default, fields with empty or
   824  	// default values are omitted from API requests. See
   825  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   826  	// details.
   827  	ForceSendFields []string `json:"-"`
   828  	// NullFields is a list of field names (e.g. "Locations") to include in API
   829  	// requests with the JSON null value. By default, fields with empty values are
   830  	// omitted from API requests. See
   831  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   832  	NullFields []string `json:"-"`
   833  }
   834  
   835  func (s *ListLocationsResponse) MarshalJSON() ([]byte, error) {
   836  	type NoMethod ListLocationsResponse
   837  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   838  }
   839  
   840  // ListSpokesResponse: The response for HubService.ListSpokes.
   841  type ListSpokesResponse struct {
   842  	// NextPageToken: The next pagination token in the List response. It should be
   843  	// used as page_token for the following request. An empty value means no more
   844  	// result.
   845  	NextPageToken string `json:"nextPageToken,omitempty"`
   846  	// Spokes: Spokes to be returned.
   847  	Spokes []*Spoke `json:"spokes,omitempty"`
   848  	// Unreachable: Locations that could not be reached.
   849  	Unreachable []string `json:"unreachable,omitempty"`
   850  
   851  	// ServerResponse contains the HTTP response code and headers from the server.
   852  	googleapi.ServerResponse `json:"-"`
   853  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
   854  	// unconditionally include in API requests. By default, fields with empty or
   855  	// default values are omitted from API requests. See
   856  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   857  	// details.
   858  	ForceSendFields []string `json:"-"`
   859  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
   860  	// requests with the JSON null value. By default, fields with empty values are
   861  	// omitted from API requests. See
   862  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   863  	NullFields []string `json:"-"`
   864  }
   865  
   866  func (s *ListSpokesResponse) MarshalJSON() ([]byte, error) {
   867  	type NoMethod ListSpokesResponse
   868  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   869  }
   870  
   871  // Location: A resource that represents a Google Cloud location.
   872  type Location struct {
   873  	// DisplayName: The friendly name for this location, typically a nearby city
   874  	// name. For example, "Tokyo".
   875  	DisplayName string `json:"displayName,omitempty"`
   876  	// Labels: Cross-service attributes for the location. For example
   877  	// {"cloud.googleapis.com/region": "us-east1"}
   878  	Labels map[string]string `json:"labels,omitempty"`
   879  	// LocationId: The canonical id for this location. For example: "us-east1".
   880  	LocationId string `json:"locationId,omitempty"`
   881  	// Metadata: Service-specific metadata. For example the available capacity at
   882  	// the given location.
   883  	Metadata googleapi.RawMessage `json:"metadata,omitempty"`
   884  	// Name: Resource name for the location, which may vary between
   885  	// implementations. For example:
   886  	// "projects/example-project/locations/us-east1"
   887  	Name string `json:"name,omitempty"`
   888  
   889  	// ServerResponse contains the HTTP response code and headers from the server.
   890  	googleapi.ServerResponse `json:"-"`
   891  	// ForceSendFields is a list of field names (e.g. "DisplayName") to
   892  	// unconditionally include in API requests. By default, fields with empty or
   893  	// default values are omitted from API requests. See
   894  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   895  	// details.
   896  	ForceSendFields []string `json:"-"`
   897  	// NullFields is a list of field names (e.g. "DisplayName") to include in API
   898  	// requests with the JSON null value. By default, fields with empty values are
   899  	// omitted from API requests. See
   900  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   901  	NullFields []string `json:"-"`
   902  }
   903  
   904  func (s *Location) MarshalJSON() ([]byte, error) {
   905  	type NoMethod Location
   906  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   907  }
   908  
   909  // OperationMetadata: Represents the metadata of the long-running operation.
   910  type OperationMetadata struct {
   911  	// ApiVersion: Output only. API version used to start the operation.
   912  	ApiVersion string `json:"apiVersion,omitempty"`
   913  	// CreateTime: Output only. The time the operation was created.
   914  	CreateTime string `json:"createTime,omitempty"`
   915  	// EndTime: Output only. The time the operation finished running.
   916  	EndTime string `json:"endTime,omitempty"`
   917  	// RequestedCancellation: Output only. Identifies whether the user has
   918  	// requested cancellation of the operation. Operations that have successfully
   919  	// been cancelled have Operation.error value with a google.rpc.Status.code of
   920  	// 1, corresponding to `Code.CANCELLED`.
   921  	RequestedCancellation bool `json:"requestedCancellation,omitempty"`
   922  	// StatusMessage: Output only. Human-readable status of the operation, if any.
   923  	StatusMessage string `json:"statusMessage,omitempty"`
   924  	// Target: Output only. Server-defined resource path for the target of the
   925  	// operation.
   926  	Target string `json:"target,omitempty"`
   927  	// Verb: Output only. Name of the verb executed by the operation.
   928  	Verb string `json:"verb,omitempty"`
   929  	// ForceSendFields is a list of field names (e.g. "ApiVersion") to
   930  	// unconditionally include in API requests. By default, fields with empty or
   931  	// default values are omitted from API requests. See
   932  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   933  	// details.
   934  	ForceSendFields []string `json:"-"`
   935  	// NullFields is a list of field names (e.g. "ApiVersion") to include in API
   936  	// requests with the JSON null value. By default, fields with empty values are
   937  	// omitted from API requests. See
   938  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   939  	NullFields []string `json:"-"`
   940  }
   941  
   942  func (s *OperationMetadata) MarshalJSON() ([]byte, error) {
   943  	type NoMethod OperationMetadata
   944  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   945  }
   946  
   947  // Policy: An Identity and Access Management (IAM) policy, which specifies
   948  // access controls for Google Cloud resources. A `Policy` is a collection of
   949  // `bindings`. A `binding` binds one or more `members`, or principals, to a
   950  // single `role`. Principals can be user accounts, service accounts, Google
   951  // groups, and domains (such as G Suite). A `role` is a named list of
   952  // permissions; each `role` can be an IAM predefined role or a user-created
   953  // custom role. For some types of Google Cloud resources, a `binding` can also
   954  // specify a `condition`, which is a logical expression that allows access to a
   955  // resource only if the expression evaluates to `true`. A condition can add
   956  // constraints based on attributes of the request, the resource, or both. To
   957  // learn which resources support conditions in their IAM policies, see the IAM
   958  // documentation
   959  // (https://cloud.google.com/iam/help/conditions/resource-policies). **JSON
   960  // example:** ``` { "bindings": [ { "role":
   961  // "roles/resourcemanager.organizationAdmin", "members": [
   962  // "user:mike@example.com", "group:admins@example.com", "domain:google.com",
   963  // "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role":
   964  // "roles/resourcemanager.organizationViewer", "members": [
   965  // "user:eve@example.com" ], "condition": { "title": "expirable access",
   966  // "description": "Does not grant access after Sep 2020", "expression":
   967  // "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag":
   968  // "BwWWja0YfJA=", "version": 3 } ``` **YAML example:** ``` bindings: -
   969  // members: - user:mike@example.com - group:admins@example.com -
   970  // domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com
   971  // role: roles/resourcemanager.organizationAdmin - members: -
   972  // user:eve@example.com role: roles/resourcemanager.organizationViewer
   973  // condition: title: expirable access description: Does not grant access after
   974  // Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z')
   975  // etag: BwWWja0YfJA= version: 3 ``` For a description of IAM and its features,
   976  // see the IAM documentation (https://cloud.google.com/iam/docs/).
   977  type Policy struct {
   978  	// AuditConfigs: Specifies cloud audit logging configuration for this policy.
   979  	AuditConfigs []*AuditConfig `json:"auditConfigs,omitempty"`
   980  	// Bindings: Associates a list of `members`, or principals, with a `role`.
   981  	// Optionally, may specify a `condition` that determines how and when the
   982  	// `bindings` are applied. Each of the `bindings` must contain at least one
   983  	// principal. The `bindings` in a `Policy` can refer to up to 1,500 principals;
   984  	// up to 250 of these principals can be Google groups. Each occurrence of a
   985  	// principal counts towards these limits. For example, if the `bindings` grant
   986  	// 50 different roles to `user:alice@example.com`, and not to any other
   987  	// principal, then you can add another 1,450 principals to the `bindings` in
   988  	// the `Policy`.
   989  	Bindings []*Binding `json:"bindings,omitempty"`
   990  	// Etag: `etag` is used for optimistic concurrency control as a way to help
   991  	// prevent simultaneous updates of a policy from overwriting each other. It is
   992  	// strongly suggested that systems make use of the `etag` in the
   993  	// read-modify-write cycle to perform policy updates in order to avoid race
   994  	// conditions: An `etag` is returned in the response to `getIamPolicy`, and
   995  	// systems are expected to put that etag in the request to `setIamPolicy` to
   996  	// ensure that their change will be applied to the same version of the policy.
   997  	// **Important:** If you use IAM Conditions, you must include the `etag` field
   998  	// whenever you call `setIamPolicy`. If you omit this field, then IAM allows
   999  	// you to overwrite a version `3` policy with a version `1` policy, and all of
  1000  	// the conditions in the version `3` policy are lost.
  1001  	Etag string `json:"etag,omitempty"`
  1002  	// Version: Specifies the format of the policy. Valid values are `0`, `1`, and
  1003  	// `3`. Requests that specify an invalid value are rejected. Any operation that
  1004  	// affects conditional role bindings must specify version `3`. This requirement
  1005  	// applies to the following operations: * Getting a policy that includes a
  1006  	// conditional role binding * Adding a conditional role binding to a policy *
  1007  	// Changing a conditional role binding in a policy * Removing any role binding,
  1008  	// with or without a condition, from a policy that includes conditions
  1009  	// **Important:** If you use IAM Conditions, you must include the `etag` field
  1010  	// whenever you call `setIamPolicy`. If you omit this field, then IAM allows
  1011  	// you to overwrite a version `3` policy with a version `1` policy, and all of
  1012  	// the conditions in the version `3` policy are lost. If a policy does not
  1013  	// include any conditions, operations on that policy may specify any valid
  1014  	// version or leave the field unset. To learn which resources support
  1015  	// conditions in their IAM policies, see the IAM documentation
  1016  	// (https://cloud.google.com/iam/help/conditions/resource-policies).
  1017  	Version int64 `json:"version,omitempty"`
  1018  
  1019  	// ServerResponse contains the HTTP response code and headers from the server.
  1020  	googleapi.ServerResponse `json:"-"`
  1021  	// ForceSendFields is a list of field names (e.g. "AuditConfigs") to
  1022  	// unconditionally include in API requests. By default, fields with empty or
  1023  	// default values are omitted from API requests. See
  1024  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1025  	// details.
  1026  	ForceSendFields []string `json:"-"`
  1027  	// NullFields is a list of field names (e.g. "AuditConfigs") to include in API
  1028  	// requests with the JSON null value. By default, fields with empty values are
  1029  	// omitted from API requests. See
  1030  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1031  	NullFields []string `json:"-"`
  1032  }
  1033  
  1034  func (s *Policy) MarshalJSON() ([]byte, error) {
  1035  	type NoMethod Policy
  1036  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1037  }
  1038  
  1039  // RouterApplianceInstance: RouterAppliance represents a Router appliance which
  1040  // is specified by a VM URI and a NIC address.
  1041  type RouterApplianceInstance struct {
  1042  	// IpAddress: The IP address of the network interface to use for peering.
  1043  	IpAddress        string `json:"ipAddress,omitempty"`
  1044  	NetworkInterface string `json:"networkInterface,omitempty"`
  1045  	// VirtualMachine: The URI of the virtual machine resource
  1046  	VirtualMachine string `json:"virtualMachine,omitempty"`
  1047  	// ForceSendFields is a list of field names (e.g. "IpAddress") to
  1048  	// unconditionally include in API requests. By default, fields with empty or
  1049  	// default values are omitted from API requests. See
  1050  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1051  	// details.
  1052  	ForceSendFields []string `json:"-"`
  1053  	// NullFields is a list of field names (e.g. "IpAddress") to include in API
  1054  	// requests with the JSON null value. By default, fields with empty values are
  1055  	// omitted from API requests. See
  1056  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1057  	NullFields []string `json:"-"`
  1058  }
  1059  
  1060  func (s *RouterApplianceInstance) MarshalJSON() ([]byte, error) {
  1061  	type NoMethod RouterApplianceInstance
  1062  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1063  }
  1064  
  1065  // SetIamPolicyRequest: Request message for `SetIamPolicy` method.
  1066  type SetIamPolicyRequest struct {
  1067  	// Policy: REQUIRED: The complete policy to be applied to the `resource`. The
  1068  	// size of the policy is limited to a few 10s of KB. An empty policy is a valid
  1069  	// policy but certain Google Cloud services (such as Projects) might reject
  1070  	// them.
  1071  	Policy *Policy `json:"policy,omitempty"`
  1072  	// UpdateMask: OPTIONAL: A FieldMask specifying which fields of the policy to
  1073  	// modify. Only the fields in the mask will be modified. If no mask is
  1074  	// provided, the following default mask is used: `paths: "bindings, etag"
  1075  	UpdateMask string `json:"updateMask,omitempty"`
  1076  	// ForceSendFields is a list of field names (e.g. "Policy") to unconditionally
  1077  	// include in API requests. By default, fields with empty or default values are
  1078  	// omitted from API requests. See
  1079  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1080  	// details.
  1081  	ForceSendFields []string `json:"-"`
  1082  	// NullFields is a list of field names (e.g. "Policy") to include in API
  1083  	// requests with the JSON null value. By default, fields with empty values are
  1084  	// omitted from API requests. See
  1085  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1086  	NullFields []string `json:"-"`
  1087  }
  1088  
  1089  func (s *SetIamPolicyRequest) MarshalJSON() ([]byte, error) {
  1090  	type NoMethod SetIamPolicyRequest
  1091  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1092  }
  1093  
  1094  // Spoke: A Spoke is an abstraction of a network attachment being attached to a
  1095  // Hub. A Spoke can be underlying a VPN tunnel, a VLAN (interconnect)
  1096  // attachment, a Router appliance, etc.
  1097  type Spoke struct {
  1098  	// CreateTime: The time when the Spoke was created.
  1099  	CreateTime string `json:"createTime,omitempty"`
  1100  	// Description: Short description of the spoke resource
  1101  	Description string `json:"description,omitempty"`
  1102  	// Hub: The resource URL of the hub resource that the spoke is attached to
  1103  	Hub string `json:"hub,omitempty"`
  1104  	// Labels: User-defined labels.
  1105  	Labels map[string]string `json:"labels,omitempty"`
  1106  	// LinkedInterconnectAttachments: The URIs of linked interconnect attachment
  1107  	// resources
  1108  	LinkedInterconnectAttachments []string `json:"linkedInterconnectAttachments,omitempty"`
  1109  	// LinkedRouterApplianceInstances: The URIs of linked Router appliance
  1110  	// resources
  1111  	LinkedRouterApplianceInstances []*RouterApplianceInstance `json:"linkedRouterApplianceInstances,omitempty"`
  1112  	// LinkedVpnTunnels: The URIs of linked VPN tunnel resources
  1113  	LinkedVpnTunnels []string `json:"linkedVpnTunnels,omitempty"`
  1114  	// Name: Immutable. The name of a Spoke resource.
  1115  	Name string `json:"name,omitempty"`
  1116  	// State: Output only. The current lifecycle state of this Hub.
  1117  	//
  1118  	// Possible values:
  1119  	//   "STATE_UNSPECIFIED" - No state information available
  1120  	//   "CREATING" - The resource's create operation is in progress
  1121  	//   "ACTIVE" - The resource is active
  1122  	//   "DELETING" - The resource's Delete operation is in progress
  1123  	//   "UPDATING" - The resource's Update operation is in progress
  1124  	State string `json:"state,omitempty"`
  1125  	// UniqueId: Output only. Google-generated UUID for this resource. This is
  1126  	// unique across all Spoke resources. If a Spoke resource is deleted and
  1127  	// another with the same name is created, it gets a different unique_id.
  1128  	UniqueId string `json:"uniqueId,omitempty"`
  1129  	// UpdateTime: The time when the Spoke was updated.
  1130  	UpdateTime string `json:"updateTime,omitempty"`
  1131  
  1132  	// ServerResponse contains the HTTP response code and headers from the server.
  1133  	googleapi.ServerResponse `json:"-"`
  1134  	// ForceSendFields is a list of field names (e.g. "CreateTime") to
  1135  	// unconditionally include in API requests. By default, fields with empty or
  1136  	// default values are omitted from API requests. See
  1137  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1138  	// details.
  1139  	ForceSendFields []string `json:"-"`
  1140  	// NullFields is a list of field names (e.g. "CreateTime") to include in API
  1141  	// requests with the JSON null value. By default, fields with empty values are
  1142  	// omitted from API requests. See
  1143  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1144  	NullFields []string `json:"-"`
  1145  }
  1146  
  1147  func (s *Spoke) MarshalJSON() ([]byte, error) {
  1148  	type NoMethod Spoke
  1149  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1150  }
  1151  
  1152  // TestIamPermissionsRequest: Request message for `TestIamPermissions` method.
  1153  type TestIamPermissionsRequest struct {
  1154  	// Permissions: The set of permissions to check for the `resource`. Permissions
  1155  	// with wildcards (such as `*` or `storage.*`) are not allowed. For more
  1156  	// information see IAM Overview
  1157  	// (https://cloud.google.com/iam/docs/overview#permissions).
  1158  	Permissions []string `json:"permissions,omitempty"`
  1159  	// ForceSendFields is a list of field names (e.g. "Permissions") to
  1160  	// unconditionally include in API requests. By default, fields with empty or
  1161  	// default values are omitted from API requests. See
  1162  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1163  	// details.
  1164  	ForceSendFields []string `json:"-"`
  1165  	// NullFields is a list of field names (e.g. "Permissions") to include in API
  1166  	// requests with the JSON null value. By default, fields with empty values are
  1167  	// omitted from API requests. See
  1168  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1169  	NullFields []string `json:"-"`
  1170  }
  1171  
  1172  func (s *TestIamPermissionsRequest) MarshalJSON() ([]byte, error) {
  1173  	type NoMethod TestIamPermissionsRequest
  1174  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1175  }
  1176  
  1177  // TestIamPermissionsResponse: Response message for `TestIamPermissions`
  1178  // method.
  1179  type TestIamPermissionsResponse struct {
  1180  	// Permissions: A subset of `TestPermissionsRequest.permissions` that the
  1181  	// caller is allowed.
  1182  	Permissions []string `json:"permissions,omitempty"`
  1183  
  1184  	// ServerResponse contains the HTTP response code and headers from the server.
  1185  	googleapi.ServerResponse `json:"-"`
  1186  	// ForceSendFields is a list of field names (e.g. "Permissions") to
  1187  	// unconditionally include in API requests. By default, fields with empty or
  1188  	// default values are omitted from API requests. See
  1189  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1190  	// details.
  1191  	ForceSendFields []string `json:"-"`
  1192  	// NullFields is a list of field names (e.g. "Permissions") to include in API
  1193  	// requests with the JSON null value. By default, fields with empty values are
  1194  	// omitted from API requests. See
  1195  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1196  	NullFields []string `json:"-"`
  1197  }
  1198  
  1199  func (s *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) {
  1200  	type NoMethod TestIamPermissionsResponse
  1201  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1202  }
  1203  
  1204  type ProjectsLocationsGetCall struct {
  1205  	s            *Service
  1206  	name         string
  1207  	urlParams_   gensupport.URLParams
  1208  	ifNoneMatch_ string
  1209  	ctx_         context.Context
  1210  	header_      http.Header
  1211  }
  1212  
  1213  // Get: Gets information about a location.
  1214  //
  1215  // - name: Resource name for the location.
  1216  func (r *ProjectsLocationsService) Get(name string) *ProjectsLocationsGetCall {
  1217  	c := &ProjectsLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1218  	c.name = name
  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 *ProjectsLocationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGetCall {
  1226  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1227  	return c
  1228  }
  1229  
  1230  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1231  // object's ETag matches the given value. This is useful for getting updates
  1232  // only after the object has changed since the last request.
  1233  func (c *ProjectsLocationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGetCall {
  1234  	c.ifNoneMatch_ = entityTag
  1235  	return c
  1236  }
  1237  
  1238  // Context sets the context to be used in this call's Do method.
  1239  func (c *ProjectsLocationsGetCall) Context(ctx context.Context) *ProjectsLocationsGetCall {
  1240  	c.ctx_ = ctx
  1241  	return c
  1242  }
  1243  
  1244  // Header returns a http.Header that can be modified by the caller to add
  1245  // headers to the request.
  1246  func (c *ProjectsLocationsGetCall) Header() http.Header {
  1247  	if c.header_ == nil {
  1248  		c.header_ = make(http.Header)
  1249  	}
  1250  	return c.header_
  1251  }
  1252  
  1253  func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) {
  1254  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1255  	if c.ifNoneMatch_ != "" {
  1256  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1257  	}
  1258  	var body io.Reader = nil
  1259  	c.urlParams_.Set("alt", alt)
  1260  	c.urlParams_.Set("prettyPrint", "false")
  1261  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}")
  1262  	urls += "?" + c.urlParams_.Encode()
  1263  	req, err := http.NewRequest("GET", urls, body)
  1264  	if err != nil {
  1265  		return nil, err
  1266  	}
  1267  	req.Header = reqHeaders
  1268  	googleapi.Expand(req.URL, map[string]string{
  1269  		"name": c.name,
  1270  	})
  1271  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1272  }
  1273  
  1274  // Do executes the "networkconnectivity.projects.locations.get" call.
  1275  // Any non-2xx status code is an error. Response headers are in either
  1276  // *Location.ServerResponse.Header or (if a response was returned at all) in
  1277  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1278  // whether the returned error was because http.StatusNotModified was returned.
  1279  func (c *ProjectsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) {
  1280  	gensupport.SetOptions(c.urlParams_, opts...)
  1281  	res, err := c.doRequest("json")
  1282  	if res != nil && res.StatusCode == http.StatusNotModified {
  1283  		if res.Body != nil {
  1284  			res.Body.Close()
  1285  		}
  1286  		return nil, gensupport.WrapError(&googleapi.Error{
  1287  			Code:   res.StatusCode,
  1288  			Header: res.Header,
  1289  		})
  1290  	}
  1291  	if err != nil {
  1292  		return nil, err
  1293  	}
  1294  	defer googleapi.CloseBody(res)
  1295  	if err := googleapi.CheckResponse(res); err != nil {
  1296  		return nil, gensupport.WrapError(err)
  1297  	}
  1298  	ret := &Location{
  1299  		ServerResponse: googleapi.ServerResponse{
  1300  			Header:         res.Header,
  1301  			HTTPStatusCode: res.StatusCode,
  1302  		},
  1303  	}
  1304  	target := &ret
  1305  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1306  		return nil, err
  1307  	}
  1308  	return ret, nil
  1309  }
  1310  
  1311  type ProjectsLocationsListCall struct {
  1312  	s            *Service
  1313  	name         string
  1314  	urlParams_   gensupport.URLParams
  1315  	ifNoneMatch_ string
  1316  	ctx_         context.Context
  1317  	header_      http.Header
  1318  }
  1319  
  1320  // List: Lists information about the supported locations for this service.
  1321  //
  1322  // - name: The resource that owns the locations collection, if applicable.
  1323  func (r *ProjectsLocationsService) List(name string) *ProjectsLocationsListCall {
  1324  	c := &ProjectsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1325  	c.name = name
  1326  	return c
  1327  }
  1328  
  1329  // Filter sets the optional parameter "filter": A filter to narrow down results
  1330  // to a preferred subset. The filtering language accepts strings like
  1331  // "displayName=tokyo", and is documented in more detail in AIP-160
  1332  // (https://google.aip.dev/160).
  1333  func (c *ProjectsLocationsListCall) Filter(filter string) *ProjectsLocationsListCall {
  1334  	c.urlParams_.Set("filter", filter)
  1335  	return c
  1336  }
  1337  
  1338  // PageSize sets the optional parameter "pageSize": The maximum number of
  1339  // results to return. If not set, the service selects a default.
  1340  func (c *ProjectsLocationsListCall) PageSize(pageSize int64) *ProjectsLocationsListCall {
  1341  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  1342  	return c
  1343  }
  1344  
  1345  // PageToken sets the optional parameter "pageToken": A page token received
  1346  // from the `next_page_token` field in the response. Send that page token to
  1347  // receive the subsequent page.
  1348  func (c *ProjectsLocationsListCall) PageToken(pageToken string) *ProjectsLocationsListCall {
  1349  	c.urlParams_.Set("pageToken", pageToken)
  1350  	return c
  1351  }
  1352  
  1353  // Fields allows partial responses to be retrieved. See
  1354  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1355  // details.
  1356  func (c *ProjectsLocationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsListCall {
  1357  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1358  	return c
  1359  }
  1360  
  1361  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1362  // object's ETag matches the given value. This is useful for getting updates
  1363  // only after the object has changed since the last request.
  1364  func (c *ProjectsLocationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsListCall {
  1365  	c.ifNoneMatch_ = entityTag
  1366  	return c
  1367  }
  1368  
  1369  // Context sets the context to be used in this call's Do method.
  1370  func (c *ProjectsLocationsListCall) Context(ctx context.Context) *ProjectsLocationsListCall {
  1371  	c.ctx_ = ctx
  1372  	return c
  1373  }
  1374  
  1375  // Header returns a http.Header that can be modified by the caller to add
  1376  // headers to the request.
  1377  func (c *ProjectsLocationsListCall) Header() http.Header {
  1378  	if c.header_ == nil {
  1379  		c.header_ = make(http.Header)
  1380  	}
  1381  	return c.header_
  1382  }
  1383  
  1384  func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error) {
  1385  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1386  	if c.ifNoneMatch_ != "" {
  1387  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1388  	}
  1389  	var body io.Reader = nil
  1390  	c.urlParams_.Set("alt", alt)
  1391  	c.urlParams_.Set("prettyPrint", "false")
  1392  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}/locations")
  1393  	urls += "?" + c.urlParams_.Encode()
  1394  	req, err := http.NewRequest("GET", urls, body)
  1395  	if err != nil {
  1396  		return nil, err
  1397  	}
  1398  	req.Header = reqHeaders
  1399  	googleapi.Expand(req.URL, map[string]string{
  1400  		"name": c.name,
  1401  	})
  1402  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1403  }
  1404  
  1405  // Do executes the "networkconnectivity.projects.locations.list" call.
  1406  // Any non-2xx status code is an error. Response headers are in either
  1407  // *ListLocationsResponse.ServerResponse.Header or (if a response was returned
  1408  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1409  // check whether the returned error was because http.StatusNotModified was
  1410  // returned.
  1411  func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) {
  1412  	gensupport.SetOptions(c.urlParams_, opts...)
  1413  	res, err := c.doRequest("json")
  1414  	if res != nil && res.StatusCode == http.StatusNotModified {
  1415  		if res.Body != nil {
  1416  			res.Body.Close()
  1417  		}
  1418  		return nil, gensupport.WrapError(&googleapi.Error{
  1419  			Code:   res.StatusCode,
  1420  			Header: res.Header,
  1421  		})
  1422  	}
  1423  	if err != nil {
  1424  		return nil, err
  1425  	}
  1426  	defer googleapi.CloseBody(res)
  1427  	if err := googleapi.CheckResponse(res); err != nil {
  1428  		return nil, gensupport.WrapError(err)
  1429  	}
  1430  	ret := &ListLocationsResponse{
  1431  		ServerResponse: googleapi.ServerResponse{
  1432  			Header:         res.Header,
  1433  			HTTPStatusCode: res.StatusCode,
  1434  		},
  1435  	}
  1436  	target := &ret
  1437  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1438  		return nil, err
  1439  	}
  1440  	return ret, nil
  1441  }
  1442  
  1443  // Pages invokes f for each page of results.
  1444  // A non-nil error returned from f will halt the iteration.
  1445  // The provided context supersedes any context provided to the Context method.
  1446  func (c *ProjectsLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error {
  1447  	c.ctx_ = ctx
  1448  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  1449  	for {
  1450  		x, err := c.Do()
  1451  		if err != nil {
  1452  			return err
  1453  		}
  1454  		if err := f(x); err != nil {
  1455  			return err
  1456  		}
  1457  		if x.NextPageToken == "" {
  1458  			return nil
  1459  		}
  1460  		c.PageToken(x.NextPageToken)
  1461  	}
  1462  }
  1463  
  1464  type ProjectsLocationsGlobalHubsCreateCall struct {
  1465  	s          *Service
  1466  	parent     string
  1467  	hub        *Hub
  1468  	urlParams_ gensupport.URLParams
  1469  	ctx_       context.Context
  1470  	header_    http.Header
  1471  }
  1472  
  1473  // Create: Creates a new Network Connectivity Center hub in the specified
  1474  // project.
  1475  //
  1476  // - parent: The parent resource's name of the Hub.
  1477  func (r *ProjectsLocationsGlobalHubsService) Create(parent string, hub *Hub) *ProjectsLocationsGlobalHubsCreateCall {
  1478  	c := &ProjectsLocationsGlobalHubsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1479  	c.parent = parent
  1480  	c.hub = hub
  1481  	return c
  1482  }
  1483  
  1484  // HubId sets the optional parameter "hubId": Unique id for the Hub to create.
  1485  func (c *ProjectsLocationsGlobalHubsCreateCall) HubId(hubId string) *ProjectsLocationsGlobalHubsCreateCall {
  1486  	c.urlParams_.Set("hubId", hubId)
  1487  	return c
  1488  }
  1489  
  1490  // RequestId sets the optional parameter "requestId": A request ID to identify
  1491  // requests. Specify a unique request ID so that if you must retry your
  1492  // request, the server will know to ignore the request if it has already been
  1493  // completed. The server guarantees that a request doesn't result in creation
  1494  // of duplicate commitments for at least 60 minutes. For example, consider a
  1495  // situation where you make an initial request and the request times out. If
  1496  // you make the request again with the same request ID, the server can check if
  1497  // original operation with the same request ID was received, and if so, will
  1498  // ignore the second request. This prevents clients from accidentally creating
  1499  // duplicate commitments. The request ID must be a valid UUID with the
  1500  // exception that zero UUID is not supported
  1501  // (00000000-0000-0000-0000-000000000000).
  1502  func (c *ProjectsLocationsGlobalHubsCreateCall) RequestId(requestId string) *ProjectsLocationsGlobalHubsCreateCall {
  1503  	c.urlParams_.Set("requestId", requestId)
  1504  	return c
  1505  }
  1506  
  1507  // Fields allows partial responses to be retrieved. See
  1508  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1509  // details.
  1510  func (c *ProjectsLocationsGlobalHubsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsGlobalHubsCreateCall {
  1511  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1512  	return c
  1513  }
  1514  
  1515  // Context sets the context to be used in this call's Do method.
  1516  func (c *ProjectsLocationsGlobalHubsCreateCall) Context(ctx context.Context) *ProjectsLocationsGlobalHubsCreateCall {
  1517  	c.ctx_ = ctx
  1518  	return c
  1519  }
  1520  
  1521  // Header returns a http.Header that can be modified by the caller to add
  1522  // headers to the request.
  1523  func (c *ProjectsLocationsGlobalHubsCreateCall) Header() http.Header {
  1524  	if c.header_ == nil {
  1525  		c.header_ = make(http.Header)
  1526  	}
  1527  	return c.header_
  1528  }
  1529  
  1530  func (c *ProjectsLocationsGlobalHubsCreateCall) doRequest(alt string) (*http.Response, error) {
  1531  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1532  	var body io.Reader = nil
  1533  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.hub)
  1534  	if err != nil {
  1535  		return nil, err
  1536  	}
  1537  	c.urlParams_.Set("alt", alt)
  1538  	c.urlParams_.Set("prettyPrint", "false")
  1539  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/hubs")
  1540  	urls += "?" + c.urlParams_.Encode()
  1541  	req, err := http.NewRequest("POST", urls, body)
  1542  	if err != nil {
  1543  		return nil, err
  1544  	}
  1545  	req.Header = reqHeaders
  1546  	googleapi.Expand(req.URL, map[string]string{
  1547  		"parent": c.parent,
  1548  	})
  1549  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1550  }
  1551  
  1552  // Do executes the "networkconnectivity.projects.locations.global.hubs.create" call.
  1553  // Any non-2xx status code is an error. Response headers are in either
  1554  // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was
  1555  // returned at all) in error.(*googleapi.Error).Header. Use
  1556  // googleapi.IsNotModified to check whether the returned error was because
  1557  // http.StatusNotModified was returned.
  1558  func (c *ProjectsLocationsGlobalHubsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  1559  	gensupport.SetOptions(c.urlParams_, opts...)
  1560  	res, err := c.doRequest("json")
  1561  	if res != nil && res.StatusCode == http.StatusNotModified {
  1562  		if res.Body != nil {
  1563  			res.Body.Close()
  1564  		}
  1565  		return nil, gensupport.WrapError(&googleapi.Error{
  1566  			Code:   res.StatusCode,
  1567  			Header: res.Header,
  1568  		})
  1569  	}
  1570  	if err != nil {
  1571  		return nil, err
  1572  	}
  1573  	defer googleapi.CloseBody(res)
  1574  	if err := googleapi.CheckResponse(res); err != nil {
  1575  		return nil, gensupport.WrapError(err)
  1576  	}
  1577  	ret := &GoogleLongrunningOperation{
  1578  		ServerResponse: googleapi.ServerResponse{
  1579  			Header:         res.Header,
  1580  			HTTPStatusCode: res.StatusCode,
  1581  		},
  1582  	}
  1583  	target := &ret
  1584  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1585  		return nil, err
  1586  	}
  1587  	return ret, nil
  1588  }
  1589  
  1590  type ProjectsLocationsGlobalHubsDeleteCall struct {
  1591  	s          *Service
  1592  	name       string
  1593  	urlParams_ gensupport.URLParams
  1594  	ctx_       context.Context
  1595  	header_    http.Header
  1596  }
  1597  
  1598  // Delete: Deletes a Network Connectivity Center hub.
  1599  //
  1600  // - name: The name of the Hub to delete.
  1601  func (r *ProjectsLocationsGlobalHubsService) Delete(name string) *ProjectsLocationsGlobalHubsDeleteCall {
  1602  	c := &ProjectsLocationsGlobalHubsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1603  	c.name = name
  1604  	return c
  1605  }
  1606  
  1607  // RequestId sets the optional parameter "requestId": A request ID to identify
  1608  // requests. Specify a unique request ID so that if you must retry your
  1609  // request, the server will know to ignore the request if it has already been
  1610  // completed. The server guarantees that a request doesn't result in creation
  1611  // of duplicate commitments for at least 60 minutes. For example, consider a
  1612  // situation where you make an initial request and the request times out. If
  1613  // you make the request again with the same request ID, the server can check if
  1614  // original operation with the same request ID was received, and if so, will
  1615  // ignore the second request. This prevents clients from accidentally creating
  1616  // duplicate commitments. The request ID must be a valid UUID with the
  1617  // exception that zero UUID is not supported
  1618  // (00000000-0000-0000-0000-000000000000).
  1619  func (c *ProjectsLocationsGlobalHubsDeleteCall) RequestId(requestId string) *ProjectsLocationsGlobalHubsDeleteCall {
  1620  	c.urlParams_.Set("requestId", requestId)
  1621  	return c
  1622  }
  1623  
  1624  // Fields allows partial responses to be retrieved. See
  1625  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1626  // details.
  1627  func (c *ProjectsLocationsGlobalHubsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsGlobalHubsDeleteCall {
  1628  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1629  	return c
  1630  }
  1631  
  1632  // Context sets the context to be used in this call's Do method.
  1633  func (c *ProjectsLocationsGlobalHubsDeleteCall) Context(ctx context.Context) *ProjectsLocationsGlobalHubsDeleteCall {
  1634  	c.ctx_ = ctx
  1635  	return c
  1636  }
  1637  
  1638  // Header returns a http.Header that can be modified by the caller to add
  1639  // headers to the request.
  1640  func (c *ProjectsLocationsGlobalHubsDeleteCall) Header() http.Header {
  1641  	if c.header_ == nil {
  1642  		c.header_ = make(http.Header)
  1643  	}
  1644  	return c.header_
  1645  }
  1646  
  1647  func (c *ProjectsLocationsGlobalHubsDeleteCall) doRequest(alt string) (*http.Response, error) {
  1648  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1649  	var body io.Reader = nil
  1650  	c.urlParams_.Set("alt", alt)
  1651  	c.urlParams_.Set("prettyPrint", "false")
  1652  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}")
  1653  	urls += "?" + c.urlParams_.Encode()
  1654  	req, err := http.NewRequest("DELETE", urls, body)
  1655  	if err != nil {
  1656  		return nil, err
  1657  	}
  1658  	req.Header = reqHeaders
  1659  	googleapi.Expand(req.URL, map[string]string{
  1660  		"name": c.name,
  1661  	})
  1662  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1663  }
  1664  
  1665  // Do executes the "networkconnectivity.projects.locations.global.hubs.delete" call.
  1666  // Any non-2xx status code is an error. Response headers are in either
  1667  // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was
  1668  // returned at all) in error.(*googleapi.Error).Header. Use
  1669  // googleapi.IsNotModified to check whether the returned error was because
  1670  // http.StatusNotModified was returned.
  1671  func (c *ProjectsLocationsGlobalHubsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  1672  	gensupport.SetOptions(c.urlParams_, opts...)
  1673  	res, err := c.doRequest("json")
  1674  	if res != nil && res.StatusCode == http.StatusNotModified {
  1675  		if res.Body != nil {
  1676  			res.Body.Close()
  1677  		}
  1678  		return nil, gensupport.WrapError(&googleapi.Error{
  1679  			Code:   res.StatusCode,
  1680  			Header: res.Header,
  1681  		})
  1682  	}
  1683  	if err != nil {
  1684  		return nil, err
  1685  	}
  1686  	defer googleapi.CloseBody(res)
  1687  	if err := googleapi.CheckResponse(res); err != nil {
  1688  		return nil, gensupport.WrapError(err)
  1689  	}
  1690  	ret := &GoogleLongrunningOperation{
  1691  		ServerResponse: googleapi.ServerResponse{
  1692  			Header:         res.Header,
  1693  			HTTPStatusCode: res.StatusCode,
  1694  		},
  1695  	}
  1696  	target := &ret
  1697  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1698  		return nil, err
  1699  	}
  1700  	return ret, nil
  1701  }
  1702  
  1703  type ProjectsLocationsGlobalHubsGetCall struct {
  1704  	s            *Service
  1705  	name         string
  1706  	urlParams_   gensupport.URLParams
  1707  	ifNoneMatch_ string
  1708  	ctx_         context.Context
  1709  	header_      http.Header
  1710  }
  1711  
  1712  // Get: Gets details about a Network Connectivity Center hub.
  1713  //
  1714  // - name: Name of the Hub resource to get.
  1715  func (r *ProjectsLocationsGlobalHubsService) Get(name string) *ProjectsLocationsGlobalHubsGetCall {
  1716  	c := &ProjectsLocationsGlobalHubsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1717  	c.name = name
  1718  	return c
  1719  }
  1720  
  1721  // Fields allows partial responses to be retrieved. See
  1722  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1723  // details.
  1724  func (c *ProjectsLocationsGlobalHubsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGlobalHubsGetCall {
  1725  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1726  	return c
  1727  }
  1728  
  1729  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1730  // object's ETag matches the given value. This is useful for getting updates
  1731  // only after the object has changed since the last request.
  1732  func (c *ProjectsLocationsGlobalHubsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGlobalHubsGetCall {
  1733  	c.ifNoneMatch_ = entityTag
  1734  	return c
  1735  }
  1736  
  1737  // Context sets the context to be used in this call's Do method.
  1738  func (c *ProjectsLocationsGlobalHubsGetCall) Context(ctx context.Context) *ProjectsLocationsGlobalHubsGetCall {
  1739  	c.ctx_ = ctx
  1740  	return c
  1741  }
  1742  
  1743  // Header returns a http.Header that can be modified by the caller to add
  1744  // headers to the request.
  1745  func (c *ProjectsLocationsGlobalHubsGetCall) Header() http.Header {
  1746  	if c.header_ == nil {
  1747  		c.header_ = make(http.Header)
  1748  	}
  1749  	return c.header_
  1750  }
  1751  
  1752  func (c *ProjectsLocationsGlobalHubsGetCall) doRequest(alt string) (*http.Response, error) {
  1753  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1754  	if c.ifNoneMatch_ != "" {
  1755  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1756  	}
  1757  	var body io.Reader = nil
  1758  	c.urlParams_.Set("alt", alt)
  1759  	c.urlParams_.Set("prettyPrint", "false")
  1760  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}")
  1761  	urls += "?" + c.urlParams_.Encode()
  1762  	req, err := http.NewRequest("GET", urls, body)
  1763  	if err != nil {
  1764  		return nil, err
  1765  	}
  1766  	req.Header = reqHeaders
  1767  	googleapi.Expand(req.URL, map[string]string{
  1768  		"name": c.name,
  1769  	})
  1770  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1771  }
  1772  
  1773  // Do executes the "networkconnectivity.projects.locations.global.hubs.get" call.
  1774  // Any non-2xx status code is an error. Response headers are in either
  1775  // *Hub.ServerResponse.Header or (if a response was returned at all) in
  1776  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1777  // whether the returned error was because http.StatusNotModified was returned.
  1778  func (c *ProjectsLocationsGlobalHubsGetCall) Do(opts ...googleapi.CallOption) (*Hub, error) {
  1779  	gensupport.SetOptions(c.urlParams_, opts...)
  1780  	res, err := c.doRequest("json")
  1781  	if res != nil && res.StatusCode == http.StatusNotModified {
  1782  		if res.Body != nil {
  1783  			res.Body.Close()
  1784  		}
  1785  		return nil, gensupport.WrapError(&googleapi.Error{
  1786  			Code:   res.StatusCode,
  1787  			Header: res.Header,
  1788  		})
  1789  	}
  1790  	if err != nil {
  1791  		return nil, err
  1792  	}
  1793  	defer googleapi.CloseBody(res)
  1794  	if err := googleapi.CheckResponse(res); err != nil {
  1795  		return nil, gensupport.WrapError(err)
  1796  	}
  1797  	ret := &Hub{
  1798  		ServerResponse: googleapi.ServerResponse{
  1799  			Header:         res.Header,
  1800  			HTTPStatusCode: res.StatusCode,
  1801  		},
  1802  	}
  1803  	target := &ret
  1804  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1805  		return nil, err
  1806  	}
  1807  	return ret, nil
  1808  }
  1809  
  1810  type ProjectsLocationsGlobalHubsGetIamPolicyCall struct {
  1811  	s            *Service
  1812  	resource     string
  1813  	urlParams_   gensupport.URLParams
  1814  	ifNoneMatch_ string
  1815  	ctx_         context.Context
  1816  	header_      http.Header
  1817  }
  1818  
  1819  // GetIamPolicy: Gets the access control policy for a resource. Returns an
  1820  // empty policy if the resource exists and does not have a policy set.
  1821  //
  1822  //   - resource: REQUIRED: The resource for which the policy is being requested.
  1823  //     See Resource names (https://cloud.google.com/apis/design/resource_names)
  1824  //     for the appropriate value for this field.
  1825  func (r *ProjectsLocationsGlobalHubsService) GetIamPolicy(resource string) *ProjectsLocationsGlobalHubsGetIamPolicyCall {
  1826  	c := &ProjectsLocationsGlobalHubsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1827  	c.resource = resource
  1828  	return c
  1829  }
  1830  
  1831  // OptionsRequestedPolicyVersion sets the optional parameter
  1832  // "options.requestedPolicyVersion": The maximum policy version that will be
  1833  // used to format the policy. Valid values are 0, 1, and 3. Requests specifying
  1834  // an invalid value will be rejected. Requests for policies with any
  1835  // conditional role bindings must specify version 3. Policies with no
  1836  // conditional role bindings may specify any valid value or leave the field
  1837  // unset. The policy in the response might use the policy version that you
  1838  // specified, or it might use a lower policy version. For example, if you
  1839  // specify version 3, but the policy has no conditional role bindings, the
  1840  // response uses version 1. To learn which resources support conditions in
  1841  // their IAM policies, see the IAM documentation
  1842  // (https://cloud.google.com/iam/help/conditions/resource-policies).
  1843  func (c *ProjectsLocationsGlobalHubsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsGlobalHubsGetIamPolicyCall {
  1844  	c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
  1845  	return c
  1846  }
  1847  
  1848  // Fields allows partial responses to be retrieved. See
  1849  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1850  // details.
  1851  func (c *ProjectsLocationsGlobalHubsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsGlobalHubsGetIamPolicyCall {
  1852  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1853  	return c
  1854  }
  1855  
  1856  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1857  // object's ETag matches the given value. This is useful for getting updates
  1858  // only after the object has changed since the last request.
  1859  func (c *ProjectsLocationsGlobalHubsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsGlobalHubsGetIamPolicyCall {
  1860  	c.ifNoneMatch_ = entityTag
  1861  	return c
  1862  }
  1863  
  1864  // Context sets the context to be used in this call's Do method.
  1865  func (c *ProjectsLocationsGlobalHubsGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsGlobalHubsGetIamPolicyCall {
  1866  	c.ctx_ = ctx
  1867  	return c
  1868  }
  1869  
  1870  // Header returns a http.Header that can be modified by the caller to add
  1871  // headers to the request.
  1872  func (c *ProjectsLocationsGlobalHubsGetIamPolicyCall) Header() http.Header {
  1873  	if c.header_ == nil {
  1874  		c.header_ = make(http.Header)
  1875  	}
  1876  	return c.header_
  1877  }
  1878  
  1879  func (c *ProjectsLocationsGlobalHubsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  1880  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1881  	if c.ifNoneMatch_ != "" {
  1882  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1883  	}
  1884  	var body io.Reader = nil
  1885  	c.urlParams_.Set("alt", alt)
  1886  	c.urlParams_.Set("prettyPrint", "false")
  1887  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+resource}:getIamPolicy")
  1888  	urls += "?" + c.urlParams_.Encode()
  1889  	req, err := http.NewRequest("GET", urls, body)
  1890  	if err != nil {
  1891  		return nil, err
  1892  	}
  1893  	req.Header = reqHeaders
  1894  	googleapi.Expand(req.URL, map[string]string{
  1895  		"resource": c.resource,
  1896  	})
  1897  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1898  }
  1899  
  1900  // Do executes the "networkconnectivity.projects.locations.global.hubs.getIamPolicy" call.
  1901  // Any non-2xx status code is an error. Response headers are in either
  1902  // *Policy.ServerResponse.Header or (if a response was returned at all) in
  1903  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1904  // whether the returned error was because http.StatusNotModified was returned.
  1905  func (c *ProjectsLocationsGlobalHubsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  1906  	gensupport.SetOptions(c.urlParams_, opts...)
  1907  	res, err := c.doRequest("json")
  1908  	if res != nil && res.StatusCode == http.StatusNotModified {
  1909  		if res.Body != nil {
  1910  			res.Body.Close()
  1911  		}
  1912  		return nil, gensupport.WrapError(&googleapi.Error{
  1913  			Code:   res.StatusCode,
  1914  			Header: res.Header,
  1915  		})
  1916  	}
  1917  	if err != nil {
  1918  		return nil, err
  1919  	}
  1920  	defer googleapi.CloseBody(res)
  1921  	if err := googleapi.CheckResponse(res); err != nil {
  1922  		return nil, gensupport.WrapError(err)
  1923  	}
  1924  	ret := &Policy{
  1925  		ServerResponse: googleapi.ServerResponse{
  1926  			Header:         res.Header,
  1927  			HTTPStatusCode: res.StatusCode,
  1928  		},
  1929  	}
  1930  	target := &ret
  1931  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1932  		return nil, err
  1933  	}
  1934  	return ret, nil
  1935  }
  1936  
  1937  type ProjectsLocationsGlobalHubsListCall struct {
  1938  	s            *Service
  1939  	parent       string
  1940  	urlParams_   gensupport.URLParams
  1941  	ifNoneMatch_ string
  1942  	ctx_         context.Context
  1943  	header_      http.Header
  1944  }
  1945  
  1946  // List: Lists the Network Connectivity Center hubs associated with a given
  1947  // project.
  1948  //
  1949  // - parent: The parent resource's name.
  1950  func (r *ProjectsLocationsGlobalHubsService) List(parent string) *ProjectsLocationsGlobalHubsListCall {
  1951  	c := &ProjectsLocationsGlobalHubsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1952  	c.parent = parent
  1953  	return c
  1954  }
  1955  
  1956  // Filter sets the optional parameter "filter": A filter expression that
  1957  // filters the results listed in the response.
  1958  func (c *ProjectsLocationsGlobalHubsListCall) Filter(filter string) *ProjectsLocationsGlobalHubsListCall {
  1959  	c.urlParams_.Set("filter", filter)
  1960  	return c
  1961  }
  1962  
  1963  // OrderBy sets the optional parameter "orderBy": Sort the results by a certain
  1964  // order.
  1965  func (c *ProjectsLocationsGlobalHubsListCall) OrderBy(orderBy string) *ProjectsLocationsGlobalHubsListCall {
  1966  	c.urlParams_.Set("orderBy", orderBy)
  1967  	return c
  1968  }
  1969  
  1970  // PageSize sets the optional parameter "pageSize": The maximum number of
  1971  // results per page that should be returned.
  1972  func (c *ProjectsLocationsGlobalHubsListCall) PageSize(pageSize int64) *ProjectsLocationsGlobalHubsListCall {
  1973  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  1974  	return c
  1975  }
  1976  
  1977  // PageToken sets the optional parameter "pageToken": The page token.
  1978  func (c *ProjectsLocationsGlobalHubsListCall) PageToken(pageToken string) *ProjectsLocationsGlobalHubsListCall {
  1979  	c.urlParams_.Set("pageToken", pageToken)
  1980  	return c
  1981  }
  1982  
  1983  // Fields allows partial responses to be retrieved. See
  1984  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1985  // details.
  1986  func (c *ProjectsLocationsGlobalHubsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsGlobalHubsListCall {
  1987  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1988  	return c
  1989  }
  1990  
  1991  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1992  // object's ETag matches the given value. This is useful for getting updates
  1993  // only after the object has changed since the last request.
  1994  func (c *ProjectsLocationsGlobalHubsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsGlobalHubsListCall {
  1995  	c.ifNoneMatch_ = entityTag
  1996  	return c
  1997  }
  1998  
  1999  // Context sets the context to be used in this call's Do method.
  2000  func (c *ProjectsLocationsGlobalHubsListCall) Context(ctx context.Context) *ProjectsLocationsGlobalHubsListCall {
  2001  	c.ctx_ = ctx
  2002  	return c
  2003  }
  2004  
  2005  // Header returns a http.Header that can be modified by the caller to add
  2006  // headers to the request.
  2007  func (c *ProjectsLocationsGlobalHubsListCall) Header() http.Header {
  2008  	if c.header_ == nil {
  2009  		c.header_ = make(http.Header)
  2010  	}
  2011  	return c.header_
  2012  }
  2013  
  2014  func (c *ProjectsLocationsGlobalHubsListCall) doRequest(alt string) (*http.Response, error) {
  2015  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2016  	if c.ifNoneMatch_ != "" {
  2017  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2018  	}
  2019  	var body io.Reader = nil
  2020  	c.urlParams_.Set("alt", alt)
  2021  	c.urlParams_.Set("prettyPrint", "false")
  2022  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/hubs")
  2023  	urls += "?" + c.urlParams_.Encode()
  2024  	req, err := http.NewRequest("GET", urls, body)
  2025  	if err != nil {
  2026  		return nil, err
  2027  	}
  2028  	req.Header = reqHeaders
  2029  	googleapi.Expand(req.URL, map[string]string{
  2030  		"parent": c.parent,
  2031  	})
  2032  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2033  }
  2034  
  2035  // Do executes the "networkconnectivity.projects.locations.global.hubs.list" call.
  2036  // Any non-2xx status code is an error. Response headers are in either
  2037  // *ListHubsResponse.ServerResponse.Header or (if a response was returned at
  2038  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2039  // check whether the returned error was because http.StatusNotModified was
  2040  // returned.
  2041  func (c *ProjectsLocationsGlobalHubsListCall) Do(opts ...googleapi.CallOption) (*ListHubsResponse, error) {
  2042  	gensupport.SetOptions(c.urlParams_, opts...)
  2043  	res, err := c.doRequest("json")
  2044  	if res != nil && res.StatusCode == http.StatusNotModified {
  2045  		if res.Body != nil {
  2046  			res.Body.Close()
  2047  		}
  2048  		return nil, gensupport.WrapError(&googleapi.Error{
  2049  			Code:   res.StatusCode,
  2050  			Header: res.Header,
  2051  		})
  2052  	}
  2053  	if err != nil {
  2054  		return nil, err
  2055  	}
  2056  	defer googleapi.CloseBody(res)
  2057  	if err := googleapi.CheckResponse(res); err != nil {
  2058  		return nil, gensupport.WrapError(err)
  2059  	}
  2060  	ret := &ListHubsResponse{
  2061  		ServerResponse: googleapi.ServerResponse{
  2062  			Header:         res.Header,
  2063  			HTTPStatusCode: res.StatusCode,
  2064  		},
  2065  	}
  2066  	target := &ret
  2067  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2068  		return nil, err
  2069  	}
  2070  	return ret, nil
  2071  }
  2072  
  2073  // Pages invokes f for each page of results.
  2074  // A non-nil error returned from f will halt the iteration.
  2075  // The provided context supersedes any context provided to the Context method.
  2076  func (c *ProjectsLocationsGlobalHubsListCall) Pages(ctx context.Context, f func(*ListHubsResponse) error) error {
  2077  	c.ctx_ = ctx
  2078  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  2079  	for {
  2080  		x, err := c.Do()
  2081  		if err != nil {
  2082  			return err
  2083  		}
  2084  		if err := f(x); err != nil {
  2085  			return err
  2086  		}
  2087  		if x.NextPageToken == "" {
  2088  			return nil
  2089  		}
  2090  		c.PageToken(x.NextPageToken)
  2091  	}
  2092  }
  2093  
  2094  type ProjectsLocationsGlobalHubsPatchCall struct {
  2095  	s          *Service
  2096  	name       string
  2097  	hub        *Hub
  2098  	urlParams_ gensupport.URLParams
  2099  	ctx_       context.Context
  2100  	header_    http.Header
  2101  }
  2102  
  2103  // Patch: Updates the description and/or labels of a Network Connectivity
  2104  // Center hub.
  2105  //
  2106  // - name: Immutable. The name of a Hub resource.
  2107  func (r *ProjectsLocationsGlobalHubsService) Patch(name string, hub *Hub) *ProjectsLocationsGlobalHubsPatchCall {
  2108  	c := &ProjectsLocationsGlobalHubsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2109  	c.name = name
  2110  	c.hub = hub
  2111  	return c
  2112  }
  2113  
  2114  // RequestId sets the optional parameter "requestId": A request ID to identify
  2115  // requests. Specify a unique request ID so that if you must retry your
  2116  // request, the server will know to ignore the request if it has already been
  2117  // completed. The server guarantees that a request doesn't result in creation
  2118  // of duplicate commitments for at least 60 minutes. For example, consider a
  2119  // situation where you make an initial request and the request times out. If
  2120  // you make the request again with the same request ID, the server can check if
  2121  // original operation with the same request ID was received, and if so, will
  2122  // ignore the second request. This prevents clients from accidentally creating
  2123  // duplicate commitments. The request ID must be a valid UUID with the
  2124  // exception that zero UUID is not supported
  2125  // (00000000-0000-0000-0000-000000000000).
  2126  func (c *ProjectsLocationsGlobalHubsPatchCall) RequestId(requestId string) *ProjectsLocationsGlobalHubsPatchCall {
  2127  	c.urlParams_.Set("requestId", requestId)
  2128  	return c
  2129  }
  2130  
  2131  // UpdateMask sets the optional parameter "updateMask": Field mask is used to
  2132  // specify the fields to be overwritten in the Hub resource by the update. The
  2133  // fields specified in the update_mask are relative to the resource, not the
  2134  // full request. A field will be overwritten if it is in the mask. If the user
  2135  // does not provide a mask then all fields will be overwritten.
  2136  func (c *ProjectsLocationsGlobalHubsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsGlobalHubsPatchCall {
  2137  	c.urlParams_.Set("updateMask", updateMask)
  2138  	return c
  2139  }
  2140  
  2141  // Fields allows partial responses to be retrieved. See
  2142  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2143  // details.
  2144  func (c *ProjectsLocationsGlobalHubsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsGlobalHubsPatchCall {
  2145  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2146  	return c
  2147  }
  2148  
  2149  // Context sets the context to be used in this call's Do method.
  2150  func (c *ProjectsLocationsGlobalHubsPatchCall) Context(ctx context.Context) *ProjectsLocationsGlobalHubsPatchCall {
  2151  	c.ctx_ = ctx
  2152  	return c
  2153  }
  2154  
  2155  // Header returns a http.Header that can be modified by the caller to add
  2156  // headers to the request.
  2157  func (c *ProjectsLocationsGlobalHubsPatchCall) Header() http.Header {
  2158  	if c.header_ == nil {
  2159  		c.header_ = make(http.Header)
  2160  	}
  2161  	return c.header_
  2162  }
  2163  
  2164  func (c *ProjectsLocationsGlobalHubsPatchCall) doRequest(alt string) (*http.Response, error) {
  2165  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  2166  	var body io.Reader = nil
  2167  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.hub)
  2168  	if err != nil {
  2169  		return nil, err
  2170  	}
  2171  	c.urlParams_.Set("alt", alt)
  2172  	c.urlParams_.Set("prettyPrint", "false")
  2173  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}")
  2174  	urls += "?" + c.urlParams_.Encode()
  2175  	req, err := http.NewRequest("PATCH", urls, body)
  2176  	if err != nil {
  2177  		return nil, err
  2178  	}
  2179  	req.Header = reqHeaders
  2180  	googleapi.Expand(req.URL, map[string]string{
  2181  		"name": c.name,
  2182  	})
  2183  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2184  }
  2185  
  2186  // Do executes the "networkconnectivity.projects.locations.global.hubs.patch" call.
  2187  // Any non-2xx status code is an error. Response headers are in either
  2188  // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was
  2189  // returned at all) in error.(*googleapi.Error).Header. Use
  2190  // googleapi.IsNotModified to check whether the returned error was because
  2191  // http.StatusNotModified was returned.
  2192  func (c *ProjectsLocationsGlobalHubsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  2193  	gensupport.SetOptions(c.urlParams_, opts...)
  2194  	res, err := c.doRequest("json")
  2195  	if res != nil && res.StatusCode == http.StatusNotModified {
  2196  		if res.Body != nil {
  2197  			res.Body.Close()
  2198  		}
  2199  		return nil, gensupport.WrapError(&googleapi.Error{
  2200  			Code:   res.StatusCode,
  2201  			Header: res.Header,
  2202  		})
  2203  	}
  2204  	if err != nil {
  2205  		return nil, err
  2206  	}
  2207  	defer googleapi.CloseBody(res)
  2208  	if err := googleapi.CheckResponse(res); err != nil {
  2209  		return nil, gensupport.WrapError(err)
  2210  	}
  2211  	ret := &GoogleLongrunningOperation{
  2212  		ServerResponse: googleapi.ServerResponse{
  2213  			Header:         res.Header,
  2214  			HTTPStatusCode: res.StatusCode,
  2215  		},
  2216  	}
  2217  	target := &ret
  2218  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2219  		return nil, err
  2220  	}
  2221  	return ret, nil
  2222  }
  2223  
  2224  type ProjectsLocationsGlobalHubsSetIamPolicyCall struct {
  2225  	s                   *Service
  2226  	resource            string
  2227  	setiampolicyrequest *SetIamPolicyRequest
  2228  	urlParams_          gensupport.URLParams
  2229  	ctx_                context.Context
  2230  	header_             http.Header
  2231  }
  2232  
  2233  // SetIamPolicy: Sets the access control policy on the specified resource.
  2234  // Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`,
  2235  // and `PERMISSION_DENIED` errors.
  2236  //
  2237  //   - resource: REQUIRED: The resource for which the policy is being specified.
  2238  //     See Resource names (https://cloud.google.com/apis/design/resource_names)
  2239  //     for the appropriate value for this field.
  2240  func (r *ProjectsLocationsGlobalHubsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsGlobalHubsSetIamPolicyCall {
  2241  	c := &ProjectsLocationsGlobalHubsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2242  	c.resource = resource
  2243  	c.setiampolicyrequest = setiampolicyrequest
  2244  	return c
  2245  }
  2246  
  2247  // Fields allows partial responses to be retrieved. See
  2248  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2249  // details.
  2250  func (c *ProjectsLocationsGlobalHubsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsGlobalHubsSetIamPolicyCall {
  2251  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2252  	return c
  2253  }
  2254  
  2255  // Context sets the context to be used in this call's Do method.
  2256  func (c *ProjectsLocationsGlobalHubsSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsGlobalHubsSetIamPolicyCall {
  2257  	c.ctx_ = ctx
  2258  	return c
  2259  }
  2260  
  2261  // Header returns a http.Header that can be modified by the caller to add
  2262  // headers to the request.
  2263  func (c *ProjectsLocationsGlobalHubsSetIamPolicyCall) Header() http.Header {
  2264  	if c.header_ == nil {
  2265  		c.header_ = make(http.Header)
  2266  	}
  2267  	return c.header_
  2268  }
  2269  
  2270  func (c *ProjectsLocationsGlobalHubsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  2271  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  2272  	var body io.Reader = nil
  2273  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
  2274  	if err != nil {
  2275  		return nil, err
  2276  	}
  2277  	c.urlParams_.Set("alt", alt)
  2278  	c.urlParams_.Set("prettyPrint", "false")
  2279  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+resource}:setIamPolicy")
  2280  	urls += "?" + c.urlParams_.Encode()
  2281  	req, err := http.NewRequest("POST", urls, body)
  2282  	if err != nil {
  2283  		return nil, err
  2284  	}
  2285  	req.Header = reqHeaders
  2286  	googleapi.Expand(req.URL, map[string]string{
  2287  		"resource": c.resource,
  2288  	})
  2289  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2290  }
  2291  
  2292  // Do executes the "networkconnectivity.projects.locations.global.hubs.setIamPolicy" call.
  2293  // Any non-2xx status code is an error. Response headers are in either
  2294  // *Policy.ServerResponse.Header or (if a response was returned at all) in
  2295  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2296  // whether the returned error was because http.StatusNotModified was returned.
  2297  func (c *ProjectsLocationsGlobalHubsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  2298  	gensupport.SetOptions(c.urlParams_, opts...)
  2299  	res, err := c.doRequest("json")
  2300  	if res != nil && res.StatusCode == http.StatusNotModified {
  2301  		if res.Body != nil {
  2302  			res.Body.Close()
  2303  		}
  2304  		return nil, gensupport.WrapError(&googleapi.Error{
  2305  			Code:   res.StatusCode,
  2306  			Header: res.Header,
  2307  		})
  2308  	}
  2309  	if err != nil {
  2310  		return nil, err
  2311  	}
  2312  	defer googleapi.CloseBody(res)
  2313  	if err := googleapi.CheckResponse(res); err != nil {
  2314  		return nil, gensupport.WrapError(err)
  2315  	}
  2316  	ret := &Policy{
  2317  		ServerResponse: googleapi.ServerResponse{
  2318  			Header:         res.Header,
  2319  			HTTPStatusCode: res.StatusCode,
  2320  		},
  2321  	}
  2322  	target := &ret
  2323  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2324  		return nil, err
  2325  	}
  2326  	return ret, nil
  2327  }
  2328  
  2329  type ProjectsLocationsGlobalHubsTestIamPermissionsCall struct {
  2330  	s                         *Service
  2331  	resource                  string
  2332  	testiampermissionsrequest *TestIamPermissionsRequest
  2333  	urlParams_                gensupport.URLParams
  2334  	ctx_                      context.Context
  2335  	header_                   http.Header
  2336  }
  2337  
  2338  // TestIamPermissions: Returns permissions that a caller has on the specified
  2339  // resource. If the resource does not exist, this will return an empty set of
  2340  // permissions, not a `NOT_FOUND` error. Note: This operation is designed to be
  2341  // used for building permission-aware UIs and command-line tools, not for
  2342  // authorization checking. This operation may "fail open" without warning.
  2343  //
  2344  //   - resource: REQUIRED: The resource for which the policy detail is being
  2345  //     requested. See Resource names
  2346  //     (https://cloud.google.com/apis/design/resource_names) for the appropriate
  2347  //     value for this field.
  2348  func (r *ProjectsLocationsGlobalHubsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsGlobalHubsTestIamPermissionsCall {
  2349  	c := &ProjectsLocationsGlobalHubsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2350  	c.resource = resource
  2351  	c.testiampermissionsrequest = testiampermissionsrequest
  2352  	return c
  2353  }
  2354  
  2355  // Fields allows partial responses to be retrieved. See
  2356  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2357  // details.
  2358  func (c *ProjectsLocationsGlobalHubsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsGlobalHubsTestIamPermissionsCall {
  2359  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2360  	return c
  2361  }
  2362  
  2363  // Context sets the context to be used in this call's Do method.
  2364  func (c *ProjectsLocationsGlobalHubsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsGlobalHubsTestIamPermissionsCall {
  2365  	c.ctx_ = ctx
  2366  	return c
  2367  }
  2368  
  2369  // Header returns a http.Header that can be modified by the caller to add
  2370  // headers to the request.
  2371  func (c *ProjectsLocationsGlobalHubsTestIamPermissionsCall) Header() http.Header {
  2372  	if c.header_ == nil {
  2373  		c.header_ = make(http.Header)
  2374  	}
  2375  	return c.header_
  2376  }
  2377  
  2378  func (c *ProjectsLocationsGlobalHubsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  2379  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  2380  	var body io.Reader = nil
  2381  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
  2382  	if err != nil {
  2383  		return nil, err
  2384  	}
  2385  	c.urlParams_.Set("alt", alt)
  2386  	c.urlParams_.Set("prettyPrint", "false")
  2387  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+resource}:testIamPermissions")
  2388  	urls += "?" + c.urlParams_.Encode()
  2389  	req, err := http.NewRequest("POST", urls, body)
  2390  	if err != nil {
  2391  		return nil, err
  2392  	}
  2393  	req.Header = reqHeaders
  2394  	googleapi.Expand(req.URL, map[string]string{
  2395  		"resource": c.resource,
  2396  	})
  2397  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2398  }
  2399  
  2400  // Do executes the "networkconnectivity.projects.locations.global.hubs.testIamPermissions" call.
  2401  // Any non-2xx status code is an error. Response headers are in either
  2402  // *TestIamPermissionsResponse.ServerResponse.Header or (if a response was
  2403  // returned at all) in error.(*googleapi.Error).Header. Use
  2404  // googleapi.IsNotModified to check whether the returned error was because
  2405  // http.StatusNotModified was returned.
  2406  func (c *ProjectsLocationsGlobalHubsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
  2407  	gensupport.SetOptions(c.urlParams_, opts...)
  2408  	res, err := c.doRequest("json")
  2409  	if res != nil && res.StatusCode == http.StatusNotModified {
  2410  		if res.Body != nil {
  2411  			res.Body.Close()
  2412  		}
  2413  		return nil, gensupport.WrapError(&googleapi.Error{
  2414  			Code:   res.StatusCode,
  2415  			Header: res.Header,
  2416  		})
  2417  	}
  2418  	if err != nil {
  2419  		return nil, err
  2420  	}
  2421  	defer googleapi.CloseBody(res)
  2422  	if err := googleapi.CheckResponse(res); err != nil {
  2423  		return nil, gensupport.WrapError(err)
  2424  	}
  2425  	ret := &TestIamPermissionsResponse{
  2426  		ServerResponse: googleapi.ServerResponse{
  2427  			Header:         res.Header,
  2428  			HTTPStatusCode: res.StatusCode,
  2429  		},
  2430  	}
  2431  	target := &ret
  2432  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2433  		return nil, err
  2434  	}
  2435  	return ret, nil
  2436  }
  2437  
  2438  type ProjectsLocationsInternalRangesCreateCall struct {
  2439  	s             *Service
  2440  	parent        string
  2441  	internalrange *InternalRange
  2442  	urlParams_    gensupport.URLParams
  2443  	ctx_          context.Context
  2444  	header_       http.Header
  2445  }
  2446  
  2447  // Create: Creates a new internal range in a given project and location.
  2448  //
  2449  // - parent: The parent resource's name of the InternalRange.
  2450  func (r *ProjectsLocationsInternalRangesService) Create(parent string, internalrange *InternalRange) *ProjectsLocationsInternalRangesCreateCall {
  2451  	c := &ProjectsLocationsInternalRangesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2452  	c.parent = parent
  2453  	c.internalrange = internalrange
  2454  	return c
  2455  }
  2456  
  2457  // InternalRangeId sets the optional parameter "internalRangeId": Resource ID
  2458  // (i.e. 'foo' in '[...]/projects/p/locations/l/internalRanges/foo') See
  2459  // https://google.aip.dev/122#resource-id-segments Unique per location.
  2460  func (c *ProjectsLocationsInternalRangesCreateCall) InternalRangeId(internalRangeId string) *ProjectsLocationsInternalRangesCreateCall {
  2461  	c.urlParams_.Set("internalRangeId", internalRangeId)
  2462  	return c
  2463  }
  2464  
  2465  // RequestId sets the optional parameter "requestId": An optional request ID to
  2466  // identify requests. Specify a unique request ID so that if you must retry
  2467  // your request, the server will know to ignore the request if it has already
  2468  // been completed. The server will guarantee that for at least 60 minutes since
  2469  // the first request. For example, consider a situation where you make an
  2470  // initial request and the request times out. If you make the request again
  2471  // with the same request ID, the server can check if the original operation
  2472  // with the same request ID was received, and if so, will ignore the second
  2473  // request. This prevents clients from accidentally creating duplicate
  2474  // commitments. The request ID must be a valid UUID with the exception that
  2475  // zero UUID is not supported (00000000-0000-0000-0000-000000000000).
  2476  func (c *ProjectsLocationsInternalRangesCreateCall) RequestId(requestId string) *ProjectsLocationsInternalRangesCreateCall {
  2477  	c.urlParams_.Set("requestId", requestId)
  2478  	return c
  2479  }
  2480  
  2481  // Fields allows partial responses to be retrieved. See
  2482  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2483  // details.
  2484  func (c *ProjectsLocationsInternalRangesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsInternalRangesCreateCall {
  2485  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2486  	return c
  2487  }
  2488  
  2489  // Context sets the context to be used in this call's Do method.
  2490  func (c *ProjectsLocationsInternalRangesCreateCall) Context(ctx context.Context) *ProjectsLocationsInternalRangesCreateCall {
  2491  	c.ctx_ = ctx
  2492  	return c
  2493  }
  2494  
  2495  // Header returns a http.Header that can be modified by the caller to add
  2496  // headers to the request.
  2497  func (c *ProjectsLocationsInternalRangesCreateCall) Header() http.Header {
  2498  	if c.header_ == nil {
  2499  		c.header_ = make(http.Header)
  2500  	}
  2501  	return c.header_
  2502  }
  2503  
  2504  func (c *ProjectsLocationsInternalRangesCreateCall) doRequest(alt string) (*http.Response, error) {
  2505  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  2506  	var body io.Reader = nil
  2507  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.internalrange)
  2508  	if err != nil {
  2509  		return nil, err
  2510  	}
  2511  	c.urlParams_.Set("alt", alt)
  2512  	c.urlParams_.Set("prettyPrint", "false")
  2513  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/internalRanges")
  2514  	urls += "?" + c.urlParams_.Encode()
  2515  	req, err := http.NewRequest("POST", urls, body)
  2516  	if err != nil {
  2517  		return nil, err
  2518  	}
  2519  	req.Header = reqHeaders
  2520  	googleapi.Expand(req.URL, map[string]string{
  2521  		"parent": c.parent,
  2522  	})
  2523  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2524  }
  2525  
  2526  // Do executes the "networkconnectivity.projects.locations.internalRanges.create" call.
  2527  // Any non-2xx status code is an error. Response headers are in either
  2528  // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was
  2529  // returned at all) in error.(*googleapi.Error).Header. Use
  2530  // googleapi.IsNotModified to check whether the returned error was because
  2531  // http.StatusNotModified was returned.
  2532  func (c *ProjectsLocationsInternalRangesCreateCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  2533  	gensupport.SetOptions(c.urlParams_, opts...)
  2534  	res, err := c.doRequest("json")
  2535  	if res != nil && res.StatusCode == http.StatusNotModified {
  2536  		if res.Body != nil {
  2537  			res.Body.Close()
  2538  		}
  2539  		return nil, gensupport.WrapError(&googleapi.Error{
  2540  			Code:   res.StatusCode,
  2541  			Header: res.Header,
  2542  		})
  2543  	}
  2544  	if err != nil {
  2545  		return nil, err
  2546  	}
  2547  	defer googleapi.CloseBody(res)
  2548  	if err := googleapi.CheckResponse(res); err != nil {
  2549  		return nil, gensupport.WrapError(err)
  2550  	}
  2551  	ret := &GoogleLongrunningOperation{
  2552  		ServerResponse: googleapi.ServerResponse{
  2553  			Header:         res.Header,
  2554  			HTTPStatusCode: res.StatusCode,
  2555  		},
  2556  	}
  2557  	target := &ret
  2558  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2559  		return nil, err
  2560  	}
  2561  	return ret, nil
  2562  }
  2563  
  2564  type ProjectsLocationsInternalRangesDeleteCall struct {
  2565  	s          *Service
  2566  	name       string
  2567  	urlParams_ gensupport.URLParams
  2568  	ctx_       context.Context
  2569  	header_    http.Header
  2570  }
  2571  
  2572  // Delete: Deletes a single internal range.
  2573  //
  2574  // - name: The name of the InternalRange to delete.
  2575  func (r *ProjectsLocationsInternalRangesService) Delete(name string) *ProjectsLocationsInternalRangesDeleteCall {
  2576  	c := &ProjectsLocationsInternalRangesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2577  	c.name = name
  2578  	return c
  2579  }
  2580  
  2581  // RequestId sets the optional parameter "requestId": An optional request ID to
  2582  // identify requests. Specify a unique request ID so that if you must retry
  2583  // your request, the server will know to ignore the request if it has already
  2584  // been completed. The server will guarantee that for at least 60 minutes after
  2585  // the first request. For example, consider a situation where you make an
  2586  // initial request and the request times out. If you make the request again
  2587  // with the same request ID, the server can check if the original operation
  2588  // with the same request ID was received, and if so, will ignore the second
  2589  // request. This prevents clients from accidentally creating duplicate
  2590  // commitments. The request ID must be a valid UUID with the exception that
  2591  // zero UUID is not supported (00000000-0000-0000-0000-000000000000).
  2592  func (c *ProjectsLocationsInternalRangesDeleteCall) RequestId(requestId string) *ProjectsLocationsInternalRangesDeleteCall {
  2593  	c.urlParams_.Set("requestId", requestId)
  2594  	return c
  2595  }
  2596  
  2597  // Fields allows partial responses to be retrieved. See
  2598  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2599  // details.
  2600  func (c *ProjectsLocationsInternalRangesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsInternalRangesDeleteCall {
  2601  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2602  	return c
  2603  }
  2604  
  2605  // Context sets the context to be used in this call's Do method.
  2606  func (c *ProjectsLocationsInternalRangesDeleteCall) Context(ctx context.Context) *ProjectsLocationsInternalRangesDeleteCall {
  2607  	c.ctx_ = ctx
  2608  	return c
  2609  }
  2610  
  2611  // Header returns a http.Header that can be modified by the caller to add
  2612  // headers to the request.
  2613  func (c *ProjectsLocationsInternalRangesDeleteCall) Header() http.Header {
  2614  	if c.header_ == nil {
  2615  		c.header_ = make(http.Header)
  2616  	}
  2617  	return c.header_
  2618  }
  2619  
  2620  func (c *ProjectsLocationsInternalRangesDeleteCall) doRequest(alt string) (*http.Response, error) {
  2621  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2622  	var body io.Reader = nil
  2623  	c.urlParams_.Set("alt", alt)
  2624  	c.urlParams_.Set("prettyPrint", "false")
  2625  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}")
  2626  	urls += "?" + c.urlParams_.Encode()
  2627  	req, err := http.NewRequest("DELETE", urls, body)
  2628  	if err != nil {
  2629  		return nil, err
  2630  	}
  2631  	req.Header = reqHeaders
  2632  	googleapi.Expand(req.URL, map[string]string{
  2633  		"name": c.name,
  2634  	})
  2635  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2636  }
  2637  
  2638  // Do executes the "networkconnectivity.projects.locations.internalRanges.delete" call.
  2639  // Any non-2xx status code is an error. Response headers are in either
  2640  // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was
  2641  // returned at all) in error.(*googleapi.Error).Header. Use
  2642  // googleapi.IsNotModified to check whether the returned error was because
  2643  // http.StatusNotModified was returned.
  2644  func (c *ProjectsLocationsInternalRangesDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  2645  	gensupport.SetOptions(c.urlParams_, opts...)
  2646  	res, err := c.doRequest("json")
  2647  	if res != nil && res.StatusCode == http.StatusNotModified {
  2648  		if res.Body != nil {
  2649  			res.Body.Close()
  2650  		}
  2651  		return nil, gensupport.WrapError(&googleapi.Error{
  2652  			Code:   res.StatusCode,
  2653  			Header: res.Header,
  2654  		})
  2655  	}
  2656  	if err != nil {
  2657  		return nil, err
  2658  	}
  2659  	defer googleapi.CloseBody(res)
  2660  	if err := googleapi.CheckResponse(res); err != nil {
  2661  		return nil, gensupport.WrapError(err)
  2662  	}
  2663  	ret := &GoogleLongrunningOperation{
  2664  		ServerResponse: googleapi.ServerResponse{
  2665  			Header:         res.Header,
  2666  			HTTPStatusCode: res.StatusCode,
  2667  		},
  2668  	}
  2669  	target := &ret
  2670  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2671  		return nil, err
  2672  	}
  2673  	return ret, nil
  2674  }
  2675  
  2676  type ProjectsLocationsInternalRangesGetCall struct {
  2677  	s            *Service
  2678  	name         string
  2679  	urlParams_   gensupport.URLParams
  2680  	ifNoneMatch_ string
  2681  	ctx_         context.Context
  2682  	header_      http.Header
  2683  }
  2684  
  2685  // Get: Gets details of a single internal range.
  2686  //
  2687  // - name: Name of the InternalRange to get.
  2688  func (r *ProjectsLocationsInternalRangesService) Get(name string) *ProjectsLocationsInternalRangesGetCall {
  2689  	c := &ProjectsLocationsInternalRangesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2690  	c.name = name
  2691  	return c
  2692  }
  2693  
  2694  // Fields allows partial responses to be retrieved. See
  2695  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2696  // details.
  2697  func (c *ProjectsLocationsInternalRangesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsInternalRangesGetCall {
  2698  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2699  	return c
  2700  }
  2701  
  2702  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2703  // object's ETag matches the given value. This is useful for getting updates
  2704  // only after the object has changed since the last request.
  2705  func (c *ProjectsLocationsInternalRangesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsInternalRangesGetCall {
  2706  	c.ifNoneMatch_ = entityTag
  2707  	return c
  2708  }
  2709  
  2710  // Context sets the context to be used in this call's Do method.
  2711  func (c *ProjectsLocationsInternalRangesGetCall) Context(ctx context.Context) *ProjectsLocationsInternalRangesGetCall {
  2712  	c.ctx_ = ctx
  2713  	return c
  2714  }
  2715  
  2716  // Header returns a http.Header that can be modified by the caller to add
  2717  // headers to the request.
  2718  func (c *ProjectsLocationsInternalRangesGetCall) Header() http.Header {
  2719  	if c.header_ == nil {
  2720  		c.header_ = make(http.Header)
  2721  	}
  2722  	return c.header_
  2723  }
  2724  
  2725  func (c *ProjectsLocationsInternalRangesGetCall) doRequest(alt string) (*http.Response, error) {
  2726  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2727  	if c.ifNoneMatch_ != "" {
  2728  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2729  	}
  2730  	var body io.Reader = nil
  2731  	c.urlParams_.Set("alt", alt)
  2732  	c.urlParams_.Set("prettyPrint", "false")
  2733  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}")
  2734  	urls += "?" + c.urlParams_.Encode()
  2735  	req, err := http.NewRequest("GET", urls, body)
  2736  	if err != nil {
  2737  		return nil, err
  2738  	}
  2739  	req.Header = reqHeaders
  2740  	googleapi.Expand(req.URL, map[string]string{
  2741  		"name": c.name,
  2742  	})
  2743  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2744  }
  2745  
  2746  // Do executes the "networkconnectivity.projects.locations.internalRanges.get" call.
  2747  // Any non-2xx status code is an error. Response headers are in either
  2748  // *InternalRange.ServerResponse.Header or (if a response was returned at all)
  2749  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2750  // whether the returned error was because http.StatusNotModified was returned.
  2751  func (c *ProjectsLocationsInternalRangesGetCall) Do(opts ...googleapi.CallOption) (*InternalRange, error) {
  2752  	gensupport.SetOptions(c.urlParams_, opts...)
  2753  	res, err := c.doRequest("json")
  2754  	if res != nil && res.StatusCode == http.StatusNotModified {
  2755  		if res.Body != nil {
  2756  			res.Body.Close()
  2757  		}
  2758  		return nil, gensupport.WrapError(&googleapi.Error{
  2759  			Code:   res.StatusCode,
  2760  			Header: res.Header,
  2761  		})
  2762  	}
  2763  	if err != nil {
  2764  		return nil, err
  2765  	}
  2766  	defer googleapi.CloseBody(res)
  2767  	if err := googleapi.CheckResponse(res); err != nil {
  2768  		return nil, gensupport.WrapError(err)
  2769  	}
  2770  	ret := &InternalRange{
  2771  		ServerResponse: googleapi.ServerResponse{
  2772  			Header:         res.Header,
  2773  			HTTPStatusCode: res.StatusCode,
  2774  		},
  2775  	}
  2776  	target := &ret
  2777  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2778  		return nil, err
  2779  	}
  2780  	return ret, nil
  2781  }
  2782  
  2783  type ProjectsLocationsInternalRangesGetIamPolicyCall struct {
  2784  	s            *Service
  2785  	resource     string
  2786  	urlParams_   gensupport.URLParams
  2787  	ifNoneMatch_ string
  2788  	ctx_         context.Context
  2789  	header_      http.Header
  2790  }
  2791  
  2792  // GetIamPolicy: Gets the access control policy for a resource. Returns an
  2793  // empty policy if the resource exists and does not have a policy set.
  2794  //
  2795  //   - resource: REQUIRED: The resource for which the policy is being requested.
  2796  //     See Resource names (https://cloud.google.com/apis/design/resource_names)
  2797  //     for the appropriate value for this field.
  2798  func (r *ProjectsLocationsInternalRangesService) GetIamPolicy(resource string) *ProjectsLocationsInternalRangesGetIamPolicyCall {
  2799  	c := &ProjectsLocationsInternalRangesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2800  	c.resource = resource
  2801  	return c
  2802  }
  2803  
  2804  // OptionsRequestedPolicyVersion sets the optional parameter
  2805  // "options.requestedPolicyVersion": The maximum policy version that will be
  2806  // used to format the policy. Valid values are 0, 1, and 3. Requests specifying
  2807  // an invalid value will be rejected. Requests for policies with any
  2808  // conditional role bindings must specify version 3. Policies with no
  2809  // conditional role bindings may specify any valid value or leave the field
  2810  // unset. The policy in the response might use the policy version that you
  2811  // specified, or it might use a lower policy version. For example, if you
  2812  // specify version 3, but the policy has no conditional role bindings, the
  2813  // response uses version 1. To learn which resources support conditions in
  2814  // their IAM policies, see the IAM documentation
  2815  // (https://cloud.google.com/iam/help/conditions/resource-policies).
  2816  func (c *ProjectsLocationsInternalRangesGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsInternalRangesGetIamPolicyCall {
  2817  	c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
  2818  	return c
  2819  }
  2820  
  2821  // Fields allows partial responses to be retrieved. See
  2822  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2823  // details.
  2824  func (c *ProjectsLocationsInternalRangesGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsInternalRangesGetIamPolicyCall {
  2825  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2826  	return c
  2827  }
  2828  
  2829  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2830  // object's ETag matches the given value. This is useful for getting updates
  2831  // only after the object has changed since the last request.
  2832  func (c *ProjectsLocationsInternalRangesGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsInternalRangesGetIamPolicyCall {
  2833  	c.ifNoneMatch_ = entityTag
  2834  	return c
  2835  }
  2836  
  2837  // Context sets the context to be used in this call's Do method.
  2838  func (c *ProjectsLocationsInternalRangesGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsInternalRangesGetIamPolicyCall {
  2839  	c.ctx_ = ctx
  2840  	return c
  2841  }
  2842  
  2843  // Header returns a http.Header that can be modified by the caller to add
  2844  // headers to the request.
  2845  func (c *ProjectsLocationsInternalRangesGetIamPolicyCall) Header() http.Header {
  2846  	if c.header_ == nil {
  2847  		c.header_ = make(http.Header)
  2848  	}
  2849  	return c.header_
  2850  }
  2851  
  2852  func (c *ProjectsLocationsInternalRangesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  2853  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2854  	if c.ifNoneMatch_ != "" {
  2855  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2856  	}
  2857  	var body io.Reader = nil
  2858  	c.urlParams_.Set("alt", alt)
  2859  	c.urlParams_.Set("prettyPrint", "false")
  2860  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+resource}:getIamPolicy")
  2861  	urls += "?" + c.urlParams_.Encode()
  2862  	req, err := http.NewRequest("GET", urls, body)
  2863  	if err != nil {
  2864  		return nil, err
  2865  	}
  2866  	req.Header = reqHeaders
  2867  	googleapi.Expand(req.URL, map[string]string{
  2868  		"resource": c.resource,
  2869  	})
  2870  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2871  }
  2872  
  2873  // Do executes the "networkconnectivity.projects.locations.internalRanges.getIamPolicy" call.
  2874  // Any non-2xx status code is an error. Response headers are in either
  2875  // *Policy.ServerResponse.Header or (if a response was returned at all) in
  2876  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2877  // whether the returned error was because http.StatusNotModified was returned.
  2878  func (c *ProjectsLocationsInternalRangesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  2879  	gensupport.SetOptions(c.urlParams_, opts...)
  2880  	res, err := c.doRequest("json")
  2881  	if res != nil && res.StatusCode == http.StatusNotModified {
  2882  		if res.Body != nil {
  2883  			res.Body.Close()
  2884  		}
  2885  		return nil, gensupport.WrapError(&googleapi.Error{
  2886  			Code:   res.StatusCode,
  2887  			Header: res.Header,
  2888  		})
  2889  	}
  2890  	if err != nil {
  2891  		return nil, err
  2892  	}
  2893  	defer googleapi.CloseBody(res)
  2894  	if err := googleapi.CheckResponse(res); err != nil {
  2895  		return nil, gensupport.WrapError(err)
  2896  	}
  2897  	ret := &Policy{
  2898  		ServerResponse: googleapi.ServerResponse{
  2899  			Header:         res.Header,
  2900  			HTTPStatusCode: res.StatusCode,
  2901  		},
  2902  	}
  2903  	target := &ret
  2904  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2905  		return nil, err
  2906  	}
  2907  	return ret, nil
  2908  }
  2909  
  2910  type ProjectsLocationsInternalRangesListCall struct {
  2911  	s            *Service
  2912  	parent       string
  2913  	urlParams_   gensupport.URLParams
  2914  	ifNoneMatch_ string
  2915  	ctx_         context.Context
  2916  	header_      http.Header
  2917  }
  2918  
  2919  // List: Lists internal ranges in a given project and location.
  2920  //
  2921  // - parent: The parent resource's name.
  2922  func (r *ProjectsLocationsInternalRangesService) List(parent string) *ProjectsLocationsInternalRangesListCall {
  2923  	c := &ProjectsLocationsInternalRangesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2924  	c.parent = parent
  2925  	return c
  2926  }
  2927  
  2928  // Filter sets the optional parameter "filter": A filter expression that
  2929  // filters the results listed in the response.
  2930  func (c *ProjectsLocationsInternalRangesListCall) Filter(filter string) *ProjectsLocationsInternalRangesListCall {
  2931  	c.urlParams_.Set("filter", filter)
  2932  	return c
  2933  }
  2934  
  2935  // OrderBy sets the optional parameter "orderBy": Sort the results by a certain
  2936  // order.
  2937  func (c *ProjectsLocationsInternalRangesListCall) OrderBy(orderBy string) *ProjectsLocationsInternalRangesListCall {
  2938  	c.urlParams_.Set("orderBy", orderBy)
  2939  	return c
  2940  }
  2941  
  2942  // PageSize sets the optional parameter "pageSize": The maximum number of
  2943  // results per page that should be returned.
  2944  func (c *ProjectsLocationsInternalRangesListCall) PageSize(pageSize int64) *ProjectsLocationsInternalRangesListCall {
  2945  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  2946  	return c
  2947  }
  2948  
  2949  // PageToken sets the optional parameter "pageToken": The page token.
  2950  func (c *ProjectsLocationsInternalRangesListCall) PageToken(pageToken string) *ProjectsLocationsInternalRangesListCall {
  2951  	c.urlParams_.Set("pageToken", pageToken)
  2952  	return c
  2953  }
  2954  
  2955  // Fields allows partial responses to be retrieved. See
  2956  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2957  // details.
  2958  func (c *ProjectsLocationsInternalRangesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsInternalRangesListCall {
  2959  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2960  	return c
  2961  }
  2962  
  2963  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2964  // object's ETag matches the given value. This is useful for getting updates
  2965  // only after the object has changed since the last request.
  2966  func (c *ProjectsLocationsInternalRangesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsInternalRangesListCall {
  2967  	c.ifNoneMatch_ = entityTag
  2968  	return c
  2969  }
  2970  
  2971  // Context sets the context to be used in this call's Do method.
  2972  func (c *ProjectsLocationsInternalRangesListCall) Context(ctx context.Context) *ProjectsLocationsInternalRangesListCall {
  2973  	c.ctx_ = ctx
  2974  	return c
  2975  }
  2976  
  2977  // Header returns a http.Header that can be modified by the caller to add
  2978  // headers to the request.
  2979  func (c *ProjectsLocationsInternalRangesListCall) Header() http.Header {
  2980  	if c.header_ == nil {
  2981  		c.header_ = make(http.Header)
  2982  	}
  2983  	return c.header_
  2984  }
  2985  
  2986  func (c *ProjectsLocationsInternalRangesListCall) doRequest(alt string) (*http.Response, error) {
  2987  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2988  	if c.ifNoneMatch_ != "" {
  2989  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2990  	}
  2991  	var body io.Reader = nil
  2992  	c.urlParams_.Set("alt", alt)
  2993  	c.urlParams_.Set("prettyPrint", "false")
  2994  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/internalRanges")
  2995  	urls += "?" + c.urlParams_.Encode()
  2996  	req, err := http.NewRequest("GET", urls, body)
  2997  	if err != nil {
  2998  		return nil, err
  2999  	}
  3000  	req.Header = reqHeaders
  3001  	googleapi.Expand(req.URL, map[string]string{
  3002  		"parent": c.parent,
  3003  	})
  3004  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3005  }
  3006  
  3007  // Do executes the "networkconnectivity.projects.locations.internalRanges.list" call.
  3008  // Any non-2xx status code is an error. Response headers are in either
  3009  // *ListInternalRangesResponse.ServerResponse.Header or (if a response was
  3010  // returned at all) in error.(*googleapi.Error).Header. Use
  3011  // googleapi.IsNotModified to check whether the returned error was because
  3012  // http.StatusNotModified was returned.
  3013  func (c *ProjectsLocationsInternalRangesListCall) Do(opts ...googleapi.CallOption) (*ListInternalRangesResponse, error) {
  3014  	gensupport.SetOptions(c.urlParams_, opts...)
  3015  	res, err := c.doRequest("json")
  3016  	if res != nil && res.StatusCode == http.StatusNotModified {
  3017  		if res.Body != nil {
  3018  			res.Body.Close()
  3019  		}
  3020  		return nil, gensupport.WrapError(&googleapi.Error{
  3021  			Code:   res.StatusCode,
  3022  			Header: res.Header,
  3023  		})
  3024  	}
  3025  	if err != nil {
  3026  		return nil, err
  3027  	}
  3028  	defer googleapi.CloseBody(res)
  3029  	if err := googleapi.CheckResponse(res); err != nil {
  3030  		return nil, gensupport.WrapError(err)
  3031  	}
  3032  	ret := &ListInternalRangesResponse{
  3033  		ServerResponse: googleapi.ServerResponse{
  3034  			Header:         res.Header,
  3035  			HTTPStatusCode: res.StatusCode,
  3036  		},
  3037  	}
  3038  	target := &ret
  3039  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3040  		return nil, err
  3041  	}
  3042  	return ret, nil
  3043  }
  3044  
  3045  // Pages invokes f for each page of results.
  3046  // A non-nil error returned from f will halt the iteration.
  3047  // The provided context supersedes any context provided to the Context method.
  3048  func (c *ProjectsLocationsInternalRangesListCall) Pages(ctx context.Context, f func(*ListInternalRangesResponse) error) error {
  3049  	c.ctx_ = ctx
  3050  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  3051  	for {
  3052  		x, err := c.Do()
  3053  		if err != nil {
  3054  			return err
  3055  		}
  3056  		if err := f(x); err != nil {
  3057  			return err
  3058  		}
  3059  		if x.NextPageToken == "" {
  3060  			return nil
  3061  		}
  3062  		c.PageToken(x.NextPageToken)
  3063  	}
  3064  }
  3065  
  3066  type ProjectsLocationsInternalRangesPatchCall struct {
  3067  	s             *Service
  3068  	name          string
  3069  	internalrange *InternalRange
  3070  	urlParams_    gensupport.URLParams
  3071  	ctx_          context.Context
  3072  	header_       http.Header
  3073  }
  3074  
  3075  // Patch: Updates the parameters of a single internal range.
  3076  //
  3077  //   - name: Immutable. The name of an internal range. Format:
  3078  //     projects/{project}/locations/{location}/internalRanges/{internal_range}
  3079  //     See: https://google.aip.dev/122#fields-representing-resource-names.
  3080  func (r *ProjectsLocationsInternalRangesService) Patch(name string, internalrange *InternalRange) *ProjectsLocationsInternalRangesPatchCall {
  3081  	c := &ProjectsLocationsInternalRangesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3082  	c.name = name
  3083  	c.internalrange = internalrange
  3084  	return c
  3085  }
  3086  
  3087  // RequestId sets the optional parameter "requestId": An optional request ID to
  3088  // identify requests. Specify a unique request ID so that if you must retry
  3089  // your request, the server will know to ignore the request if it has already
  3090  // been completed. The server will guarantee that for at least 60 minutes since
  3091  // the first request. For example, consider a situation where you make an
  3092  // initial request and the request times out. If you make the request again
  3093  // with the same request ID, the server can check if the original operation
  3094  // with the same request ID was received, and if so, will ignore the second
  3095  // request. This prevents clients from accidentally creating duplicate
  3096  // commitments. The request ID must be a valid UUID with the exception that
  3097  // zero UUID is not supported (00000000-0000-0000-0000-000000000000).
  3098  func (c *ProjectsLocationsInternalRangesPatchCall) RequestId(requestId string) *ProjectsLocationsInternalRangesPatchCall {
  3099  	c.urlParams_.Set("requestId", requestId)
  3100  	return c
  3101  }
  3102  
  3103  // UpdateMask sets the optional parameter "updateMask": Field mask is used to
  3104  // specify the fields to be overwritten in the internal range resource by the
  3105  // update. The fields specified in the update_mask are relative to the
  3106  // resource, not the full request. A field will be overwritten if it is in the
  3107  // mask. If the user does not provide a mask then all fields will be
  3108  // overwritten.
  3109  func (c *ProjectsLocationsInternalRangesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsInternalRangesPatchCall {
  3110  	c.urlParams_.Set("updateMask", updateMask)
  3111  	return c
  3112  }
  3113  
  3114  // Fields allows partial responses to be retrieved. See
  3115  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3116  // details.
  3117  func (c *ProjectsLocationsInternalRangesPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsInternalRangesPatchCall {
  3118  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3119  	return c
  3120  }
  3121  
  3122  // Context sets the context to be used in this call's Do method.
  3123  func (c *ProjectsLocationsInternalRangesPatchCall) Context(ctx context.Context) *ProjectsLocationsInternalRangesPatchCall {
  3124  	c.ctx_ = ctx
  3125  	return c
  3126  }
  3127  
  3128  // Header returns a http.Header that can be modified by the caller to add
  3129  // headers to the request.
  3130  func (c *ProjectsLocationsInternalRangesPatchCall) Header() http.Header {
  3131  	if c.header_ == nil {
  3132  		c.header_ = make(http.Header)
  3133  	}
  3134  	return c.header_
  3135  }
  3136  
  3137  func (c *ProjectsLocationsInternalRangesPatchCall) doRequest(alt string) (*http.Response, error) {
  3138  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3139  	var body io.Reader = nil
  3140  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.internalrange)
  3141  	if err != nil {
  3142  		return nil, err
  3143  	}
  3144  	c.urlParams_.Set("alt", alt)
  3145  	c.urlParams_.Set("prettyPrint", "false")
  3146  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}")
  3147  	urls += "?" + c.urlParams_.Encode()
  3148  	req, err := http.NewRequest("PATCH", urls, body)
  3149  	if err != nil {
  3150  		return nil, err
  3151  	}
  3152  	req.Header = reqHeaders
  3153  	googleapi.Expand(req.URL, map[string]string{
  3154  		"name": c.name,
  3155  	})
  3156  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3157  }
  3158  
  3159  // Do executes the "networkconnectivity.projects.locations.internalRanges.patch" call.
  3160  // Any non-2xx status code is an error. Response headers are in either
  3161  // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was
  3162  // returned at all) in error.(*googleapi.Error).Header. Use
  3163  // googleapi.IsNotModified to check whether the returned error was because
  3164  // http.StatusNotModified was returned.
  3165  func (c *ProjectsLocationsInternalRangesPatchCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  3166  	gensupport.SetOptions(c.urlParams_, opts...)
  3167  	res, err := c.doRequest("json")
  3168  	if res != nil && res.StatusCode == http.StatusNotModified {
  3169  		if res.Body != nil {
  3170  			res.Body.Close()
  3171  		}
  3172  		return nil, gensupport.WrapError(&googleapi.Error{
  3173  			Code:   res.StatusCode,
  3174  			Header: res.Header,
  3175  		})
  3176  	}
  3177  	if err != nil {
  3178  		return nil, err
  3179  	}
  3180  	defer googleapi.CloseBody(res)
  3181  	if err := googleapi.CheckResponse(res); err != nil {
  3182  		return nil, gensupport.WrapError(err)
  3183  	}
  3184  	ret := &GoogleLongrunningOperation{
  3185  		ServerResponse: googleapi.ServerResponse{
  3186  			Header:         res.Header,
  3187  			HTTPStatusCode: res.StatusCode,
  3188  		},
  3189  	}
  3190  	target := &ret
  3191  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3192  		return nil, err
  3193  	}
  3194  	return ret, nil
  3195  }
  3196  
  3197  type ProjectsLocationsInternalRangesSetIamPolicyCall struct {
  3198  	s                   *Service
  3199  	resource            string
  3200  	setiampolicyrequest *SetIamPolicyRequest
  3201  	urlParams_          gensupport.URLParams
  3202  	ctx_                context.Context
  3203  	header_             http.Header
  3204  }
  3205  
  3206  // SetIamPolicy: Sets the access control policy on the specified resource.
  3207  // Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`,
  3208  // and `PERMISSION_DENIED` errors.
  3209  //
  3210  //   - resource: REQUIRED: The resource for which the policy is being specified.
  3211  //     See Resource names (https://cloud.google.com/apis/design/resource_names)
  3212  //     for the appropriate value for this field.
  3213  func (r *ProjectsLocationsInternalRangesService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsInternalRangesSetIamPolicyCall {
  3214  	c := &ProjectsLocationsInternalRangesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3215  	c.resource = resource
  3216  	c.setiampolicyrequest = setiampolicyrequest
  3217  	return c
  3218  }
  3219  
  3220  // Fields allows partial responses to be retrieved. See
  3221  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3222  // details.
  3223  func (c *ProjectsLocationsInternalRangesSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsInternalRangesSetIamPolicyCall {
  3224  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3225  	return c
  3226  }
  3227  
  3228  // Context sets the context to be used in this call's Do method.
  3229  func (c *ProjectsLocationsInternalRangesSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsInternalRangesSetIamPolicyCall {
  3230  	c.ctx_ = ctx
  3231  	return c
  3232  }
  3233  
  3234  // Header returns a http.Header that can be modified by the caller to add
  3235  // headers to the request.
  3236  func (c *ProjectsLocationsInternalRangesSetIamPolicyCall) Header() http.Header {
  3237  	if c.header_ == nil {
  3238  		c.header_ = make(http.Header)
  3239  	}
  3240  	return c.header_
  3241  }
  3242  
  3243  func (c *ProjectsLocationsInternalRangesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  3244  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3245  	var body io.Reader = nil
  3246  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
  3247  	if err != nil {
  3248  		return nil, err
  3249  	}
  3250  	c.urlParams_.Set("alt", alt)
  3251  	c.urlParams_.Set("prettyPrint", "false")
  3252  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+resource}:setIamPolicy")
  3253  	urls += "?" + c.urlParams_.Encode()
  3254  	req, err := http.NewRequest("POST", urls, body)
  3255  	if err != nil {
  3256  		return nil, err
  3257  	}
  3258  	req.Header = reqHeaders
  3259  	googleapi.Expand(req.URL, map[string]string{
  3260  		"resource": c.resource,
  3261  	})
  3262  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3263  }
  3264  
  3265  // Do executes the "networkconnectivity.projects.locations.internalRanges.setIamPolicy" call.
  3266  // Any non-2xx status code is an error. Response headers are in either
  3267  // *Policy.ServerResponse.Header or (if a response was returned at all) in
  3268  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3269  // whether the returned error was because http.StatusNotModified was returned.
  3270  func (c *ProjectsLocationsInternalRangesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  3271  	gensupport.SetOptions(c.urlParams_, opts...)
  3272  	res, err := c.doRequest("json")
  3273  	if res != nil && res.StatusCode == http.StatusNotModified {
  3274  		if res.Body != nil {
  3275  			res.Body.Close()
  3276  		}
  3277  		return nil, gensupport.WrapError(&googleapi.Error{
  3278  			Code:   res.StatusCode,
  3279  			Header: res.Header,
  3280  		})
  3281  	}
  3282  	if err != nil {
  3283  		return nil, err
  3284  	}
  3285  	defer googleapi.CloseBody(res)
  3286  	if err := googleapi.CheckResponse(res); err != nil {
  3287  		return nil, gensupport.WrapError(err)
  3288  	}
  3289  	ret := &Policy{
  3290  		ServerResponse: googleapi.ServerResponse{
  3291  			Header:         res.Header,
  3292  			HTTPStatusCode: res.StatusCode,
  3293  		},
  3294  	}
  3295  	target := &ret
  3296  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3297  		return nil, err
  3298  	}
  3299  	return ret, nil
  3300  }
  3301  
  3302  type ProjectsLocationsInternalRangesTestIamPermissionsCall struct {
  3303  	s                         *Service
  3304  	resource                  string
  3305  	testiampermissionsrequest *TestIamPermissionsRequest
  3306  	urlParams_                gensupport.URLParams
  3307  	ctx_                      context.Context
  3308  	header_                   http.Header
  3309  }
  3310  
  3311  // TestIamPermissions: Returns permissions that a caller has on the specified
  3312  // resource. If the resource does not exist, this will return an empty set of
  3313  // permissions, not a `NOT_FOUND` error. Note: This operation is designed to be
  3314  // used for building permission-aware UIs and command-line tools, not for
  3315  // authorization checking. This operation may "fail open" without warning.
  3316  //
  3317  //   - resource: REQUIRED: The resource for which the policy detail is being
  3318  //     requested. See Resource names
  3319  //     (https://cloud.google.com/apis/design/resource_names) for the appropriate
  3320  //     value for this field.
  3321  func (r *ProjectsLocationsInternalRangesService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsInternalRangesTestIamPermissionsCall {
  3322  	c := &ProjectsLocationsInternalRangesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3323  	c.resource = resource
  3324  	c.testiampermissionsrequest = testiampermissionsrequest
  3325  	return c
  3326  }
  3327  
  3328  // Fields allows partial responses to be retrieved. See
  3329  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3330  // details.
  3331  func (c *ProjectsLocationsInternalRangesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsInternalRangesTestIamPermissionsCall {
  3332  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3333  	return c
  3334  }
  3335  
  3336  // Context sets the context to be used in this call's Do method.
  3337  func (c *ProjectsLocationsInternalRangesTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsInternalRangesTestIamPermissionsCall {
  3338  	c.ctx_ = ctx
  3339  	return c
  3340  }
  3341  
  3342  // Header returns a http.Header that can be modified by the caller to add
  3343  // headers to the request.
  3344  func (c *ProjectsLocationsInternalRangesTestIamPermissionsCall) Header() http.Header {
  3345  	if c.header_ == nil {
  3346  		c.header_ = make(http.Header)
  3347  	}
  3348  	return c.header_
  3349  }
  3350  
  3351  func (c *ProjectsLocationsInternalRangesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  3352  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3353  	var body io.Reader = nil
  3354  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
  3355  	if err != nil {
  3356  		return nil, err
  3357  	}
  3358  	c.urlParams_.Set("alt", alt)
  3359  	c.urlParams_.Set("prettyPrint", "false")
  3360  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+resource}:testIamPermissions")
  3361  	urls += "?" + c.urlParams_.Encode()
  3362  	req, err := http.NewRequest("POST", urls, body)
  3363  	if err != nil {
  3364  		return nil, err
  3365  	}
  3366  	req.Header = reqHeaders
  3367  	googleapi.Expand(req.URL, map[string]string{
  3368  		"resource": c.resource,
  3369  	})
  3370  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3371  }
  3372  
  3373  // Do executes the "networkconnectivity.projects.locations.internalRanges.testIamPermissions" call.
  3374  // Any non-2xx status code is an error. Response headers are in either
  3375  // *TestIamPermissionsResponse.ServerResponse.Header or (if a response was
  3376  // returned at all) in error.(*googleapi.Error).Header. Use
  3377  // googleapi.IsNotModified to check whether the returned error was because
  3378  // http.StatusNotModified was returned.
  3379  func (c *ProjectsLocationsInternalRangesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
  3380  	gensupport.SetOptions(c.urlParams_, opts...)
  3381  	res, err := c.doRequest("json")
  3382  	if res != nil && res.StatusCode == http.StatusNotModified {
  3383  		if res.Body != nil {
  3384  			res.Body.Close()
  3385  		}
  3386  		return nil, gensupport.WrapError(&googleapi.Error{
  3387  			Code:   res.StatusCode,
  3388  			Header: res.Header,
  3389  		})
  3390  	}
  3391  	if err != nil {
  3392  		return nil, err
  3393  	}
  3394  	defer googleapi.CloseBody(res)
  3395  	if err := googleapi.CheckResponse(res); err != nil {
  3396  		return nil, gensupport.WrapError(err)
  3397  	}
  3398  	ret := &TestIamPermissionsResponse{
  3399  		ServerResponse: googleapi.ServerResponse{
  3400  			Header:         res.Header,
  3401  			HTTPStatusCode: res.StatusCode,
  3402  		},
  3403  	}
  3404  	target := &ret
  3405  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3406  		return nil, err
  3407  	}
  3408  	return ret, nil
  3409  }
  3410  
  3411  type ProjectsLocationsOperationsCancelCall struct {
  3412  	s                                       *Service
  3413  	name                                    string
  3414  	googlelongrunningcanceloperationrequest *GoogleLongrunningCancelOperationRequest
  3415  	urlParams_                              gensupport.URLParams
  3416  	ctx_                                    context.Context
  3417  	header_                                 http.Header
  3418  }
  3419  
  3420  // Cancel: Starts asynchronous cancellation on a long-running operation. The
  3421  // server makes a best effort to cancel the operation, but success is not
  3422  // guaranteed. If the server doesn't support this method, it returns
  3423  // `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or
  3424  // other methods to check whether the cancellation succeeded or whether the
  3425  // operation completed despite cancellation. On successful cancellation, the
  3426  // operation is not deleted; instead, it becomes an operation with an
  3427  // Operation.error value with a google.rpc.Status.code of 1, corresponding to
  3428  // `Code.CANCELLED`.
  3429  //
  3430  // - name: The name of the operation resource to be cancelled.
  3431  func (r *ProjectsLocationsOperationsService) Cancel(name string, googlelongrunningcanceloperationrequest *GoogleLongrunningCancelOperationRequest) *ProjectsLocationsOperationsCancelCall {
  3432  	c := &ProjectsLocationsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3433  	c.name = name
  3434  	c.googlelongrunningcanceloperationrequest = googlelongrunningcanceloperationrequest
  3435  	return c
  3436  }
  3437  
  3438  // Fields allows partial responses to be retrieved. See
  3439  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3440  // details.
  3441  func (c *ProjectsLocationsOperationsCancelCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsCancelCall {
  3442  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3443  	return c
  3444  }
  3445  
  3446  // Context sets the context to be used in this call's Do method.
  3447  func (c *ProjectsLocationsOperationsCancelCall) Context(ctx context.Context) *ProjectsLocationsOperationsCancelCall {
  3448  	c.ctx_ = ctx
  3449  	return c
  3450  }
  3451  
  3452  // Header returns a http.Header that can be modified by the caller to add
  3453  // headers to the request.
  3454  func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header {
  3455  	if c.header_ == nil {
  3456  		c.header_ = make(http.Header)
  3457  	}
  3458  	return c.header_
  3459  }
  3460  
  3461  func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) {
  3462  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3463  	var body io.Reader = nil
  3464  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlelongrunningcanceloperationrequest)
  3465  	if err != nil {
  3466  		return nil, err
  3467  	}
  3468  	c.urlParams_.Set("alt", alt)
  3469  	c.urlParams_.Set("prettyPrint", "false")
  3470  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}:cancel")
  3471  	urls += "?" + c.urlParams_.Encode()
  3472  	req, err := http.NewRequest("POST", urls, body)
  3473  	if err != nil {
  3474  		return nil, err
  3475  	}
  3476  	req.Header = reqHeaders
  3477  	googleapi.Expand(req.URL, map[string]string{
  3478  		"name": c.name,
  3479  	})
  3480  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3481  }
  3482  
  3483  // Do executes the "networkconnectivity.projects.locations.operations.cancel" call.
  3484  // Any non-2xx status code is an error. Response headers are in either
  3485  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  3486  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3487  // whether the returned error was because http.StatusNotModified was returned.
  3488  func (c *ProjectsLocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  3489  	gensupport.SetOptions(c.urlParams_, opts...)
  3490  	res, err := c.doRequest("json")
  3491  	if res != nil && res.StatusCode == http.StatusNotModified {
  3492  		if res.Body != nil {
  3493  			res.Body.Close()
  3494  		}
  3495  		return nil, gensupport.WrapError(&googleapi.Error{
  3496  			Code:   res.StatusCode,
  3497  			Header: res.Header,
  3498  		})
  3499  	}
  3500  	if err != nil {
  3501  		return nil, err
  3502  	}
  3503  	defer googleapi.CloseBody(res)
  3504  	if err := googleapi.CheckResponse(res); err != nil {
  3505  		return nil, gensupport.WrapError(err)
  3506  	}
  3507  	ret := &Empty{
  3508  		ServerResponse: googleapi.ServerResponse{
  3509  			Header:         res.Header,
  3510  			HTTPStatusCode: res.StatusCode,
  3511  		},
  3512  	}
  3513  	target := &ret
  3514  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3515  		return nil, err
  3516  	}
  3517  	return ret, nil
  3518  }
  3519  
  3520  type ProjectsLocationsOperationsDeleteCall struct {
  3521  	s          *Service
  3522  	name       string
  3523  	urlParams_ gensupport.URLParams
  3524  	ctx_       context.Context
  3525  	header_    http.Header
  3526  }
  3527  
  3528  // Delete: Deletes a long-running operation. This method indicates that the
  3529  // client is no longer interested in the operation result. It does not cancel
  3530  // the operation. If the server doesn't support this method, it returns
  3531  // `google.rpc.Code.UNIMPLEMENTED`.
  3532  //
  3533  // - name: The name of the operation resource to be deleted.
  3534  func (r *ProjectsLocationsOperationsService) Delete(name string) *ProjectsLocationsOperationsDeleteCall {
  3535  	c := &ProjectsLocationsOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3536  	c.name = name
  3537  	return c
  3538  }
  3539  
  3540  // Fields allows partial responses to be retrieved. See
  3541  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3542  // details.
  3543  func (c *ProjectsLocationsOperationsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsDeleteCall {
  3544  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3545  	return c
  3546  }
  3547  
  3548  // Context sets the context to be used in this call's Do method.
  3549  func (c *ProjectsLocationsOperationsDeleteCall) Context(ctx context.Context) *ProjectsLocationsOperationsDeleteCall {
  3550  	c.ctx_ = ctx
  3551  	return c
  3552  }
  3553  
  3554  // Header returns a http.Header that can be modified by the caller to add
  3555  // headers to the request.
  3556  func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header {
  3557  	if c.header_ == nil {
  3558  		c.header_ = make(http.Header)
  3559  	}
  3560  	return c.header_
  3561  }
  3562  
  3563  func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  3564  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  3565  	var body io.Reader = nil
  3566  	c.urlParams_.Set("alt", alt)
  3567  	c.urlParams_.Set("prettyPrint", "false")
  3568  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}")
  3569  	urls += "?" + c.urlParams_.Encode()
  3570  	req, err := http.NewRequest("DELETE", urls, body)
  3571  	if err != nil {
  3572  		return nil, err
  3573  	}
  3574  	req.Header = reqHeaders
  3575  	googleapi.Expand(req.URL, map[string]string{
  3576  		"name": c.name,
  3577  	})
  3578  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3579  }
  3580  
  3581  // Do executes the "networkconnectivity.projects.locations.operations.delete" call.
  3582  // Any non-2xx status code is an error. Response headers are in either
  3583  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  3584  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3585  // whether the returned error was because http.StatusNotModified was returned.
  3586  func (c *ProjectsLocationsOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  3587  	gensupport.SetOptions(c.urlParams_, opts...)
  3588  	res, err := c.doRequest("json")
  3589  	if res != nil && res.StatusCode == http.StatusNotModified {
  3590  		if res.Body != nil {
  3591  			res.Body.Close()
  3592  		}
  3593  		return nil, gensupport.WrapError(&googleapi.Error{
  3594  			Code:   res.StatusCode,
  3595  			Header: res.Header,
  3596  		})
  3597  	}
  3598  	if err != nil {
  3599  		return nil, err
  3600  	}
  3601  	defer googleapi.CloseBody(res)
  3602  	if err := googleapi.CheckResponse(res); err != nil {
  3603  		return nil, gensupport.WrapError(err)
  3604  	}
  3605  	ret := &Empty{
  3606  		ServerResponse: googleapi.ServerResponse{
  3607  			Header:         res.Header,
  3608  			HTTPStatusCode: res.StatusCode,
  3609  		},
  3610  	}
  3611  	target := &ret
  3612  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3613  		return nil, err
  3614  	}
  3615  	return ret, nil
  3616  }
  3617  
  3618  type ProjectsLocationsOperationsGetCall struct {
  3619  	s            *Service
  3620  	name         string
  3621  	urlParams_   gensupport.URLParams
  3622  	ifNoneMatch_ string
  3623  	ctx_         context.Context
  3624  	header_      http.Header
  3625  }
  3626  
  3627  // Get: Gets the latest state of a long-running operation. Clients can use this
  3628  // method to poll the operation result at intervals as recommended by the API
  3629  // service.
  3630  //
  3631  // - name: The name of the operation resource.
  3632  func (r *ProjectsLocationsOperationsService) Get(name string) *ProjectsLocationsOperationsGetCall {
  3633  	c := &ProjectsLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3634  	c.name = name
  3635  	return c
  3636  }
  3637  
  3638  // Fields allows partial responses to be retrieved. See
  3639  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3640  // details.
  3641  func (c *ProjectsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsGetCall {
  3642  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3643  	return c
  3644  }
  3645  
  3646  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  3647  // object's ETag matches the given value. This is useful for getting updates
  3648  // only after the object has changed since the last request.
  3649  func (c *ProjectsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsGetCall {
  3650  	c.ifNoneMatch_ = entityTag
  3651  	return c
  3652  }
  3653  
  3654  // Context sets the context to be used in this call's Do method.
  3655  func (c *ProjectsLocationsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsOperationsGetCall {
  3656  	c.ctx_ = ctx
  3657  	return c
  3658  }
  3659  
  3660  // Header returns a http.Header that can be modified by the caller to add
  3661  // headers to the request.
  3662  func (c *ProjectsLocationsOperationsGetCall) Header() http.Header {
  3663  	if c.header_ == nil {
  3664  		c.header_ = make(http.Header)
  3665  	}
  3666  	return c.header_
  3667  }
  3668  
  3669  func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  3670  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  3671  	if c.ifNoneMatch_ != "" {
  3672  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3673  	}
  3674  	var body io.Reader = nil
  3675  	c.urlParams_.Set("alt", alt)
  3676  	c.urlParams_.Set("prettyPrint", "false")
  3677  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}")
  3678  	urls += "?" + c.urlParams_.Encode()
  3679  	req, err := http.NewRequest("GET", urls, body)
  3680  	if err != nil {
  3681  		return nil, err
  3682  	}
  3683  	req.Header = reqHeaders
  3684  	googleapi.Expand(req.URL, map[string]string{
  3685  		"name": c.name,
  3686  	})
  3687  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3688  }
  3689  
  3690  // Do executes the "networkconnectivity.projects.locations.operations.get" call.
  3691  // Any non-2xx status code is an error. Response headers are in either
  3692  // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was
  3693  // returned at all) in error.(*googleapi.Error).Header. Use
  3694  // googleapi.IsNotModified to check whether the returned error was because
  3695  // http.StatusNotModified was returned.
  3696  func (c *ProjectsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  3697  	gensupport.SetOptions(c.urlParams_, opts...)
  3698  	res, err := c.doRequest("json")
  3699  	if res != nil && res.StatusCode == http.StatusNotModified {
  3700  		if res.Body != nil {
  3701  			res.Body.Close()
  3702  		}
  3703  		return nil, gensupport.WrapError(&googleapi.Error{
  3704  			Code:   res.StatusCode,
  3705  			Header: res.Header,
  3706  		})
  3707  	}
  3708  	if err != nil {
  3709  		return nil, err
  3710  	}
  3711  	defer googleapi.CloseBody(res)
  3712  	if err := googleapi.CheckResponse(res); err != nil {
  3713  		return nil, gensupport.WrapError(err)
  3714  	}
  3715  	ret := &GoogleLongrunningOperation{
  3716  		ServerResponse: googleapi.ServerResponse{
  3717  			Header:         res.Header,
  3718  			HTTPStatusCode: res.StatusCode,
  3719  		},
  3720  	}
  3721  	target := &ret
  3722  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3723  		return nil, err
  3724  	}
  3725  	return ret, nil
  3726  }
  3727  
  3728  type ProjectsLocationsOperationsListCall struct {
  3729  	s            *Service
  3730  	name         string
  3731  	urlParams_   gensupport.URLParams
  3732  	ifNoneMatch_ string
  3733  	ctx_         context.Context
  3734  	header_      http.Header
  3735  }
  3736  
  3737  // List: Lists operations that match the specified filter in the request. If
  3738  // the server doesn't support this method, it returns `UNIMPLEMENTED`.
  3739  //
  3740  // - name: The name of the operation's parent resource.
  3741  func (r *ProjectsLocationsOperationsService) List(name string) *ProjectsLocationsOperationsListCall {
  3742  	c := &ProjectsLocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3743  	c.name = name
  3744  	return c
  3745  }
  3746  
  3747  // Filter sets the optional parameter "filter": The standard list filter.
  3748  func (c *ProjectsLocationsOperationsListCall) Filter(filter string) *ProjectsLocationsOperationsListCall {
  3749  	c.urlParams_.Set("filter", filter)
  3750  	return c
  3751  }
  3752  
  3753  // PageSize sets the optional parameter "pageSize": The standard list page
  3754  // size.
  3755  func (c *ProjectsLocationsOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsOperationsListCall {
  3756  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  3757  	return c
  3758  }
  3759  
  3760  // PageToken sets the optional parameter "pageToken": The standard list page
  3761  // token.
  3762  func (c *ProjectsLocationsOperationsListCall) PageToken(pageToken string) *ProjectsLocationsOperationsListCall {
  3763  	c.urlParams_.Set("pageToken", pageToken)
  3764  	return c
  3765  }
  3766  
  3767  // Fields allows partial responses to be retrieved. See
  3768  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3769  // details.
  3770  func (c *ProjectsLocationsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsListCall {
  3771  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3772  	return c
  3773  }
  3774  
  3775  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  3776  // object's ETag matches the given value. This is useful for getting updates
  3777  // only after the object has changed since the last request.
  3778  func (c *ProjectsLocationsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsListCall {
  3779  	c.ifNoneMatch_ = entityTag
  3780  	return c
  3781  }
  3782  
  3783  // Context sets the context to be used in this call's Do method.
  3784  func (c *ProjectsLocationsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsOperationsListCall {
  3785  	c.ctx_ = ctx
  3786  	return c
  3787  }
  3788  
  3789  // Header returns a http.Header that can be modified by the caller to add
  3790  // headers to the request.
  3791  func (c *ProjectsLocationsOperationsListCall) Header() http.Header {
  3792  	if c.header_ == nil {
  3793  		c.header_ = make(http.Header)
  3794  	}
  3795  	return c.header_
  3796  }
  3797  
  3798  func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Response, error) {
  3799  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  3800  	if c.ifNoneMatch_ != "" {
  3801  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3802  	}
  3803  	var body io.Reader = nil
  3804  	c.urlParams_.Set("alt", alt)
  3805  	c.urlParams_.Set("prettyPrint", "false")
  3806  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}/operations")
  3807  	urls += "?" + c.urlParams_.Encode()
  3808  	req, err := http.NewRequest("GET", urls, body)
  3809  	if err != nil {
  3810  		return nil, err
  3811  	}
  3812  	req.Header = reqHeaders
  3813  	googleapi.Expand(req.URL, map[string]string{
  3814  		"name": c.name,
  3815  	})
  3816  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3817  }
  3818  
  3819  // Do executes the "networkconnectivity.projects.locations.operations.list" call.
  3820  // Any non-2xx status code is an error. Response headers are in either
  3821  // *GoogleLongrunningListOperationsResponse.ServerResponse.Header or (if a
  3822  // response was returned at all) in error.(*googleapi.Error).Header. Use
  3823  // googleapi.IsNotModified to check whether the returned error was because
  3824  // http.StatusNotModified was returned.
  3825  func (c *ProjectsLocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) {
  3826  	gensupport.SetOptions(c.urlParams_, opts...)
  3827  	res, err := c.doRequest("json")
  3828  	if res != nil && res.StatusCode == http.StatusNotModified {
  3829  		if res.Body != nil {
  3830  			res.Body.Close()
  3831  		}
  3832  		return nil, gensupport.WrapError(&googleapi.Error{
  3833  			Code:   res.StatusCode,
  3834  			Header: res.Header,
  3835  		})
  3836  	}
  3837  	if err != nil {
  3838  		return nil, err
  3839  	}
  3840  	defer googleapi.CloseBody(res)
  3841  	if err := googleapi.CheckResponse(res); err != nil {
  3842  		return nil, gensupport.WrapError(err)
  3843  	}
  3844  	ret := &GoogleLongrunningListOperationsResponse{
  3845  		ServerResponse: googleapi.ServerResponse{
  3846  			Header:         res.Header,
  3847  			HTTPStatusCode: res.StatusCode,
  3848  		},
  3849  	}
  3850  	target := &ret
  3851  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3852  		return nil, err
  3853  	}
  3854  	return ret, nil
  3855  }
  3856  
  3857  // Pages invokes f for each page of results.
  3858  // A non-nil error returned from f will halt the iteration.
  3859  // The provided context supersedes any context provided to the Context method.
  3860  func (c *ProjectsLocationsOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error {
  3861  	c.ctx_ = ctx
  3862  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  3863  	for {
  3864  		x, err := c.Do()
  3865  		if err != nil {
  3866  			return err
  3867  		}
  3868  		if err := f(x); err != nil {
  3869  			return err
  3870  		}
  3871  		if x.NextPageToken == "" {
  3872  			return nil
  3873  		}
  3874  		c.PageToken(x.NextPageToken)
  3875  	}
  3876  }
  3877  
  3878  type ProjectsLocationsSpokesCreateCall struct {
  3879  	s          *Service
  3880  	parent     string
  3881  	spoke      *Spoke
  3882  	urlParams_ gensupport.URLParams
  3883  	ctx_       context.Context
  3884  	header_    http.Header
  3885  }
  3886  
  3887  // Create: Creates a Network Connectivity Center spoke.
  3888  //
  3889  // - parent: The parent's resource name of the Spoke.
  3890  func (r *ProjectsLocationsSpokesService) Create(parent string, spoke *Spoke) *ProjectsLocationsSpokesCreateCall {
  3891  	c := &ProjectsLocationsSpokesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3892  	c.parent = parent
  3893  	c.spoke = spoke
  3894  	return c
  3895  }
  3896  
  3897  // RequestId sets the optional parameter "requestId": A request ID to identify
  3898  // requests. Specify a unique request ID so that if you must retry your
  3899  // request, the server will know to ignore the request if it has already been
  3900  // completed. The server guarantees that a request doesn't result in creation
  3901  // of duplicate commitments for at least 60 minutes. For example, consider a
  3902  // situation where you make an initial request and the request times out. If
  3903  // you make the request again with the same request ID, the server can check if
  3904  // original operation with the same request ID was received, and if so, will
  3905  // ignore the second request. This prevents clients from accidentally creating
  3906  // duplicate commitments. The request ID must be a valid UUID with the
  3907  // exception that zero UUID is not supported
  3908  // (00000000-0000-0000-0000-000000000000).
  3909  func (c *ProjectsLocationsSpokesCreateCall) RequestId(requestId string) *ProjectsLocationsSpokesCreateCall {
  3910  	c.urlParams_.Set("requestId", requestId)
  3911  	return c
  3912  }
  3913  
  3914  // SpokeId sets the optional parameter "spokeId": Unique id for the Spoke to
  3915  // create.
  3916  func (c *ProjectsLocationsSpokesCreateCall) SpokeId(spokeId string) *ProjectsLocationsSpokesCreateCall {
  3917  	c.urlParams_.Set("spokeId", spokeId)
  3918  	return c
  3919  }
  3920  
  3921  // Fields allows partial responses to be retrieved. See
  3922  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3923  // details.
  3924  func (c *ProjectsLocationsSpokesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsSpokesCreateCall {
  3925  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3926  	return c
  3927  }
  3928  
  3929  // Context sets the context to be used in this call's Do method.
  3930  func (c *ProjectsLocationsSpokesCreateCall) Context(ctx context.Context) *ProjectsLocationsSpokesCreateCall {
  3931  	c.ctx_ = ctx
  3932  	return c
  3933  }
  3934  
  3935  // Header returns a http.Header that can be modified by the caller to add
  3936  // headers to the request.
  3937  func (c *ProjectsLocationsSpokesCreateCall) Header() http.Header {
  3938  	if c.header_ == nil {
  3939  		c.header_ = make(http.Header)
  3940  	}
  3941  	return c.header_
  3942  }
  3943  
  3944  func (c *ProjectsLocationsSpokesCreateCall) doRequest(alt string) (*http.Response, error) {
  3945  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3946  	var body io.Reader = nil
  3947  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.spoke)
  3948  	if err != nil {
  3949  		return nil, err
  3950  	}
  3951  	c.urlParams_.Set("alt", alt)
  3952  	c.urlParams_.Set("prettyPrint", "false")
  3953  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/spokes")
  3954  	urls += "?" + c.urlParams_.Encode()
  3955  	req, err := http.NewRequest("POST", urls, body)
  3956  	if err != nil {
  3957  		return nil, err
  3958  	}
  3959  	req.Header = reqHeaders
  3960  	googleapi.Expand(req.URL, map[string]string{
  3961  		"parent": c.parent,
  3962  	})
  3963  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3964  }
  3965  
  3966  // Do executes the "networkconnectivity.projects.locations.spokes.create" call.
  3967  // Any non-2xx status code is an error. Response headers are in either
  3968  // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was
  3969  // returned at all) in error.(*googleapi.Error).Header. Use
  3970  // googleapi.IsNotModified to check whether the returned error was because
  3971  // http.StatusNotModified was returned.
  3972  func (c *ProjectsLocationsSpokesCreateCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  3973  	gensupport.SetOptions(c.urlParams_, opts...)
  3974  	res, err := c.doRequest("json")
  3975  	if res != nil && res.StatusCode == http.StatusNotModified {
  3976  		if res.Body != nil {
  3977  			res.Body.Close()
  3978  		}
  3979  		return nil, gensupport.WrapError(&googleapi.Error{
  3980  			Code:   res.StatusCode,
  3981  			Header: res.Header,
  3982  		})
  3983  	}
  3984  	if err != nil {
  3985  		return nil, err
  3986  	}
  3987  	defer googleapi.CloseBody(res)
  3988  	if err := googleapi.CheckResponse(res); err != nil {
  3989  		return nil, gensupport.WrapError(err)
  3990  	}
  3991  	ret := &GoogleLongrunningOperation{
  3992  		ServerResponse: googleapi.ServerResponse{
  3993  			Header:         res.Header,
  3994  			HTTPStatusCode: res.StatusCode,
  3995  		},
  3996  	}
  3997  	target := &ret
  3998  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3999  		return nil, err
  4000  	}
  4001  	return ret, nil
  4002  }
  4003  
  4004  type ProjectsLocationsSpokesDeleteCall struct {
  4005  	s          *Service
  4006  	name       string
  4007  	urlParams_ gensupport.URLParams
  4008  	ctx_       context.Context
  4009  	header_    http.Header
  4010  }
  4011  
  4012  // Delete: Deletes a Network Connectivity Center spoke.
  4013  //
  4014  // - name: The name of the Spoke to delete.
  4015  func (r *ProjectsLocationsSpokesService) Delete(name string) *ProjectsLocationsSpokesDeleteCall {
  4016  	c := &ProjectsLocationsSpokesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4017  	c.name = name
  4018  	return c
  4019  }
  4020  
  4021  // RequestId sets the optional parameter "requestId": A request ID to identify
  4022  // requests. Specify a unique request ID so that if you must retry your
  4023  // request, the server will know to ignore the request if it has already been
  4024  // completed. The server guarantees that a request doesn't result in creation
  4025  // of duplicate commitments for at least 60 minutes. For example, consider a
  4026  // situation where you make an initial request and the request times out. If
  4027  // you make the request again with the same request ID, the server can check if
  4028  // original operation with the same request ID was received, and if so, will
  4029  // ignore the second request. This prevents clients from accidentally creating
  4030  // duplicate commitments. The request ID must be a valid UUID with the
  4031  // exception that zero UUID is not supported
  4032  // (00000000-0000-0000-0000-000000000000).
  4033  func (c *ProjectsLocationsSpokesDeleteCall) RequestId(requestId string) *ProjectsLocationsSpokesDeleteCall {
  4034  	c.urlParams_.Set("requestId", requestId)
  4035  	return c
  4036  }
  4037  
  4038  // Fields allows partial responses to be retrieved. See
  4039  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4040  // details.
  4041  func (c *ProjectsLocationsSpokesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsSpokesDeleteCall {
  4042  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4043  	return c
  4044  }
  4045  
  4046  // Context sets the context to be used in this call's Do method.
  4047  func (c *ProjectsLocationsSpokesDeleteCall) Context(ctx context.Context) *ProjectsLocationsSpokesDeleteCall {
  4048  	c.ctx_ = ctx
  4049  	return c
  4050  }
  4051  
  4052  // Header returns a http.Header that can be modified by the caller to add
  4053  // headers to the request.
  4054  func (c *ProjectsLocationsSpokesDeleteCall) Header() http.Header {
  4055  	if c.header_ == nil {
  4056  		c.header_ = make(http.Header)
  4057  	}
  4058  	return c.header_
  4059  }
  4060  
  4061  func (c *ProjectsLocationsSpokesDeleteCall) doRequest(alt string) (*http.Response, error) {
  4062  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  4063  	var body io.Reader = nil
  4064  	c.urlParams_.Set("alt", alt)
  4065  	c.urlParams_.Set("prettyPrint", "false")
  4066  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}")
  4067  	urls += "?" + c.urlParams_.Encode()
  4068  	req, err := http.NewRequest("DELETE", urls, body)
  4069  	if err != nil {
  4070  		return nil, err
  4071  	}
  4072  	req.Header = reqHeaders
  4073  	googleapi.Expand(req.URL, map[string]string{
  4074  		"name": c.name,
  4075  	})
  4076  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4077  }
  4078  
  4079  // Do executes the "networkconnectivity.projects.locations.spokes.delete" call.
  4080  // Any non-2xx status code is an error. Response headers are in either
  4081  // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was
  4082  // returned at all) in error.(*googleapi.Error).Header. Use
  4083  // googleapi.IsNotModified to check whether the returned error was because
  4084  // http.StatusNotModified was returned.
  4085  func (c *ProjectsLocationsSpokesDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  4086  	gensupport.SetOptions(c.urlParams_, opts...)
  4087  	res, err := c.doRequest("json")
  4088  	if res != nil && res.StatusCode == http.StatusNotModified {
  4089  		if res.Body != nil {
  4090  			res.Body.Close()
  4091  		}
  4092  		return nil, gensupport.WrapError(&googleapi.Error{
  4093  			Code:   res.StatusCode,
  4094  			Header: res.Header,
  4095  		})
  4096  	}
  4097  	if err != nil {
  4098  		return nil, err
  4099  	}
  4100  	defer googleapi.CloseBody(res)
  4101  	if err := googleapi.CheckResponse(res); err != nil {
  4102  		return nil, gensupport.WrapError(err)
  4103  	}
  4104  	ret := &GoogleLongrunningOperation{
  4105  		ServerResponse: googleapi.ServerResponse{
  4106  			Header:         res.Header,
  4107  			HTTPStatusCode: res.StatusCode,
  4108  		},
  4109  	}
  4110  	target := &ret
  4111  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4112  		return nil, err
  4113  	}
  4114  	return ret, nil
  4115  }
  4116  
  4117  type ProjectsLocationsSpokesGetCall struct {
  4118  	s            *Service
  4119  	name         string
  4120  	urlParams_   gensupport.URLParams
  4121  	ifNoneMatch_ string
  4122  	ctx_         context.Context
  4123  	header_      http.Header
  4124  }
  4125  
  4126  // Get: Gets details about a Network Connectivity Center spoke.
  4127  //
  4128  // - name: The name of Spoke resource.
  4129  func (r *ProjectsLocationsSpokesService) Get(name string) *ProjectsLocationsSpokesGetCall {
  4130  	c := &ProjectsLocationsSpokesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4131  	c.name = name
  4132  	return c
  4133  }
  4134  
  4135  // Fields allows partial responses to be retrieved. See
  4136  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4137  // details.
  4138  func (c *ProjectsLocationsSpokesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsSpokesGetCall {
  4139  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4140  	return c
  4141  }
  4142  
  4143  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  4144  // object's ETag matches the given value. This is useful for getting updates
  4145  // only after the object has changed since the last request.
  4146  func (c *ProjectsLocationsSpokesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsSpokesGetCall {
  4147  	c.ifNoneMatch_ = entityTag
  4148  	return c
  4149  }
  4150  
  4151  // Context sets the context to be used in this call's Do method.
  4152  func (c *ProjectsLocationsSpokesGetCall) Context(ctx context.Context) *ProjectsLocationsSpokesGetCall {
  4153  	c.ctx_ = ctx
  4154  	return c
  4155  }
  4156  
  4157  // Header returns a http.Header that can be modified by the caller to add
  4158  // headers to the request.
  4159  func (c *ProjectsLocationsSpokesGetCall) Header() http.Header {
  4160  	if c.header_ == nil {
  4161  		c.header_ = make(http.Header)
  4162  	}
  4163  	return c.header_
  4164  }
  4165  
  4166  func (c *ProjectsLocationsSpokesGetCall) doRequest(alt string) (*http.Response, error) {
  4167  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  4168  	if c.ifNoneMatch_ != "" {
  4169  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4170  	}
  4171  	var body io.Reader = nil
  4172  	c.urlParams_.Set("alt", alt)
  4173  	c.urlParams_.Set("prettyPrint", "false")
  4174  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}")
  4175  	urls += "?" + c.urlParams_.Encode()
  4176  	req, err := http.NewRequest("GET", urls, body)
  4177  	if err != nil {
  4178  		return nil, err
  4179  	}
  4180  	req.Header = reqHeaders
  4181  	googleapi.Expand(req.URL, map[string]string{
  4182  		"name": c.name,
  4183  	})
  4184  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4185  }
  4186  
  4187  // Do executes the "networkconnectivity.projects.locations.spokes.get" call.
  4188  // Any non-2xx status code is an error. Response headers are in either
  4189  // *Spoke.ServerResponse.Header or (if a response was returned at all) in
  4190  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4191  // whether the returned error was because http.StatusNotModified was returned.
  4192  func (c *ProjectsLocationsSpokesGetCall) Do(opts ...googleapi.CallOption) (*Spoke, error) {
  4193  	gensupport.SetOptions(c.urlParams_, opts...)
  4194  	res, err := c.doRequest("json")
  4195  	if res != nil && res.StatusCode == http.StatusNotModified {
  4196  		if res.Body != nil {
  4197  			res.Body.Close()
  4198  		}
  4199  		return nil, gensupport.WrapError(&googleapi.Error{
  4200  			Code:   res.StatusCode,
  4201  			Header: res.Header,
  4202  		})
  4203  	}
  4204  	if err != nil {
  4205  		return nil, err
  4206  	}
  4207  	defer googleapi.CloseBody(res)
  4208  	if err := googleapi.CheckResponse(res); err != nil {
  4209  		return nil, gensupport.WrapError(err)
  4210  	}
  4211  	ret := &Spoke{
  4212  		ServerResponse: googleapi.ServerResponse{
  4213  			Header:         res.Header,
  4214  			HTTPStatusCode: res.StatusCode,
  4215  		},
  4216  	}
  4217  	target := &ret
  4218  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4219  		return nil, err
  4220  	}
  4221  	return ret, nil
  4222  }
  4223  
  4224  type ProjectsLocationsSpokesGetIamPolicyCall struct {
  4225  	s            *Service
  4226  	resource     string
  4227  	urlParams_   gensupport.URLParams
  4228  	ifNoneMatch_ string
  4229  	ctx_         context.Context
  4230  	header_      http.Header
  4231  }
  4232  
  4233  // GetIamPolicy: Gets the access control policy for a resource. Returns an
  4234  // empty policy if the resource exists and does not have a policy set.
  4235  //
  4236  //   - resource: REQUIRED: The resource for which the policy is being requested.
  4237  //     See Resource names (https://cloud.google.com/apis/design/resource_names)
  4238  //     for the appropriate value for this field.
  4239  func (r *ProjectsLocationsSpokesService) GetIamPolicy(resource string) *ProjectsLocationsSpokesGetIamPolicyCall {
  4240  	c := &ProjectsLocationsSpokesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4241  	c.resource = resource
  4242  	return c
  4243  }
  4244  
  4245  // OptionsRequestedPolicyVersion sets the optional parameter
  4246  // "options.requestedPolicyVersion": The maximum policy version that will be
  4247  // used to format the policy. Valid values are 0, 1, and 3. Requests specifying
  4248  // an invalid value will be rejected. Requests for policies with any
  4249  // conditional role bindings must specify version 3. Policies with no
  4250  // conditional role bindings may specify any valid value or leave the field
  4251  // unset. The policy in the response might use the policy version that you
  4252  // specified, or it might use a lower policy version. For example, if you
  4253  // specify version 3, but the policy has no conditional role bindings, the
  4254  // response uses version 1. To learn which resources support conditions in
  4255  // their IAM policies, see the IAM documentation
  4256  // (https://cloud.google.com/iam/help/conditions/resource-policies).
  4257  func (c *ProjectsLocationsSpokesGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsSpokesGetIamPolicyCall {
  4258  	c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
  4259  	return c
  4260  }
  4261  
  4262  // Fields allows partial responses to be retrieved. See
  4263  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4264  // details.
  4265  func (c *ProjectsLocationsSpokesGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsSpokesGetIamPolicyCall {
  4266  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4267  	return c
  4268  }
  4269  
  4270  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  4271  // object's ETag matches the given value. This is useful for getting updates
  4272  // only after the object has changed since the last request.
  4273  func (c *ProjectsLocationsSpokesGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsSpokesGetIamPolicyCall {
  4274  	c.ifNoneMatch_ = entityTag
  4275  	return c
  4276  }
  4277  
  4278  // Context sets the context to be used in this call's Do method.
  4279  func (c *ProjectsLocationsSpokesGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsSpokesGetIamPolicyCall {
  4280  	c.ctx_ = ctx
  4281  	return c
  4282  }
  4283  
  4284  // Header returns a http.Header that can be modified by the caller to add
  4285  // headers to the request.
  4286  func (c *ProjectsLocationsSpokesGetIamPolicyCall) Header() http.Header {
  4287  	if c.header_ == nil {
  4288  		c.header_ = make(http.Header)
  4289  	}
  4290  	return c.header_
  4291  }
  4292  
  4293  func (c *ProjectsLocationsSpokesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  4294  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  4295  	if c.ifNoneMatch_ != "" {
  4296  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4297  	}
  4298  	var body io.Reader = nil
  4299  	c.urlParams_.Set("alt", alt)
  4300  	c.urlParams_.Set("prettyPrint", "false")
  4301  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+resource}:getIamPolicy")
  4302  	urls += "?" + c.urlParams_.Encode()
  4303  	req, err := http.NewRequest("GET", urls, body)
  4304  	if err != nil {
  4305  		return nil, err
  4306  	}
  4307  	req.Header = reqHeaders
  4308  	googleapi.Expand(req.URL, map[string]string{
  4309  		"resource": c.resource,
  4310  	})
  4311  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4312  }
  4313  
  4314  // Do executes the "networkconnectivity.projects.locations.spokes.getIamPolicy" call.
  4315  // Any non-2xx status code is an error. Response headers are in either
  4316  // *Policy.ServerResponse.Header or (if a response was returned at all) in
  4317  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4318  // whether the returned error was because http.StatusNotModified was returned.
  4319  func (c *ProjectsLocationsSpokesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  4320  	gensupport.SetOptions(c.urlParams_, opts...)
  4321  	res, err := c.doRequest("json")
  4322  	if res != nil && res.StatusCode == http.StatusNotModified {
  4323  		if res.Body != nil {
  4324  			res.Body.Close()
  4325  		}
  4326  		return nil, gensupport.WrapError(&googleapi.Error{
  4327  			Code:   res.StatusCode,
  4328  			Header: res.Header,
  4329  		})
  4330  	}
  4331  	if err != nil {
  4332  		return nil, err
  4333  	}
  4334  	defer googleapi.CloseBody(res)
  4335  	if err := googleapi.CheckResponse(res); err != nil {
  4336  		return nil, gensupport.WrapError(err)
  4337  	}
  4338  	ret := &Policy{
  4339  		ServerResponse: googleapi.ServerResponse{
  4340  			Header:         res.Header,
  4341  			HTTPStatusCode: res.StatusCode,
  4342  		},
  4343  	}
  4344  	target := &ret
  4345  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4346  		return nil, err
  4347  	}
  4348  	return ret, nil
  4349  }
  4350  
  4351  type ProjectsLocationsSpokesListCall struct {
  4352  	s            *Service
  4353  	parent       string
  4354  	urlParams_   gensupport.URLParams
  4355  	ifNoneMatch_ string
  4356  	ctx_         context.Context
  4357  	header_      http.Header
  4358  }
  4359  
  4360  // List: Lists the Network Connectivity Center spokes in a specified project
  4361  // and location.
  4362  //
  4363  // - parent: The parent's resource name.
  4364  func (r *ProjectsLocationsSpokesService) List(parent string) *ProjectsLocationsSpokesListCall {
  4365  	c := &ProjectsLocationsSpokesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4366  	c.parent = parent
  4367  	return c
  4368  }
  4369  
  4370  // Filter sets the optional parameter "filter": A filter expression that
  4371  // filters the results listed in the response.
  4372  func (c *ProjectsLocationsSpokesListCall) Filter(filter string) *ProjectsLocationsSpokesListCall {
  4373  	c.urlParams_.Set("filter", filter)
  4374  	return c
  4375  }
  4376  
  4377  // OrderBy sets the optional parameter "orderBy": Sort the results by a certain
  4378  // order.
  4379  func (c *ProjectsLocationsSpokesListCall) OrderBy(orderBy string) *ProjectsLocationsSpokesListCall {
  4380  	c.urlParams_.Set("orderBy", orderBy)
  4381  	return c
  4382  }
  4383  
  4384  // PageSize sets the optional parameter "pageSize": The maximum number of
  4385  // results per page that should be returned.
  4386  func (c *ProjectsLocationsSpokesListCall) PageSize(pageSize int64) *ProjectsLocationsSpokesListCall {
  4387  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  4388  	return c
  4389  }
  4390  
  4391  // PageToken sets the optional parameter "pageToken": The page token.
  4392  func (c *ProjectsLocationsSpokesListCall) PageToken(pageToken string) *ProjectsLocationsSpokesListCall {
  4393  	c.urlParams_.Set("pageToken", pageToken)
  4394  	return c
  4395  }
  4396  
  4397  // Fields allows partial responses to be retrieved. See
  4398  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4399  // details.
  4400  func (c *ProjectsLocationsSpokesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsSpokesListCall {
  4401  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4402  	return c
  4403  }
  4404  
  4405  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  4406  // object's ETag matches the given value. This is useful for getting updates
  4407  // only after the object has changed since the last request.
  4408  func (c *ProjectsLocationsSpokesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsSpokesListCall {
  4409  	c.ifNoneMatch_ = entityTag
  4410  	return c
  4411  }
  4412  
  4413  // Context sets the context to be used in this call's Do method.
  4414  func (c *ProjectsLocationsSpokesListCall) Context(ctx context.Context) *ProjectsLocationsSpokesListCall {
  4415  	c.ctx_ = ctx
  4416  	return c
  4417  }
  4418  
  4419  // Header returns a http.Header that can be modified by the caller to add
  4420  // headers to the request.
  4421  func (c *ProjectsLocationsSpokesListCall) Header() http.Header {
  4422  	if c.header_ == nil {
  4423  		c.header_ = make(http.Header)
  4424  	}
  4425  	return c.header_
  4426  }
  4427  
  4428  func (c *ProjectsLocationsSpokesListCall) doRequest(alt string) (*http.Response, error) {
  4429  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  4430  	if c.ifNoneMatch_ != "" {
  4431  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4432  	}
  4433  	var body io.Reader = nil
  4434  	c.urlParams_.Set("alt", alt)
  4435  	c.urlParams_.Set("prettyPrint", "false")
  4436  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/spokes")
  4437  	urls += "?" + c.urlParams_.Encode()
  4438  	req, err := http.NewRequest("GET", urls, body)
  4439  	if err != nil {
  4440  		return nil, err
  4441  	}
  4442  	req.Header = reqHeaders
  4443  	googleapi.Expand(req.URL, map[string]string{
  4444  		"parent": c.parent,
  4445  	})
  4446  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4447  }
  4448  
  4449  // Do executes the "networkconnectivity.projects.locations.spokes.list" call.
  4450  // Any non-2xx status code is an error. Response headers are in either
  4451  // *ListSpokesResponse.ServerResponse.Header or (if a response was returned at
  4452  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  4453  // check whether the returned error was because http.StatusNotModified was
  4454  // returned.
  4455  func (c *ProjectsLocationsSpokesListCall) Do(opts ...googleapi.CallOption) (*ListSpokesResponse, error) {
  4456  	gensupport.SetOptions(c.urlParams_, opts...)
  4457  	res, err := c.doRequest("json")
  4458  	if res != nil && res.StatusCode == http.StatusNotModified {
  4459  		if res.Body != nil {
  4460  			res.Body.Close()
  4461  		}
  4462  		return nil, gensupport.WrapError(&googleapi.Error{
  4463  			Code:   res.StatusCode,
  4464  			Header: res.Header,
  4465  		})
  4466  	}
  4467  	if err != nil {
  4468  		return nil, err
  4469  	}
  4470  	defer googleapi.CloseBody(res)
  4471  	if err := googleapi.CheckResponse(res); err != nil {
  4472  		return nil, gensupport.WrapError(err)
  4473  	}
  4474  	ret := &ListSpokesResponse{
  4475  		ServerResponse: googleapi.ServerResponse{
  4476  			Header:         res.Header,
  4477  			HTTPStatusCode: res.StatusCode,
  4478  		},
  4479  	}
  4480  	target := &ret
  4481  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4482  		return nil, err
  4483  	}
  4484  	return ret, nil
  4485  }
  4486  
  4487  // Pages invokes f for each page of results.
  4488  // A non-nil error returned from f will halt the iteration.
  4489  // The provided context supersedes any context provided to the Context method.
  4490  func (c *ProjectsLocationsSpokesListCall) Pages(ctx context.Context, f func(*ListSpokesResponse) error) error {
  4491  	c.ctx_ = ctx
  4492  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  4493  	for {
  4494  		x, err := c.Do()
  4495  		if err != nil {
  4496  			return err
  4497  		}
  4498  		if err := f(x); err != nil {
  4499  			return err
  4500  		}
  4501  		if x.NextPageToken == "" {
  4502  			return nil
  4503  		}
  4504  		c.PageToken(x.NextPageToken)
  4505  	}
  4506  }
  4507  
  4508  type ProjectsLocationsSpokesPatchCall struct {
  4509  	s          *Service
  4510  	name       string
  4511  	spoke      *Spoke
  4512  	urlParams_ gensupport.URLParams
  4513  	ctx_       context.Context
  4514  	header_    http.Header
  4515  }
  4516  
  4517  // Patch: Updates the parameters of a Network Connectivity Center spoke.
  4518  //
  4519  // - name: Immutable. The name of a Spoke resource.
  4520  func (r *ProjectsLocationsSpokesService) Patch(name string, spoke *Spoke) *ProjectsLocationsSpokesPatchCall {
  4521  	c := &ProjectsLocationsSpokesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4522  	c.name = name
  4523  	c.spoke = spoke
  4524  	return c
  4525  }
  4526  
  4527  // RequestId sets the optional parameter "requestId": A request ID to identify
  4528  // requests. Specify a unique request ID so that if you must retry your
  4529  // request, the server will know to ignore the request if it has already been
  4530  // completed. The server guarantees that a request doesn't result in creation
  4531  // of duplicate commitments for at least 60 minutes. For example, consider a
  4532  // situation where you make an initial request and the request times out. If
  4533  // you make the request again with the same request ID, the server can check if
  4534  // original operation with the same request ID was received, and if so, will
  4535  // ignore the second request. This prevents clients from accidentally creating
  4536  // duplicate commitments. The request ID must be a valid UUID with the
  4537  // exception that zero UUID is not supported
  4538  // (00000000-0000-0000-0000-000000000000).
  4539  func (c *ProjectsLocationsSpokesPatchCall) RequestId(requestId string) *ProjectsLocationsSpokesPatchCall {
  4540  	c.urlParams_.Set("requestId", requestId)
  4541  	return c
  4542  }
  4543  
  4544  // UpdateMask sets the optional parameter "updateMask": Field mask is used to
  4545  // specify the fields to be overwritten in the Spoke resource by the update.
  4546  // The fields specified in the update_mask are relative to the resource, not
  4547  // the full request. A field will be overwritten if it is in the mask. If the
  4548  // user does not provide a mask then all fields will be overwritten.
  4549  func (c *ProjectsLocationsSpokesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsSpokesPatchCall {
  4550  	c.urlParams_.Set("updateMask", updateMask)
  4551  	return c
  4552  }
  4553  
  4554  // Fields allows partial responses to be retrieved. See
  4555  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4556  // details.
  4557  func (c *ProjectsLocationsSpokesPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsSpokesPatchCall {
  4558  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4559  	return c
  4560  }
  4561  
  4562  // Context sets the context to be used in this call's Do method.
  4563  func (c *ProjectsLocationsSpokesPatchCall) Context(ctx context.Context) *ProjectsLocationsSpokesPatchCall {
  4564  	c.ctx_ = ctx
  4565  	return c
  4566  }
  4567  
  4568  // Header returns a http.Header that can be modified by the caller to add
  4569  // headers to the request.
  4570  func (c *ProjectsLocationsSpokesPatchCall) Header() http.Header {
  4571  	if c.header_ == nil {
  4572  		c.header_ = make(http.Header)
  4573  	}
  4574  	return c.header_
  4575  }
  4576  
  4577  func (c *ProjectsLocationsSpokesPatchCall) doRequest(alt string) (*http.Response, error) {
  4578  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  4579  	var body io.Reader = nil
  4580  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.spoke)
  4581  	if err != nil {
  4582  		return nil, err
  4583  	}
  4584  	c.urlParams_.Set("alt", alt)
  4585  	c.urlParams_.Set("prettyPrint", "false")
  4586  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}")
  4587  	urls += "?" + c.urlParams_.Encode()
  4588  	req, err := http.NewRequest("PATCH", urls, body)
  4589  	if err != nil {
  4590  		return nil, err
  4591  	}
  4592  	req.Header = reqHeaders
  4593  	googleapi.Expand(req.URL, map[string]string{
  4594  		"name": c.name,
  4595  	})
  4596  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4597  }
  4598  
  4599  // Do executes the "networkconnectivity.projects.locations.spokes.patch" call.
  4600  // Any non-2xx status code is an error. Response headers are in either
  4601  // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was
  4602  // returned at all) in error.(*googleapi.Error).Header. Use
  4603  // googleapi.IsNotModified to check whether the returned error was because
  4604  // http.StatusNotModified was returned.
  4605  func (c *ProjectsLocationsSpokesPatchCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  4606  	gensupport.SetOptions(c.urlParams_, opts...)
  4607  	res, err := c.doRequest("json")
  4608  	if res != nil && res.StatusCode == http.StatusNotModified {
  4609  		if res.Body != nil {
  4610  			res.Body.Close()
  4611  		}
  4612  		return nil, gensupport.WrapError(&googleapi.Error{
  4613  			Code:   res.StatusCode,
  4614  			Header: res.Header,
  4615  		})
  4616  	}
  4617  	if err != nil {
  4618  		return nil, err
  4619  	}
  4620  	defer googleapi.CloseBody(res)
  4621  	if err := googleapi.CheckResponse(res); err != nil {
  4622  		return nil, gensupport.WrapError(err)
  4623  	}
  4624  	ret := &GoogleLongrunningOperation{
  4625  		ServerResponse: googleapi.ServerResponse{
  4626  			Header:         res.Header,
  4627  			HTTPStatusCode: res.StatusCode,
  4628  		},
  4629  	}
  4630  	target := &ret
  4631  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4632  		return nil, err
  4633  	}
  4634  	return ret, nil
  4635  }
  4636  
  4637  type ProjectsLocationsSpokesSetIamPolicyCall struct {
  4638  	s                   *Service
  4639  	resource            string
  4640  	setiampolicyrequest *SetIamPolicyRequest
  4641  	urlParams_          gensupport.URLParams
  4642  	ctx_                context.Context
  4643  	header_             http.Header
  4644  }
  4645  
  4646  // SetIamPolicy: Sets the access control policy on the specified resource.
  4647  // Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`,
  4648  // and `PERMISSION_DENIED` errors.
  4649  //
  4650  //   - resource: REQUIRED: The resource for which the policy is being specified.
  4651  //     See Resource names (https://cloud.google.com/apis/design/resource_names)
  4652  //     for the appropriate value for this field.
  4653  func (r *ProjectsLocationsSpokesService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsSpokesSetIamPolicyCall {
  4654  	c := &ProjectsLocationsSpokesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4655  	c.resource = resource
  4656  	c.setiampolicyrequest = setiampolicyrequest
  4657  	return c
  4658  }
  4659  
  4660  // Fields allows partial responses to be retrieved. See
  4661  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4662  // details.
  4663  func (c *ProjectsLocationsSpokesSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsSpokesSetIamPolicyCall {
  4664  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4665  	return c
  4666  }
  4667  
  4668  // Context sets the context to be used in this call's Do method.
  4669  func (c *ProjectsLocationsSpokesSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsSpokesSetIamPolicyCall {
  4670  	c.ctx_ = ctx
  4671  	return c
  4672  }
  4673  
  4674  // Header returns a http.Header that can be modified by the caller to add
  4675  // headers to the request.
  4676  func (c *ProjectsLocationsSpokesSetIamPolicyCall) Header() http.Header {
  4677  	if c.header_ == nil {
  4678  		c.header_ = make(http.Header)
  4679  	}
  4680  	return c.header_
  4681  }
  4682  
  4683  func (c *ProjectsLocationsSpokesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  4684  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  4685  	var body io.Reader = nil
  4686  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
  4687  	if err != nil {
  4688  		return nil, err
  4689  	}
  4690  	c.urlParams_.Set("alt", alt)
  4691  	c.urlParams_.Set("prettyPrint", "false")
  4692  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+resource}:setIamPolicy")
  4693  	urls += "?" + c.urlParams_.Encode()
  4694  	req, err := http.NewRequest("POST", urls, body)
  4695  	if err != nil {
  4696  		return nil, err
  4697  	}
  4698  	req.Header = reqHeaders
  4699  	googleapi.Expand(req.URL, map[string]string{
  4700  		"resource": c.resource,
  4701  	})
  4702  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4703  }
  4704  
  4705  // Do executes the "networkconnectivity.projects.locations.spokes.setIamPolicy" call.
  4706  // Any non-2xx status code is an error. Response headers are in either
  4707  // *Policy.ServerResponse.Header or (if a response was returned at all) in
  4708  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4709  // whether the returned error was because http.StatusNotModified was returned.
  4710  func (c *ProjectsLocationsSpokesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  4711  	gensupport.SetOptions(c.urlParams_, opts...)
  4712  	res, err := c.doRequest("json")
  4713  	if res != nil && res.StatusCode == http.StatusNotModified {
  4714  		if res.Body != nil {
  4715  			res.Body.Close()
  4716  		}
  4717  		return nil, gensupport.WrapError(&googleapi.Error{
  4718  			Code:   res.StatusCode,
  4719  			Header: res.Header,
  4720  		})
  4721  	}
  4722  	if err != nil {
  4723  		return nil, err
  4724  	}
  4725  	defer googleapi.CloseBody(res)
  4726  	if err := googleapi.CheckResponse(res); err != nil {
  4727  		return nil, gensupport.WrapError(err)
  4728  	}
  4729  	ret := &Policy{
  4730  		ServerResponse: googleapi.ServerResponse{
  4731  			Header:         res.Header,
  4732  			HTTPStatusCode: res.StatusCode,
  4733  		},
  4734  	}
  4735  	target := &ret
  4736  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4737  		return nil, err
  4738  	}
  4739  	return ret, nil
  4740  }
  4741  
  4742  type ProjectsLocationsSpokesTestIamPermissionsCall struct {
  4743  	s                         *Service
  4744  	resource                  string
  4745  	testiampermissionsrequest *TestIamPermissionsRequest
  4746  	urlParams_                gensupport.URLParams
  4747  	ctx_                      context.Context
  4748  	header_                   http.Header
  4749  }
  4750  
  4751  // TestIamPermissions: Returns permissions that a caller has on the specified
  4752  // resource. If the resource does not exist, this will return an empty set of
  4753  // permissions, not a `NOT_FOUND` error. Note: This operation is designed to be
  4754  // used for building permission-aware UIs and command-line tools, not for
  4755  // authorization checking. This operation may "fail open" without warning.
  4756  //
  4757  //   - resource: REQUIRED: The resource for which the policy detail is being
  4758  //     requested. See Resource names
  4759  //     (https://cloud.google.com/apis/design/resource_names) for the appropriate
  4760  //     value for this field.
  4761  func (r *ProjectsLocationsSpokesService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsSpokesTestIamPermissionsCall {
  4762  	c := &ProjectsLocationsSpokesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4763  	c.resource = resource
  4764  	c.testiampermissionsrequest = testiampermissionsrequest
  4765  	return c
  4766  }
  4767  
  4768  // Fields allows partial responses to be retrieved. See
  4769  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4770  // details.
  4771  func (c *ProjectsLocationsSpokesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsSpokesTestIamPermissionsCall {
  4772  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4773  	return c
  4774  }
  4775  
  4776  // Context sets the context to be used in this call's Do method.
  4777  func (c *ProjectsLocationsSpokesTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsSpokesTestIamPermissionsCall {
  4778  	c.ctx_ = ctx
  4779  	return c
  4780  }
  4781  
  4782  // Header returns a http.Header that can be modified by the caller to add
  4783  // headers to the request.
  4784  func (c *ProjectsLocationsSpokesTestIamPermissionsCall) Header() http.Header {
  4785  	if c.header_ == nil {
  4786  		c.header_ = make(http.Header)
  4787  	}
  4788  	return c.header_
  4789  }
  4790  
  4791  func (c *ProjectsLocationsSpokesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  4792  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  4793  	var body io.Reader = nil
  4794  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
  4795  	if err != nil {
  4796  		return nil, err
  4797  	}
  4798  	c.urlParams_.Set("alt", alt)
  4799  	c.urlParams_.Set("prettyPrint", "false")
  4800  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+resource}:testIamPermissions")
  4801  	urls += "?" + c.urlParams_.Encode()
  4802  	req, err := http.NewRequest("POST", urls, body)
  4803  	if err != nil {
  4804  		return nil, err
  4805  	}
  4806  	req.Header = reqHeaders
  4807  	googleapi.Expand(req.URL, map[string]string{
  4808  		"resource": c.resource,
  4809  	})
  4810  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4811  }
  4812  
  4813  // Do executes the "networkconnectivity.projects.locations.spokes.testIamPermissions" call.
  4814  // Any non-2xx status code is an error. Response headers are in either
  4815  // *TestIamPermissionsResponse.ServerResponse.Header or (if a response was
  4816  // returned at all) in error.(*googleapi.Error).Header. Use
  4817  // googleapi.IsNotModified to check whether the returned error was because
  4818  // http.StatusNotModified was returned.
  4819  func (c *ProjectsLocationsSpokesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
  4820  	gensupport.SetOptions(c.urlParams_, opts...)
  4821  	res, err := c.doRequest("json")
  4822  	if res != nil && res.StatusCode == http.StatusNotModified {
  4823  		if res.Body != nil {
  4824  			res.Body.Close()
  4825  		}
  4826  		return nil, gensupport.WrapError(&googleapi.Error{
  4827  			Code:   res.StatusCode,
  4828  			Header: res.Header,
  4829  		})
  4830  	}
  4831  	if err != nil {
  4832  		return nil, err
  4833  	}
  4834  	defer googleapi.CloseBody(res)
  4835  	if err := googleapi.CheckResponse(res); err != nil {
  4836  		return nil, gensupport.WrapError(err)
  4837  	}
  4838  	ret := &TestIamPermissionsResponse{
  4839  		ServerResponse: googleapi.ServerResponse{
  4840  			Header:         res.Header,
  4841  			HTTPStatusCode: res.StatusCode,
  4842  		},
  4843  	}
  4844  	target := &ret
  4845  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4846  		return nil, err
  4847  	}
  4848  	return ret, nil
  4849  }
  4850  

View as plain text