...

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

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

     1  // Copyright 2024 Google LLC.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  // Code generated file. DO NOT EDIT.
     6  
     7  // Package servicedirectory provides access to the Service Directory API.
     8  //
     9  // For product documentation, see: https://cloud.google.com/service-directory
    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/servicedirectory/v1beta1"
    27  //	...
    28  //	ctx := context.Background()
    29  //	servicedirectoryService, err := servicedirectory.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  //	servicedirectoryService, err := servicedirectory.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  //	servicedirectoryService, err := servicedirectory.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
    49  //
    50  // See [google.golang.org/api/option.ClientOption] for details on options.
    51  package servicedirectory // import "google.golang.org/api/servicedirectory/v1beta1"
    52  
    53  import (
    54  	"bytes"
    55  	"context"
    56  	"encoding/json"
    57  	"errors"
    58  	"fmt"
    59  	"io"
    60  	"net/http"
    61  	"net/url"
    62  	"strconv"
    63  	"strings"
    64  
    65  	googleapi "google.golang.org/api/googleapi"
    66  	internal "google.golang.org/api/internal"
    67  	gensupport "google.golang.org/api/internal/gensupport"
    68  	option "google.golang.org/api/option"
    69  	internaloption "google.golang.org/api/option/internaloption"
    70  	htransport "google.golang.org/api/transport/http"
    71  )
    72  
    73  // Always reference these packages, just in case the auto-generated code
    74  // below doesn't.
    75  var _ = bytes.NewBuffer
    76  var _ = strconv.Itoa
    77  var _ = fmt.Sprintf
    78  var _ = json.NewDecoder
    79  var _ = io.Copy
    80  var _ = url.Parse
    81  var _ = gensupport.MarshalJSON
    82  var _ = googleapi.Version
    83  var _ = errors.New
    84  var _ = strings.Replace
    85  var _ = context.Canceled
    86  var _ = internaloption.WithDefaultEndpoint
    87  var _ = internal.Version
    88  
    89  const apiId = "servicedirectory:v1beta1"
    90  const apiName = "servicedirectory"
    91  const apiVersion = "v1beta1"
    92  const basePath = "https://servicedirectory.googleapis.com/"
    93  const basePathTemplate = "https://servicedirectory.UNIVERSE_DOMAIN/"
    94  const mtlsBasePath = "https://servicedirectory.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 APIService.
   104  func NewService(ctx context.Context, opts ...option.ClientOption) (*APIService, 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 APIService. 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) (*APIService, error) {
   134  	if client == nil {
   135  		return nil, errors.New("client is nil")
   136  	}
   137  	s := &APIService{client: client, BasePath: basePath}
   138  	s.Projects = NewProjectsService(s)
   139  	return s, nil
   140  }
   141  
   142  type APIService 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 *APIService) userAgent() string {
   151  	if s.UserAgent == "" {
   152  		return googleapi.UserAgent
   153  	}
   154  	return googleapi.UserAgent + " " + s.UserAgent
   155  }
   156  
   157  func NewProjectsService(s *APIService) *ProjectsService {
   158  	rs := &ProjectsService{s: s}
   159  	rs.Locations = NewProjectsLocationsService(s)
   160  	return rs
   161  }
   162  
   163  type ProjectsService struct {
   164  	s *APIService
   165  
   166  	Locations *ProjectsLocationsService
   167  }
   168  
   169  func NewProjectsLocationsService(s *APIService) *ProjectsLocationsService {
   170  	rs := &ProjectsLocationsService{s: s}
   171  	rs.Namespaces = NewProjectsLocationsNamespacesService(s)
   172  	return rs
   173  }
   174  
   175  type ProjectsLocationsService struct {
   176  	s *APIService
   177  
   178  	Namespaces *ProjectsLocationsNamespacesService
   179  }
   180  
   181  func NewProjectsLocationsNamespacesService(s *APIService) *ProjectsLocationsNamespacesService {
   182  	rs := &ProjectsLocationsNamespacesService{s: s}
   183  	rs.Services = NewProjectsLocationsNamespacesServicesService(s)
   184  	rs.Workloads = NewProjectsLocationsNamespacesWorkloadsService(s)
   185  	return rs
   186  }
   187  
   188  type ProjectsLocationsNamespacesService struct {
   189  	s *APIService
   190  
   191  	Services *ProjectsLocationsNamespacesServicesService
   192  
   193  	Workloads *ProjectsLocationsNamespacesWorkloadsService
   194  }
   195  
   196  func NewProjectsLocationsNamespacesServicesService(s *APIService) *ProjectsLocationsNamespacesServicesService {
   197  	rs := &ProjectsLocationsNamespacesServicesService{s: s}
   198  	rs.Endpoints = NewProjectsLocationsNamespacesServicesEndpointsService(s)
   199  	return rs
   200  }
   201  
   202  type ProjectsLocationsNamespacesServicesService struct {
   203  	s *APIService
   204  
   205  	Endpoints *ProjectsLocationsNamespacesServicesEndpointsService
   206  }
   207  
   208  func NewProjectsLocationsNamespacesServicesEndpointsService(s *APIService) *ProjectsLocationsNamespacesServicesEndpointsService {
   209  	rs := &ProjectsLocationsNamespacesServicesEndpointsService{s: s}
   210  	return rs
   211  }
   212  
   213  type ProjectsLocationsNamespacesServicesEndpointsService struct {
   214  	s *APIService
   215  }
   216  
   217  func NewProjectsLocationsNamespacesWorkloadsService(s *APIService) *ProjectsLocationsNamespacesWorkloadsService {
   218  	rs := &ProjectsLocationsNamespacesWorkloadsService{s: s}
   219  	return rs
   220  }
   221  
   222  type ProjectsLocationsNamespacesWorkloadsService struct {
   223  	s *APIService
   224  }
   225  
   226  // Binding: Associates `members`, or principals, with a `role`.
   227  type Binding struct {
   228  	// Condition: The condition that is associated with this binding. If the
   229  	// condition evaluates to `true`, then this binding applies to the current
   230  	// request. If the condition evaluates to `false`, then this binding does not
   231  	// apply to the current request. However, a different role binding might grant
   232  	// the same role to one or more of the principals in this binding. To learn
   233  	// which resources support conditions in their IAM policies, see the IAM
   234  	// documentation
   235  	// (https://cloud.google.com/iam/help/conditions/resource-policies).
   236  	Condition *Expr `json:"condition,omitempty"`
   237  	// Members: Specifies the principals requesting access for a Google Cloud
   238  	// resource. `members` can have the following values: * `allUsers`: A special
   239  	// identifier that represents anyone who is on the internet; with or without a
   240  	// Google account. * `allAuthenticatedUsers`: A special identifier that
   241  	// represents anyone who is authenticated with a Google account or a service
   242  	// account. Does not include identities that come from external identity
   243  	// providers (IdPs) through identity federation. * `user:{emailid}`: An email
   244  	// address that represents a specific Google account. For example,
   245  	// `alice@example.com` . * `serviceAccount:{emailid}`: An email address that
   246  	// represents a Google service account. For example,
   247  	// `my-other-app@appspot.gserviceaccount.com`. *
   248  	// `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: An
   249  	// identifier for a Kubernetes service account
   250  	// (https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts).
   251  	// For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. *
   252  	// `group:{emailid}`: An email address that represents a Google group. For
   253  	// example, `admins@example.com`. * `domain:{domain}`: The G Suite domain
   254  	// (primary) that represents all the users of that domain. For example,
   255  	// `google.com` or `example.com`. *
   256  	// `principal://iam.googleapis.com/locations/global/workforcePools/{pool_id}/sub
   257  	// ject/{subject_attribute_value}`: A single identity in a workforce identity
   258  	// pool. *
   259  	// `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/
   260  	// group/{group_id}`: All workforce identities in a group. *
   261  	// `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/
   262  	// attribute.{attribute_name}/{attribute_value}`: All workforce identities with
   263  	// a specific attribute value. *
   264  	// `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/
   265  	// *`: All identities in a workforce identity pool. *
   266  	// `principal://iam.googleapis.com/projects/{project_number}/locations/global/wo
   267  	// rkloadIdentityPools/{pool_id}/subject/{subject_attribute_value}`: A single
   268  	// identity in a workload identity pool. *
   269  	// `principalSet://iam.googleapis.com/projects/{project_number}/locations/global
   270  	// /workloadIdentityPools/{pool_id}/group/{group_id}`: A workload identity pool
   271  	// group. *
   272  	// `principalSet://iam.googleapis.com/projects/{project_number}/locations/global
   273  	// /workloadIdentityPools/{pool_id}/attribute.{attribute_name}/{attribute_value}
   274  	// `: All identities in a workload identity pool with a certain attribute. *
   275  	// `principalSet://iam.googleapis.com/projects/{project_number}/locations/global
   276  	// /workloadIdentityPools/{pool_id}/*`: All identities in a workload identity
   277  	// pool. * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus
   278  	// unique identifier) representing a user that has been recently deleted. For
   279  	// example, `alice@example.com?uid=123456789012345678901`. If the user is
   280  	// recovered, this value reverts to `user:{emailid}` and the recovered user
   281  	// retains the role in the binding. *
   282  	// `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus
   283  	// unique identifier) representing a service account that has been recently
   284  	// deleted. For example,
   285  	// `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the
   286  	// service account is undeleted, this value reverts to
   287  	// `serviceAccount:{emailid}` and the undeleted service account retains the
   288  	// role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email
   289  	// address (plus unique identifier) representing a Google group that has been
   290  	// recently deleted. For example,
   291  	// `admins@example.com?uid=123456789012345678901`. If the group is recovered,
   292  	// this value reverts to `group:{emailid}` and the recovered group retains the
   293  	// role in the binding. *
   294  	// `deleted:principal://iam.googleapis.com/locations/global/workforcePools/{pool
   295  	// _id}/subject/{subject_attribute_value}`: Deleted single identity in a
   296  	// workforce identity pool. For example,
   297  	// `deleted:principal://iam.googleapis.com/locations/global/workforcePools/my-po
   298  	// ol-id/subject/my-subject-attribute-value`.
   299  	Members []string `json:"members,omitempty"`
   300  	// Role: Role that is assigned to the list of `members`, or principals. For
   301  	// example, `roles/viewer`, `roles/editor`, or `roles/owner`. For an overview
   302  	// of the IAM roles and permissions, see the IAM documentation
   303  	// (https://cloud.google.com/iam/docs/roles-overview). For a list of the
   304  	// available pre-defined roles, see here
   305  	// (https://cloud.google.com/iam/docs/understanding-roles).
   306  	Role string `json:"role,omitempty"`
   307  	// ForceSendFields is a list of field names (e.g. "Condition") to
   308  	// unconditionally include in API requests. By default, fields with empty or
   309  	// default values are omitted from API requests. See
   310  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   311  	// details.
   312  	ForceSendFields []string `json:"-"`
   313  	// NullFields is a list of field names (e.g. "Condition") to include in API
   314  	// requests with the JSON null value. By default, fields with empty values are
   315  	// omitted from API requests. See
   316  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   317  	NullFields []string `json:"-"`
   318  }
   319  
   320  func (s *Binding) MarshalJSON() ([]byte, error) {
   321  	type NoMethod Binding
   322  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   323  }
   324  
   325  // Empty: A generic empty message that you can re-use to avoid defining
   326  // duplicated empty messages in your APIs. A typical example is to use it as
   327  // the request or the response type of an API method. For instance: service Foo
   328  // { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }
   329  type Empty struct {
   330  	// ServerResponse contains the HTTP response code and headers from the server.
   331  	googleapi.ServerResponse `json:"-"`
   332  }
   333  
   334  // Endpoint: An individual endpoint that provides a service. The service must
   335  // already exist to create an endpoint.
   336  type Endpoint struct {
   337  	// Address: Optional. An IPv4 or IPv6 address. Service Directory rejects bad
   338  	// addresses like: * `8.8.8` * `8.8.8.8:53` * `test:bad:address` * `[::1]` *
   339  	// `[::1]:8080` Limited to 45 characters.
   340  	Address string `json:"address,omitempty"`
   341  	// CreateTime: Output only. The timestamp when the endpoint was created.
   342  	CreateTime string `json:"createTime,omitempty"`
   343  	// Metadata: Optional. Metadata for the endpoint. This data can be consumed by
   344  	// service clients. Restrictions: * The entire metadata dictionary may contain
   345  	// up to 512 characters, spread accoss all key-value pairs. Metadata that goes
   346  	// beyond this limit are rejected * Valid metadata keys have two segments: an
   347  	// optional prefix and name, separated by a slash (/). The name segment is
   348  	// required and must be 63 characters or less, beginning and ending with an
   349  	// alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), dots
   350  	// (.), and alphanumerics between. The prefix is optional. If specified, the
   351  	// prefix must be a DNS subdomain: a series of DNS labels separated by dots
   352  	// (.), not longer than 253 characters in total, followed by a slash (/).
   353  	// Metadata that fails to meet these requirements are rejected Note: This field
   354  	// is equivalent to the `annotations` field in the v1 API. They have the same
   355  	// syntax and read/write to the same location in Service Directory.
   356  	Metadata map[string]string `json:"metadata,omitempty"`
   357  	// Name: Immutable. The resource name for the endpoint in the format
   358  	// `projects/*/locations/*/namespaces/*/services/*/endpoints/*`.
   359  	Name string `json:"name,omitempty"`
   360  	// Network: Immutable. The Google Compute Engine network (VPC) of the endpoint
   361  	// in the format `projects//locations/global/networks/*`. The project must be
   362  	// specified by project number (project id is rejected). Incorrectly formatted
   363  	// networks are rejected, but no other validation is performed on this field
   364  	// (ex. network or project existence, reachability, or permissions).
   365  	Network string `json:"network,omitempty"`
   366  	// Port: Optional. Service Directory rejects values outside of `[0, 65535]`.
   367  	Port int64 `json:"port,omitempty"`
   368  	// Uid: Output only. A globally unique identifier (in UUID4 format) for this
   369  	// endpoint.
   370  	Uid string `json:"uid,omitempty"`
   371  	// UpdateTime: Output only. The timestamp when the endpoint was last updated.
   372  	UpdateTime string `json:"updateTime,omitempty"`
   373  
   374  	// ServerResponse contains the HTTP response code and headers from the server.
   375  	googleapi.ServerResponse `json:"-"`
   376  	// ForceSendFields is a list of field names (e.g. "Address") to unconditionally
   377  	// include in API requests. By default, fields with empty or default values are
   378  	// omitted from API requests. See
   379  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   380  	// details.
   381  	ForceSendFields []string `json:"-"`
   382  	// NullFields is a list of field names (e.g. "Address") to include in API
   383  	// requests with the JSON null value. By default, fields with empty values are
   384  	// omitted from API requests. See
   385  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   386  	NullFields []string `json:"-"`
   387  }
   388  
   389  func (s *Endpoint) MarshalJSON() ([]byte, error) {
   390  	type NoMethod Endpoint
   391  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   392  }
   393  
   394  // Expr: Represents a textual expression in the Common Expression Language
   395  // (CEL) syntax. CEL is a C-like expression language. The syntax and semantics
   396  // of CEL are documented at https://github.com/google/cel-spec. Example
   397  // (Comparison): title: "Summary size limit" description: "Determines if a
   398  // summary is less than 100 chars" expression: "document.summary.size() < 100"
   399  // Example (Equality): title: "Requestor is owner" description: "Determines if
   400  // requestor is the document owner" expression: "document.owner ==
   401  // request.auth.claims.email" Example (Logic): title: "Public documents"
   402  // description: "Determine whether the document should be publicly visible"
   403  // expression: "document.type != 'private' && document.type != 'internal'"
   404  // Example (Data Manipulation): title: "Notification string" description:
   405  // "Create a notification string with a timestamp." expression: "'New message
   406  // received at ' + string(document.create_time)" The exact variables and
   407  // functions that may be referenced within an expression are determined by the
   408  // service that evaluates it. See the service documentation for additional
   409  // information.
   410  type Expr struct {
   411  	// Description: Optional. Description of the expression. This is a longer text
   412  	// which describes the expression, e.g. when hovered over it in a UI.
   413  	Description string `json:"description,omitempty"`
   414  	// Expression: Textual representation of an expression in Common Expression
   415  	// Language syntax.
   416  	Expression string `json:"expression,omitempty"`
   417  	// Location: Optional. String indicating the location of the expression for
   418  	// error reporting, e.g. a file name and a position in the file.
   419  	Location string `json:"location,omitempty"`
   420  	// Title: Optional. Title for the expression, i.e. a short string describing
   421  	// its purpose. This can be used e.g. in UIs which allow to enter the
   422  	// expression.
   423  	Title string `json:"title,omitempty"`
   424  	// ForceSendFields is a list of field names (e.g. "Description") to
   425  	// unconditionally include in API requests. By default, fields with empty or
   426  	// default values are omitted from API requests. See
   427  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   428  	// details.
   429  	ForceSendFields []string `json:"-"`
   430  	// NullFields is a list of field names (e.g. "Description") to include in API
   431  	// requests with the JSON null value. By default, fields with empty values are
   432  	// omitted from API requests. See
   433  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   434  	NullFields []string `json:"-"`
   435  }
   436  
   437  func (s *Expr) MarshalJSON() ([]byte, error) {
   438  	type NoMethod Expr
   439  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   440  }
   441  
   442  // GetIamPolicyRequest: Request message for `GetIamPolicy` method.
   443  type GetIamPolicyRequest struct {
   444  	// Options: OPTIONAL: A `GetPolicyOptions` object for specifying options to
   445  	// `GetIamPolicy`.
   446  	Options *GetPolicyOptions `json:"options,omitempty"`
   447  	// ForceSendFields is a list of field names (e.g. "Options") to unconditionally
   448  	// include in API requests. By default, fields with empty or default values are
   449  	// omitted from API requests. See
   450  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   451  	// details.
   452  	ForceSendFields []string `json:"-"`
   453  	// NullFields is a list of field names (e.g. "Options") to include in API
   454  	// requests with the JSON null value. By default, fields with empty values are
   455  	// omitted from API requests. See
   456  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   457  	NullFields []string `json:"-"`
   458  }
   459  
   460  func (s *GetIamPolicyRequest) MarshalJSON() ([]byte, error) {
   461  	type NoMethod GetIamPolicyRequest
   462  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   463  }
   464  
   465  // GetPolicyOptions: Encapsulates settings provided to GetIamPolicy.
   466  type GetPolicyOptions struct {
   467  	// RequestedPolicyVersion: Optional. The maximum policy version that will be
   468  	// used to format the policy. Valid values are 0, 1, and 3. Requests specifying
   469  	// an invalid value will be rejected. Requests for policies with any
   470  	// conditional role bindings must specify version 3. Policies with no
   471  	// conditional role bindings may specify any valid value or leave the field
   472  	// unset. The policy in the response might use the policy version that you
   473  	// specified, or it might use a lower policy version. For example, if you
   474  	// specify version 3, but the policy has no conditional role bindings, the
   475  	// response uses version 1. To learn which resources support conditions in
   476  	// their IAM policies, see the IAM documentation
   477  	// (https://cloud.google.com/iam/help/conditions/resource-policies).
   478  	RequestedPolicyVersion int64 `json:"requestedPolicyVersion,omitempty"`
   479  	// ForceSendFields is a list of field names (e.g. "RequestedPolicyVersion") to
   480  	// unconditionally include in API requests. By default, fields with empty or
   481  	// default values are omitted from API requests. See
   482  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   483  	// details.
   484  	ForceSendFields []string `json:"-"`
   485  	// NullFields is a list of field names (e.g. "RequestedPolicyVersion") to
   486  	// include in API requests with the JSON null value. By default, fields with
   487  	// empty values are omitted from API requests. See
   488  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   489  	NullFields []string `json:"-"`
   490  }
   491  
   492  func (s *GetPolicyOptions) MarshalJSON() ([]byte, error) {
   493  	type NoMethod GetPolicyOptions
   494  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   495  }
   496  
   497  // ListEndpointsResponse: The response message for
   498  // RegistrationService.ListEndpoints.
   499  type ListEndpointsResponse struct {
   500  	// Endpoints: The list of endpoints.
   501  	Endpoints []*Endpoint `json:"endpoints,omitempty"`
   502  	// NextPageToken: Token to retrieve the next page of results, or empty if there
   503  	// are no more results in the list.
   504  	NextPageToken string `json:"nextPageToken,omitempty"`
   505  
   506  	// ServerResponse contains the HTTP response code and headers from the server.
   507  	googleapi.ServerResponse `json:"-"`
   508  	// ForceSendFields is a list of field names (e.g. "Endpoints") to
   509  	// unconditionally include in API requests. By default, fields with empty or
   510  	// default values are omitted from API requests. See
   511  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   512  	// details.
   513  	ForceSendFields []string `json:"-"`
   514  	// NullFields is a list of field names (e.g. "Endpoints") to include in API
   515  	// requests with the JSON null value. By default, fields with empty values are
   516  	// omitted from API requests. See
   517  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   518  	NullFields []string `json:"-"`
   519  }
   520  
   521  func (s *ListEndpointsResponse) MarshalJSON() ([]byte, error) {
   522  	type NoMethod ListEndpointsResponse
   523  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   524  }
   525  
   526  // ListLocationsResponse: The response message for Locations.ListLocations.
   527  type ListLocationsResponse struct {
   528  	// Locations: A list of locations that matches the specified filter in the
   529  	// request.
   530  	Locations []*Location `json:"locations,omitempty"`
   531  	// NextPageToken: The standard List next-page token.
   532  	NextPageToken string `json:"nextPageToken,omitempty"`
   533  
   534  	// ServerResponse contains the HTTP response code and headers from the server.
   535  	googleapi.ServerResponse `json:"-"`
   536  	// ForceSendFields is a list of field names (e.g. "Locations") to
   537  	// unconditionally include in API requests. By default, fields with empty or
   538  	// default values are omitted from API requests. See
   539  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   540  	// details.
   541  	ForceSendFields []string `json:"-"`
   542  	// NullFields is a list of field names (e.g. "Locations") to include in API
   543  	// requests with the JSON null value. By default, fields with empty values are
   544  	// omitted from API requests. See
   545  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   546  	NullFields []string `json:"-"`
   547  }
   548  
   549  func (s *ListLocationsResponse) MarshalJSON() ([]byte, error) {
   550  	type NoMethod ListLocationsResponse
   551  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   552  }
   553  
   554  // ListNamespacesResponse: The response message for
   555  // RegistrationService.ListNamespaces.
   556  type ListNamespacesResponse struct {
   557  	// Namespaces: The list of namespaces.
   558  	Namespaces []*Namespace `json:"namespaces,omitempty"`
   559  	// NextPageToken: Token to retrieve the next page of results, or empty if there
   560  	// are no more results in the list.
   561  	NextPageToken string `json:"nextPageToken,omitempty"`
   562  
   563  	// ServerResponse contains the HTTP response code and headers from the server.
   564  	googleapi.ServerResponse `json:"-"`
   565  	// ForceSendFields is a list of field names (e.g. "Namespaces") to
   566  	// unconditionally include in API requests. By default, fields with empty or
   567  	// default values are omitted from API requests. See
   568  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   569  	// details.
   570  	ForceSendFields []string `json:"-"`
   571  	// NullFields is a list of field names (e.g. "Namespaces") to include in API
   572  	// requests with the JSON null value. By default, fields with empty values are
   573  	// omitted from API requests. See
   574  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   575  	NullFields []string `json:"-"`
   576  }
   577  
   578  func (s *ListNamespacesResponse) MarshalJSON() ([]byte, error) {
   579  	type NoMethod ListNamespacesResponse
   580  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   581  }
   582  
   583  // ListServicesResponse: The response message for
   584  // RegistrationService.ListServices.
   585  type ListServicesResponse struct {
   586  	// NextPageToken: Token to retrieve the next page of results, or empty if there
   587  	// are no more results in the list.
   588  	NextPageToken string `json:"nextPageToken,omitempty"`
   589  	// Services: The list of services.
   590  	Services []*Service `json:"services,omitempty"`
   591  
   592  	// ServerResponse contains the HTTP response code and headers from the server.
   593  	googleapi.ServerResponse `json:"-"`
   594  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
   595  	// unconditionally include in API requests. By default, fields with empty or
   596  	// default values are omitted from API requests. See
   597  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   598  	// details.
   599  	ForceSendFields []string `json:"-"`
   600  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
   601  	// requests with the JSON null value. By default, fields with empty values are
   602  	// omitted from API requests. See
   603  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   604  	NullFields []string `json:"-"`
   605  }
   606  
   607  func (s *ListServicesResponse) MarshalJSON() ([]byte, error) {
   608  	type NoMethod ListServicesResponse
   609  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   610  }
   611  
   612  // Location: A resource that represents a Google Cloud location.
   613  type Location struct {
   614  	// DisplayName: The friendly name for this location, typically a nearby city
   615  	// name. For example, "Tokyo".
   616  	DisplayName string `json:"displayName,omitempty"`
   617  	// Labels: Cross-service attributes for the location. For example
   618  	// {"cloud.googleapis.com/region": "us-east1"}
   619  	Labels map[string]string `json:"labels,omitempty"`
   620  	// LocationId: The canonical id for this location. For example: "us-east1".
   621  	LocationId string `json:"locationId,omitempty"`
   622  	// Metadata: Service-specific metadata. For example the available capacity at
   623  	// the given location.
   624  	Metadata googleapi.RawMessage `json:"metadata,omitempty"`
   625  	// Name: Resource name for the location, which may vary between
   626  	// implementations. For example:
   627  	// "projects/example-project/locations/us-east1"
   628  	Name string `json:"name,omitempty"`
   629  
   630  	// ServerResponse contains the HTTP response code and headers from the server.
   631  	googleapi.ServerResponse `json:"-"`
   632  	// ForceSendFields is a list of field names (e.g. "DisplayName") to
   633  	// unconditionally include in API requests. By default, fields with empty or
   634  	// default values are omitted from API requests. See
   635  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   636  	// details.
   637  	ForceSendFields []string `json:"-"`
   638  	// NullFields is a list of field names (e.g. "DisplayName") to include in API
   639  	// requests with the JSON null value. By default, fields with empty values are
   640  	// omitted from API requests. See
   641  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   642  	NullFields []string `json:"-"`
   643  }
   644  
   645  func (s *Location) MarshalJSON() ([]byte, error) {
   646  	type NoMethod Location
   647  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   648  }
   649  
   650  // Namespace: A container for services. Namespaces allow administrators to
   651  // group services together and define permissions for a collection of services.
   652  type Namespace struct {
   653  	// CreateTime: Output only. The timestamp when the namespace was created.
   654  	CreateTime string `json:"createTime,omitempty"`
   655  	// Labels: Optional. Resource labels associated with this namespace. No more
   656  	// than 64 user labels can be associated with a given resource. Label keys and
   657  	// values can be no longer than 63 characters.
   658  	Labels map[string]string `json:"labels,omitempty"`
   659  	// Name: Immutable. The resource name for the namespace in the format
   660  	// `projects/*/locations/*/namespaces/*`.
   661  	Name string `json:"name,omitempty"`
   662  	// Uid: Output only. A globally unique identifier (in UUID4 format) for this
   663  	// namespace.
   664  	Uid string `json:"uid,omitempty"`
   665  	// UpdateTime: Output only. The timestamp when the namespace was last updated.
   666  	UpdateTime string `json:"updateTime,omitempty"`
   667  
   668  	// ServerResponse contains the HTTP response code and headers from the server.
   669  	googleapi.ServerResponse `json:"-"`
   670  	// ForceSendFields is a list of field names (e.g. "CreateTime") to
   671  	// unconditionally include in API requests. By default, fields with empty or
   672  	// default values are omitted from API requests. See
   673  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   674  	// details.
   675  	ForceSendFields []string `json:"-"`
   676  	// NullFields is a list of field names (e.g. "CreateTime") to include in API
   677  	// requests with the JSON null value. By default, fields with empty values are
   678  	// omitted from API requests. See
   679  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   680  	NullFields []string `json:"-"`
   681  }
   682  
   683  func (s *Namespace) MarshalJSON() ([]byte, error) {
   684  	type NoMethod Namespace
   685  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   686  }
   687  
   688  // Policy: An Identity and Access Management (IAM) policy, which specifies
   689  // access controls for Google Cloud resources. A `Policy` is a collection of
   690  // `bindings`. A `binding` binds one or more `members`, or principals, to a
   691  // single `role`. Principals can be user accounts, service accounts, Google
   692  // groups, and domains (such as G Suite). A `role` is a named list of
   693  // permissions; each `role` can be an IAM predefined role or a user-created
   694  // custom role. For some types of Google Cloud resources, a `binding` can also
   695  // specify a `condition`, which is a logical expression that allows access to a
   696  // resource only if the expression evaluates to `true`. A condition can add
   697  // constraints based on attributes of the request, the resource, or both. To
   698  // learn which resources support conditions in their IAM policies, see the IAM
   699  // documentation
   700  // (https://cloud.google.com/iam/help/conditions/resource-policies). **JSON
   701  // example:** ``` { "bindings": [ { "role":
   702  // "roles/resourcemanager.organizationAdmin", "members": [
   703  // "user:mike@example.com", "group:admins@example.com", "domain:google.com",
   704  // "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role":
   705  // "roles/resourcemanager.organizationViewer", "members": [
   706  // "user:eve@example.com" ], "condition": { "title": "expirable access",
   707  // "description": "Does not grant access after Sep 2020", "expression":
   708  // "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag":
   709  // "BwWWja0YfJA=", "version": 3 } ``` **YAML example:** ``` bindings: -
   710  // members: - user:mike@example.com - group:admins@example.com -
   711  // domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com
   712  // role: roles/resourcemanager.organizationAdmin - members: -
   713  // user:eve@example.com role: roles/resourcemanager.organizationViewer
   714  // condition: title: expirable access description: Does not grant access after
   715  // Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z')
   716  // etag: BwWWja0YfJA= version: 3 ``` For a description of IAM and its features,
   717  // see the IAM documentation (https://cloud.google.com/iam/docs/).
   718  type Policy struct {
   719  	// Bindings: Associates a list of `members`, or principals, with a `role`.
   720  	// Optionally, may specify a `condition` that determines how and when the
   721  	// `bindings` are applied. Each of the `bindings` must contain at least one
   722  	// principal. The `bindings` in a `Policy` can refer to up to 1,500 principals;
   723  	// up to 250 of these principals can be Google groups. Each occurrence of a
   724  	// principal counts towards these limits. For example, if the `bindings` grant
   725  	// 50 different roles to `user:alice@example.com`, and not to any other
   726  	// principal, then you can add another 1,450 principals to the `bindings` in
   727  	// the `Policy`.
   728  	Bindings []*Binding `json:"bindings,omitempty"`
   729  	// Etag: `etag` is used for optimistic concurrency control as a way to help
   730  	// prevent simultaneous updates of a policy from overwriting each other. It is
   731  	// strongly suggested that systems make use of the `etag` in the
   732  	// read-modify-write cycle to perform policy updates in order to avoid race
   733  	// conditions: An `etag` is returned in the response to `getIamPolicy`, and
   734  	// systems are expected to put that etag in the request to `setIamPolicy` to
   735  	// ensure that their change will be applied to the same version of the policy.
   736  	// **Important:** If you use IAM Conditions, you must include the `etag` field
   737  	// whenever you call `setIamPolicy`. If you omit this field, then IAM allows
   738  	// you to overwrite a version `3` policy with a version `1` policy, and all of
   739  	// the conditions in the version `3` policy are lost.
   740  	Etag string `json:"etag,omitempty"`
   741  	// Version: Specifies the format of the policy. Valid values are `0`, `1`, and
   742  	// `3`. Requests that specify an invalid value are rejected. Any operation that
   743  	// affects conditional role bindings must specify version `3`. This requirement
   744  	// applies to the following operations: * Getting a policy that includes a
   745  	// conditional role binding * Adding a conditional role binding to a policy *
   746  	// Changing a conditional role binding in a policy * Removing any role binding,
   747  	// with or without a condition, from a policy that includes conditions
   748  	// **Important:** If you use IAM Conditions, you must include the `etag` field
   749  	// whenever you call `setIamPolicy`. If you omit this field, then IAM allows
   750  	// you to overwrite a version `3` policy with a version `1` policy, and all of
   751  	// the conditions in the version `3` policy are lost. If a policy does not
   752  	// include any conditions, operations on that policy may specify any valid
   753  	// version or leave the field unset. To learn which resources support
   754  	// conditions in their IAM policies, see the IAM documentation
   755  	// (https://cloud.google.com/iam/help/conditions/resource-policies).
   756  	Version int64 `json:"version,omitempty"`
   757  
   758  	// ServerResponse contains the HTTP response code and headers from the server.
   759  	googleapi.ServerResponse `json:"-"`
   760  	// ForceSendFields is a list of field names (e.g. "Bindings") to
   761  	// unconditionally include in API requests. By default, fields with empty or
   762  	// default values are omitted from API requests. See
   763  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   764  	// details.
   765  	ForceSendFields []string `json:"-"`
   766  	// NullFields is a list of field names (e.g. "Bindings") to include in API
   767  	// requests with the JSON null value. By default, fields with empty values are
   768  	// omitted from API requests. See
   769  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   770  	NullFields []string `json:"-"`
   771  }
   772  
   773  func (s *Policy) MarshalJSON() ([]byte, error) {
   774  	type NoMethod Policy
   775  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   776  }
   777  
   778  // ResolveServiceRequest: The request message for LookupService.ResolveService.
   779  // Looks up a service by its name, returns the service and its endpoints.
   780  type ResolveServiceRequest struct {
   781  	// EndpointFilter: Optional. The filter applied to the endpoints of the
   782  	// resolved service. General `filter` string syntax: ` ()` * `` can be `name`,
   783  	// `address`, `port`, or `metadata.` for map field * `` can be `<`, `>`, `<=`,
   784  	// `>=`, `!=`, `=`, `:`. Of which `:` means `HAS`, and is roughly the same as
   785  	// `=` * `` must be the same data type as field * `` can be `AND`, `OR`, `NOT`
   786  	// Examples of valid filters: * `metadata.owner` returns endpoints that have a
   787  	// annotation with the key `owner`, this is the same as `metadata:owner` *
   788  	// `metadata.protocol=gRPC` returns endpoints that have key/value
   789  	// `protocol=gRPC` * `address=192.108.1.105` returns endpoints that have this
   790  	// address * `port>8080` returns endpoints that have port number larger than
   791  	// 8080 *
   792  	// `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services
   793  	// /my-service/endpoints/endpoint-c` returns endpoints that have name that is
   794  	// alphabetically later than the string, so "endpoint-e" is returned but
   795  	// "endpoint-a" is not *
   796  	// `name=projects/my-project/locations/us-central1/namespaces/my-namespace/servi
   797  	// ces/my-service/endpoints/ep-1` returns the endpoint that has an endpoint_id
   798  	// equal to `ep-1` * `metadata.owner!=sd AND metadata.foo=bar` returns
   799  	// endpoints that have `owner` in annotation key but value is not `sd` AND have
   800  	// key/value `foo=bar` * `doesnotexist.foo=bar` returns an empty list. Note
   801  	// that endpoint doesn't have a field called "doesnotexist". Since the filter
   802  	// does not match any endpoint, it returns no results For more information
   803  	// about filtering, see API Filtering (https://aip.dev/160).
   804  	EndpointFilter string `json:"endpointFilter,omitempty"`
   805  	// MaxEndpoints: Optional. The maximum number of endpoints to return. Defaults
   806  	// to 25. Maximum is 100. If a value less than one is specified, the Default is
   807  	// used. If a value greater than the Maximum is specified, the Maximum is used.
   808  	MaxEndpoints int64 `json:"maxEndpoints,omitempty"`
   809  	// ForceSendFields is a list of field names (e.g. "EndpointFilter") to
   810  	// unconditionally include in API requests. By default, fields with empty or
   811  	// default values are omitted from API requests. See
   812  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   813  	// details.
   814  	ForceSendFields []string `json:"-"`
   815  	// NullFields is a list of field names (e.g. "EndpointFilter") to include in
   816  	// API requests with the JSON null value. By default, fields with empty values
   817  	// are omitted from API requests. See
   818  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   819  	NullFields []string `json:"-"`
   820  }
   821  
   822  func (s *ResolveServiceRequest) MarshalJSON() ([]byte, error) {
   823  	type NoMethod ResolveServiceRequest
   824  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   825  }
   826  
   827  // ResolveServiceResponse: The response message for
   828  // LookupService.ResolveService.
   829  type ResolveServiceResponse struct {
   830  	Service *Service `json:"service,omitempty"`
   831  
   832  	// ServerResponse contains the HTTP response code and headers from the server.
   833  	googleapi.ServerResponse `json:"-"`
   834  	// ForceSendFields is a list of field names (e.g. "Service") to unconditionally
   835  	// include in API requests. By default, fields with empty or default values are
   836  	// omitted from API requests. See
   837  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   838  	// details.
   839  	ForceSendFields []string `json:"-"`
   840  	// NullFields is a list of field names (e.g. "Service") to include in API
   841  	// requests with the JSON null value. By default, fields with empty values are
   842  	// omitted from API requests. See
   843  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   844  	NullFields []string `json:"-"`
   845  }
   846  
   847  func (s *ResolveServiceResponse) MarshalJSON() ([]byte, error) {
   848  	type NoMethod ResolveServiceResponse
   849  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   850  }
   851  
   852  // Service: An individual service. A service contains a name and optional
   853  // metadata. A service must exist before endpoints can be added to it.
   854  type Service struct {
   855  	// CreateTime: Output only. The timestamp when the service was created.
   856  	CreateTime string `json:"createTime,omitempty"`
   857  	// Endpoints: Output only. Endpoints associated with this service. Returned on
   858  	// LookupService.ResolveService. Control plane clients should use
   859  	// RegistrationService.ListEndpoints.
   860  	Endpoints []*Endpoint `json:"endpoints,omitempty"`
   861  	// Metadata: Optional. Metadata for the service. This data can be consumed by
   862  	// service clients. Restrictions: * The entire metadata dictionary may contain
   863  	// up to 2000 characters, spread accoss all key-value pairs. Metadata that goes
   864  	// beyond this limit are rejected * Valid metadata keys have two segments: an
   865  	// optional prefix and name, separated by a slash (/). The name segment is
   866  	// required and must be 63 characters or less, beginning and ending with an
   867  	// alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), dots
   868  	// (.), and alphanumerics between. The prefix is optional. If specified, the
   869  	// prefix must be a DNS subdomain: a series of DNS labels separated by dots
   870  	// (.), not longer than 253 characters in total, followed by a slash (/).
   871  	// Metadata that fails to meet these requirements are rejected Note: This field
   872  	// is equivalent to the `annotations` field in the v1 API. They have the same
   873  	// syntax and read/write to the same location in Service Directory.
   874  	Metadata map[string]string `json:"metadata,omitempty"`
   875  	// Name: Immutable. The resource name for the service in the format
   876  	// `projects/*/locations/*/namespaces/*/services/*`.
   877  	Name string `json:"name,omitempty"`
   878  	// Uid: Output only. A globally unique identifier (in UUID4 format) for this
   879  	// service.
   880  	Uid string `json:"uid,omitempty"`
   881  	// UpdateTime: Output only. The timestamp when the service was last updated.
   882  	// Note: endpoints being created/deleted/updated within the service are not
   883  	// considered service updates for the purpose of this timestamp.
   884  	UpdateTime string `json:"updateTime,omitempty"`
   885  
   886  	// ServerResponse contains the HTTP response code and headers from the server.
   887  	googleapi.ServerResponse `json:"-"`
   888  	// ForceSendFields is a list of field names (e.g. "CreateTime") to
   889  	// unconditionally include in API requests. By default, fields with empty or
   890  	// default values are omitted from API requests. See
   891  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   892  	// details.
   893  	ForceSendFields []string `json:"-"`
   894  	// NullFields is a list of field names (e.g. "CreateTime") to include in API
   895  	// requests with the JSON null value. By default, fields with empty values are
   896  	// omitted from API requests. See
   897  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   898  	NullFields []string `json:"-"`
   899  }
   900  
   901  func (s *Service) MarshalJSON() ([]byte, error) {
   902  	type NoMethod Service
   903  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   904  }
   905  
   906  // SetIamPolicyRequest: Request message for `SetIamPolicy` method.
   907  type SetIamPolicyRequest struct {
   908  	// Policy: REQUIRED: The complete policy to be applied to the `resource`. The
   909  	// size of the policy is limited to a few 10s of KB. An empty policy is a valid
   910  	// policy but certain Google Cloud services (such as Projects) might reject
   911  	// them.
   912  	Policy *Policy `json:"policy,omitempty"`
   913  	// ForceSendFields is a list of field names (e.g. "Policy") to unconditionally
   914  	// include in API requests. By default, fields with empty or default values are
   915  	// omitted from API requests. See
   916  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   917  	// details.
   918  	ForceSendFields []string `json:"-"`
   919  	// NullFields is a list of field names (e.g. "Policy") to include in API
   920  	// requests with the JSON null value. By default, fields with empty values are
   921  	// omitted from API requests. See
   922  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   923  	NullFields []string `json:"-"`
   924  }
   925  
   926  func (s *SetIamPolicyRequest) MarshalJSON() ([]byte, error) {
   927  	type NoMethod SetIamPolicyRequest
   928  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   929  }
   930  
   931  // TestIamPermissionsRequest: Request message for `TestIamPermissions` method.
   932  type TestIamPermissionsRequest struct {
   933  	// Permissions: The set of permissions to check for the `resource`. Permissions
   934  	// with wildcards (such as `*` or `storage.*`) are not allowed. For more
   935  	// information see IAM Overview
   936  	// (https://cloud.google.com/iam/docs/overview#permissions).
   937  	Permissions []string `json:"permissions,omitempty"`
   938  	// ForceSendFields is a list of field names (e.g. "Permissions") to
   939  	// unconditionally include in API requests. By default, fields with empty or
   940  	// default values are omitted from API requests. See
   941  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   942  	// details.
   943  	ForceSendFields []string `json:"-"`
   944  	// NullFields is a list of field names (e.g. "Permissions") to include in API
   945  	// requests with the JSON null value. By default, fields with empty values are
   946  	// omitted from API requests. See
   947  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   948  	NullFields []string `json:"-"`
   949  }
   950  
   951  func (s *TestIamPermissionsRequest) MarshalJSON() ([]byte, error) {
   952  	type NoMethod TestIamPermissionsRequest
   953  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   954  }
   955  
   956  // TestIamPermissionsResponse: Response message for `TestIamPermissions`
   957  // method.
   958  type TestIamPermissionsResponse struct {
   959  	// Permissions: A subset of `TestPermissionsRequest.permissions` that the
   960  	// caller is allowed.
   961  	Permissions []string `json:"permissions,omitempty"`
   962  
   963  	// ServerResponse contains the HTTP response code and headers from the server.
   964  	googleapi.ServerResponse `json:"-"`
   965  	// ForceSendFields is a list of field names (e.g. "Permissions") to
   966  	// unconditionally include in API requests. By default, fields with empty or
   967  	// default values are omitted from API requests. See
   968  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   969  	// details.
   970  	ForceSendFields []string `json:"-"`
   971  	// NullFields is a list of field names (e.g. "Permissions") to include in API
   972  	// requests with the JSON null value. By default, fields with empty values are
   973  	// omitted from API requests. See
   974  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   975  	NullFields []string `json:"-"`
   976  }
   977  
   978  func (s *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) {
   979  	type NoMethod TestIamPermissionsResponse
   980  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   981  }
   982  
   983  type ProjectsLocationsGetCall struct {
   984  	s            *APIService
   985  	name         string
   986  	urlParams_   gensupport.URLParams
   987  	ifNoneMatch_ string
   988  	ctx_         context.Context
   989  	header_      http.Header
   990  }
   991  
   992  // Get: Gets information about a location.
   993  //
   994  // - name: Resource name for the location.
   995  func (r *ProjectsLocationsService) Get(name string) *ProjectsLocationsGetCall {
   996  	c := &ProjectsLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
   997  	c.name = name
   998  	return c
   999  }
  1000  
  1001  // Fields allows partial responses to be retrieved. See
  1002  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1003  // details.
  1004  func (c *ProjectsLocationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGetCall {
  1005  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1006  	return c
  1007  }
  1008  
  1009  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1010  // object's ETag matches the given value. This is useful for getting updates
  1011  // only after the object has changed since the last request.
  1012  func (c *ProjectsLocationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGetCall {
  1013  	c.ifNoneMatch_ = entityTag
  1014  	return c
  1015  }
  1016  
  1017  // Context sets the context to be used in this call's Do method.
  1018  func (c *ProjectsLocationsGetCall) Context(ctx context.Context) *ProjectsLocationsGetCall {
  1019  	c.ctx_ = ctx
  1020  	return c
  1021  }
  1022  
  1023  // Header returns a http.Header that can be modified by the caller to add
  1024  // headers to the request.
  1025  func (c *ProjectsLocationsGetCall) Header() http.Header {
  1026  	if c.header_ == nil {
  1027  		c.header_ = make(http.Header)
  1028  	}
  1029  	return c.header_
  1030  }
  1031  
  1032  func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) {
  1033  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1034  	if c.ifNoneMatch_ != "" {
  1035  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1036  	}
  1037  	var body io.Reader = nil
  1038  	c.urlParams_.Set("alt", alt)
  1039  	c.urlParams_.Set("prettyPrint", "false")
  1040  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  1041  	urls += "?" + c.urlParams_.Encode()
  1042  	req, err := http.NewRequest("GET", urls, body)
  1043  	if err != nil {
  1044  		return nil, err
  1045  	}
  1046  	req.Header = reqHeaders
  1047  	googleapi.Expand(req.URL, map[string]string{
  1048  		"name": c.name,
  1049  	})
  1050  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1051  }
  1052  
  1053  // Do executes the "servicedirectory.projects.locations.get" call.
  1054  // Any non-2xx status code is an error. Response headers are in either
  1055  // *Location.ServerResponse.Header or (if a response was returned at all) in
  1056  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1057  // whether the returned error was because http.StatusNotModified was returned.
  1058  func (c *ProjectsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) {
  1059  	gensupport.SetOptions(c.urlParams_, opts...)
  1060  	res, err := c.doRequest("json")
  1061  	if res != nil && res.StatusCode == http.StatusNotModified {
  1062  		if res.Body != nil {
  1063  			res.Body.Close()
  1064  		}
  1065  		return nil, gensupport.WrapError(&googleapi.Error{
  1066  			Code:   res.StatusCode,
  1067  			Header: res.Header,
  1068  		})
  1069  	}
  1070  	if err != nil {
  1071  		return nil, err
  1072  	}
  1073  	defer googleapi.CloseBody(res)
  1074  	if err := googleapi.CheckResponse(res); err != nil {
  1075  		return nil, gensupport.WrapError(err)
  1076  	}
  1077  	ret := &Location{
  1078  		ServerResponse: googleapi.ServerResponse{
  1079  			Header:         res.Header,
  1080  			HTTPStatusCode: res.StatusCode,
  1081  		},
  1082  	}
  1083  	target := &ret
  1084  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1085  		return nil, err
  1086  	}
  1087  	return ret, nil
  1088  }
  1089  
  1090  type ProjectsLocationsListCall struct {
  1091  	s            *APIService
  1092  	name         string
  1093  	urlParams_   gensupport.URLParams
  1094  	ifNoneMatch_ string
  1095  	ctx_         context.Context
  1096  	header_      http.Header
  1097  }
  1098  
  1099  // List: Lists information about the supported locations for this service.
  1100  //
  1101  // - name: The resource that owns the locations collection, if applicable.
  1102  func (r *ProjectsLocationsService) List(name string) *ProjectsLocationsListCall {
  1103  	c := &ProjectsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1104  	c.name = name
  1105  	return c
  1106  }
  1107  
  1108  // Filter sets the optional parameter "filter": A filter to narrow down results
  1109  // to a preferred subset. The filtering language accepts strings like
  1110  // "displayName=tokyo", and is documented in more detail in AIP-160
  1111  // (https://google.aip.dev/160).
  1112  func (c *ProjectsLocationsListCall) Filter(filter string) *ProjectsLocationsListCall {
  1113  	c.urlParams_.Set("filter", filter)
  1114  	return c
  1115  }
  1116  
  1117  // PageSize sets the optional parameter "pageSize": The maximum number of
  1118  // results to return. If not set, the service selects a default.
  1119  func (c *ProjectsLocationsListCall) PageSize(pageSize int64) *ProjectsLocationsListCall {
  1120  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  1121  	return c
  1122  }
  1123  
  1124  // PageToken sets the optional parameter "pageToken": A page token received
  1125  // from the `next_page_token` field in the response. Send that page token to
  1126  // receive the subsequent page.
  1127  func (c *ProjectsLocationsListCall) PageToken(pageToken string) *ProjectsLocationsListCall {
  1128  	c.urlParams_.Set("pageToken", pageToken)
  1129  	return c
  1130  }
  1131  
  1132  // Fields allows partial responses to be retrieved. See
  1133  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1134  // details.
  1135  func (c *ProjectsLocationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsListCall {
  1136  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1137  	return c
  1138  }
  1139  
  1140  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1141  // object's ETag matches the given value. This is useful for getting updates
  1142  // only after the object has changed since the last request.
  1143  func (c *ProjectsLocationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsListCall {
  1144  	c.ifNoneMatch_ = entityTag
  1145  	return c
  1146  }
  1147  
  1148  // Context sets the context to be used in this call's Do method.
  1149  func (c *ProjectsLocationsListCall) Context(ctx context.Context) *ProjectsLocationsListCall {
  1150  	c.ctx_ = ctx
  1151  	return c
  1152  }
  1153  
  1154  // Header returns a http.Header that can be modified by the caller to add
  1155  // headers to the request.
  1156  func (c *ProjectsLocationsListCall) Header() http.Header {
  1157  	if c.header_ == nil {
  1158  		c.header_ = make(http.Header)
  1159  	}
  1160  	return c.header_
  1161  }
  1162  
  1163  func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error) {
  1164  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1165  	if c.ifNoneMatch_ != "" {
  1166  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1167  	}
  1168  	var body io.Reader = nil
  1169  	c.urlParams_.Set("alt", alt)
  1170  	c.urlParams_.Set("prettyPrint", "false")
  1171  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/locations")
  1172  	urls += "?" + c.urlParams_.Encode()
  1173  	req, err := http.NewRequest("GET", urls, body)
  1174  	if err != nil {
  1175  		return nil, err
  1176  	}
  1177  	req.Header = reqHeaders
  1178  	googleapi.Expand(req.URL, map[string]string{
  1179  		"name": c.name,
  1180  	})
  1181  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1182  }
  1183  
  1184  // Do executes the "servicedirectory.projects.locations.list" call.
  1185  // Any non-2xx status code is an error. Response headers are in either
  1186  // *ListLocationsResponse.ServerResponse.Header or (if a response was returned
  1187  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1188  // check whether the returned error was because http.StatusNotModified was
  1189  // returned.
  1190  func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) {
  1191  	gensupport.SetOptions(c.urlParams_, opts...)
  1192  	res, err := c.doRequest("json")
  1193  	if res != nil && res.StatusCode == http.StatusNotModified {
  1194  		if res.Body != nil {
  1195  			res.Body.Close()
  1196  		}
  1197  		return nil, gensupport.WrapError(&googleapi.Error{
  1198  			Code:   res.StatusCode,
  1199  			Header: res.Header,
  1200  		})
  1201  	}
  1202  	if err != nil {
  1203  		return nil, err
  1204  	}
  1205  	defer googleapi.CloseBody(res)
  1206  	if err := googleapi.CheckResponse(res); err != nil {
  1207  		return nil, gensupport.WrapError(err)
  1208  	}
  1209  	ret := &ListLocationsResponse{
  1210  		ServerResponse: googleapi.ServerResponse{
  1211  			Header:         res.Header,
  1212  			HTTPStatusCode: res.StatusCode,
  1213  		},
  1214  	}
  1215  	target := &ret
  1216  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1217  		return nil, err
  1218  	}
  1219  	return ret, nil
  1220  }
  1221  
  1222  // Pages invokes f for each page of results.
  1223  // A non-nil error returned from f will halt the iteration.
  1224  // The provided context supersedes any context provided to the Context method.
  1225  func (c *ProjectsLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error {
  1226  	c.ctx_ = ctx
  1227  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  1228  	for {
  1229  		x, err := c.Do()
  1230  		if err != nil {
  1231  			return err
  1232  		}
  1233  		if err := f(x); err != nil {
  1234  			return err
  1235  		}
  1236  		if x.NextPageToken == "" {
  1237  			return nil
  1238  		}
  1239  		c.PageToken(x.NextPageToken)
  1240  	}
  1241  }
  1242  
  1243  type ProjectsLocationsNamespacesCreateCall struct {
  1244  	s          *APIService
  1245  	parent     string
  1246  	namespace  *Namespace
  1247  	urlParams_ gensupport.URLParams
  1248  	ctx_       context.Context
  1249  	header_    http.Header
  1250  }
  1251  
  1252  // Create: Creates a namespace, and returns the new namespace.
  1253  //
  1254  //   - parent: The resource name of the project and location the namespace will
  1255  //     be created in.
  1256  func (r *ProjectsLocationsNamespacesService) Create(parent string, namespace *Namespace) *ProjectsLocationsNamespacesCreateCall {
  1257  	c := &ProjectsLocationsNamespacesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1258  	c.parent = parent
  1259  	c.namespace = namespace
  1260  	return c
  1261  }
  1262  
  1263  // NamespaceId sets the optional parameter "namespaceId": Required. The
  1264  // Resource ID must be 1-63 characters long, and comply with RFC1035.
  1265  // Specifically, the name must be 1-63 characters long and match the regular
  1266  // expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first
  1267  // character must be a lowercase letter, and all following characters must be a
  1268  // dash, lowercase letter, or digit, except the last character, which cannot be
  1269  // a dash.
  1270  func (c *ProjectsLocationsNamespacesCreateCall) NamespaceId(namespaceId string) *ProjectsLocationsNamespacesCreateCall {
  1271  	c.urlParams_.Set("namespaceId", namespaceId)
  1272  	return c
  1273  }
  1274  
  1275  // Fields allows partial responses to be retrieved. See
  1276  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1277  // details.
  1278  func (c *ProjectsLocationsNamespacesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsNamespacesCreateCall {
  1279  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1280  	return c
  1281  }
  1282  
  1283  // Context sets the context to be used in this call's Do method.
  1284  func (c *ProjectsLocationsNamespacesCreateCall) Context(ctx context.Context) *ProjectsLocationsNamespacesCreateCall {
  1285  	c.ctx_ = ctx
  1286  	return c
  1287  }
  1288  
  1289  // Header returns a http.Header that can be modified by the caller to add
  1290  // headers to the request.
  1291  func (c *ProjectsLocationsNamespacesCreateCall) Header() http.Header {
  1292  	if c.header_ == nil {
  1293  		c.header_ = make(http.Header)
  1294  	}
  1295  	return c.header_
  1296  }
  1297  
  1298  func (c *ProjectsLocationsNamespacesCreateCall) doRequest(alt string) (*http.Response, error) {
  1299  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1300  	var body io.Reader = nil
  1301  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.namespace)
  1302  	if err != nil {
  1303  		return nil, err
  1304  	}
  1305  	c.urlParams_.Set("alt", alt)
  1306  	c.urlParams_.Set("prettyPrint", "false")
  1307  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/namespaces")
  1308  	urls += "?" + c.urlParams_.Encode()
  1309  	req, err := http.NewRequest("POST", urls, body)
  1310  	if err != nil {
  1311  		return nil, err
  1312  	}
  1313  	req.Header = reqHeaders
  1314  	googleapi.Expand(req.URL, map[string]string{
  1315  		"parent": c.parent,
  1316  	})
  1317  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1318  }
  1319  
  1320  // Do executes the "servicedirectory.projects.locations.namespaces.create" call.
  1321  // Any non-2xx status code is an error. Response headers are in either
  1322  // *Namespace.ServerResponse.Header or (if a response was returned at all) in
  1323  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1324  // whether the returned error was because http.StatusNotModified was returned.
  1325  func (c *ProjectsLocationsNamespacesCreateCall) Do(opts ...googleapi.CallOption) (*Namespace, error) {
  1326  	gensupport.SetOptions(c.urlParams_, opts...)
  1327  	res, err := c.doRequest("json")
  1328  	if res != nil && res.StatusCode == http.StatusNotModified {
  1329  		if res.Body != nil {
  1330  			res.Body.Close()
  1331  		}
  1332  		return nil, gensupport.WrapError(&googleapi.Error{
  1333  			Code:   res.StatusCode,
  1334  			Header: res.Header,
  1335  		})
  1336  	}
  1337  	if err != nil {
  1338  		return nil, err
  1339  	}
  1340  	defer googleapi.CloseBody(res)
  1341  	if err := googleapi.CheckResponse(res); err != nil {
  1342  		return nil, gensupport.WrapError(err)
  1343  	}
  1344  	ret := &Namespace{
  1345  		ServerResponse: googleapi.ServerResponse{
  1346  			Header:         res.Header,
  1347  			HTTPStatusCode: res.StatusCode,
  1348  		},
  1349  	}
  1350  	target := &ret
  1351  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1352  		return nil, err
  1353  	}
  1354  	return ret, nil
  1355  }
  1356  
  1357  type ProjectsLocationsNamespacesDeleteCall struct {
  1358  	s          *APIService
  1359  	name       string
  1360  	urlParams_ gensupport.URLParams
  1361  	ctx_       context.Context
  1362  	header_    http.Header
  1363  }
  1364  
  1365  // Delete: Deletes a namespace. This also deletes all services and endpoints in
  1366  // the namespace.
  1367  //
  1368  // - name: The name of the namespace to delete.
  1369  func (r *ProjectsLocationsNamespacesService) Delete(name string) *ProjectsLocationsNamespacesDeleteCall {
  1370  	c := &ProjectsLocationsNamespacesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1371  	c.name = name
  1372  	return c
  1373  }
  1374  
  1375  // Fields allows partial responses to be retrieved. See
  1376  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1377  // details.
  1378  func (c *ProjectsLocationsNamespacesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsNamespacesDeleteCall {
  1379  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1380  	return c
  1381  }
  1382  
  1383  // Context sets the context to be used in this call's Do method.
  1384  func (c *ProjectsLocationsNamespacesDeleteCall) Context(ctx context.Context) *ProjectsLocationsNamespacesDeleteCall {
  1385  	c.ctx_ = ctx
  1386  	return c
  1387  }
  1388  
  1389  // Header returns a http.Header that can be modified by the caller to add
  1390  // headers to the request.
  1391  func (c *ProjectsLocationsNamespacesDeleteCall) Header() http.Header {
  1392  	if c.header_ == nil {
  1393  		c.header_ = make(http.Header)
  1394  	}
  1395  	return c.header_
  1396  }
  1397  
  1398  func (c *ProjectsLocationsNamespacesDeleteCall) doRequest(alt string) (*http.Response, error) {
  1399  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1400  	var body io.Reader = nil
  1401  	c.urlParams_.Set("alt", alt)
  1402  	c.urlParams_.Set("prettyPrint", "false")
  1403  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  1404  	urls += "?" + c.urlParams_.Encode()
  1405  	req, err := http.NewRequest("DELETE", urls, body)
  1406  	if err != nil {
  1407  		return nil, err
  1408  	}
  1409  	req.Header = reqHeaders
  1410  	googleapi.Expand(req.URL, map[string]string{
  1411  		"name": c.name,
  1412  	})
  1413  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1414  }
  1415  
  1416  // Do executes the "servicedirectory.projects.locations.namespaces.delete" call.
  1417  // Any non-2xx status code is an error. Response headers are in either
  1418  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  1419  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1420  // whether the returned error was because http.StatusNotModified was returned.
  1421  func (c *ProjectsLocationsNamespacesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  1422  	gensupport.SetOptions(c.urlParams_, opts...)
  1423  	res, err := c.doRequest("json")
  1424  	if res != nil && res.StatusCode == http.StatusNotModified {
  1425  		if res.Body != nil {
  1426  			res.Body.Close()
  1427  		}
  1428  		return nil, gensupport.WrapError(&googleapi.Error{
  1429  			Code:   res.StatusCode,
  1430  			Header: res.Header,
  1431  		})
  1432  	}
  1433  	if err != nil {
  1434  		return nil, err
  1435  	}
  1436  	defer googleapi.CloseBody(res)
  1437  	if err := googleapi.CheckResponse(res); err != nil {
  1438  		return nil, gensupport.WrapError(err)
  1439  	}
  1440  	ret := &Empty{
  1441  		ServerResponse: googleapi.ServerResponse{
  1442  			Header:         res.Header,
  1443  			HTTPStatusCode: res.StatusCode,
  1444  		},
  1445  	}
  1446  	target := &ret
  1447  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1448  		return nil, err
  1449  	}
  1450  	return ret, nil
  1451  }
  1452  
  1453  type ProjectsLocationsNamespacesGetCall struct {
  1454  	s            *APIService
  1455  	name         string
  1456  	urlParams_   gensupport.URLParams
  1457  	ifNoneMatch_ string
  1458  	ctx_         context.Context
  1459  	header_      http.Header
  1460  }
  1461  
  1462  // Get: Gets a namespace.
  1463  //
  1464  // - name: The name of the namespace to retrieve.
  1465  func (r *ProjectsLocationsNamespacesService) Get(name string) *ProjectsLocationsNamespacesGetCall {
  1466  	c := &ProjectsLocationsNamespacesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1467  	c.name = name
  1468  	return c
  1469  }
  1470  
  1471  // Fields allows partial responses to be retrieved. See
  1472  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1473  // details.
  1474  func (c *ProjectsLocationsNamespacesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsNamespacesGetCall {
  1475  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1476  	return c
  1477  }
  1478  
  1479  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1480  // object's ETag matches the given value. This is useful for getting updates
  1481  // only after the object has changed since the last request.
  1482  func (c *ProjectsLocationsNamespacesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsNamespacesGetCall {
  1483  	c.ifNoneMatch_ = entityTag
  1484  	return c
  1485  }
  1486  
  1487  // Context sets the context to be used in this call's Do method.
  1488  func (c *ProjectsLocationsNamespacesGetCall) Context(ctx context.Context) *ProjectsLocationsNamespacesGetCall {
  1489  	c.ctx_ = ctx
  1490  	return c
  1491  }
  1492  
  1493  // Header returns a http.Header that can be modified by the caller to add
  1494  // headers to the request.
  1495  func (c *ProjectsLocationsNamespacesGetCall) Header() http.Header {
  1496  	if c.header_ == nil {
  1497  		c.header_ = make(http.Header)
  1498  	}
  1499  	return c.header_
  1500  }
  1501  
  1502  func (c *ProjectsLocationsNamespacesGetCall) doRequest(alt string) (*http.Response, error) {
  1503  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1504  	if c.ifNoneMatch_ != "" {
  1505  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1506  	}
  1507  	var body io.Reader = nil
  1508  	c.urlParams_.Set("alt", alt)
  1509  	c.urlParams_.Set("prettyPrint", "false")
  1510  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  1511  	urls += "?" + c.urlParams_.Encode()
  1512  	req, err := http.NewRequest("GET", urls, body)
  1513  	if err != nil {
  1514  		return nil, err
  1515  	}
  1516  	req.Header = reqHeaders
  1517  	googleapi.Expand(req.URL, map[string]string{
  1518  		"name": c.name,
  1519  	})
  1520  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1521  }
  1522  
  1523  // Do executes the "servicedirectory.projects.locations.namespaces.get" call.
  1524  // Any non-2xx status code is an error. Response headers are in either
  1525  // *Namespace.ServerResponse.Header or (if a response was returned at all) in
  1526  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1527  // whether the returned error was because http.StatusNotModified was returned.
  1528  func (c *ProjectsLocationsNamespacesGetCall) Do(opts ...googleapi.CallOption) (*Namespace, error) {
  1529  	gensupport.SetOptions(c.urlParams_, opts...)
  1530  	res, err := c.doRequest("json")
  1531  	if res != nil && res.StatusCode == http.StatusNotModified {
  1532  		if res.Body != nil {
  1533  			res.Body.Close()
  1534  		}
  1535  		return nil, gensupport.WrapError(&googleapi.Error{
  1536  			Code:   res.StatusCode,
  1537  			Header: res.Header,
  1538  		})
  1539  	}
  1540  	if err != nil {
  1541  		return nil, err
  1542  	}
  1543  	defer googleapi.CloseBody(res)
  1544  	if err := googleapi.CheckResponse(res); err != nil {
  1545  		return nil, gensupport.WrapError(err)
  1546  	}
  1547  	ret := &Namespace{
  1548  		ServerResponse: googleapi.ServerResponse{
  1549  			Header:         res.Header,
  1550  			HTTPStatusCode: res.StatusCode,
  1551  		},
  1552  	}
  1553  	target := &ret
  1554  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1555  		return nil, err
  1556  	}
  1557  	return ret, nil
  1558  }
  1559  
  1560  type ProjectsLocationsNamespacesGetIamPolicyCall struct {
  1561  	s                   *APIService
  1562  	resource            string
  1563  	getiampolicyrequest *GetIamPolicyRequest
  1564  	urlParams_          gensupport.URLParams
  1565  	ctx_                context.Context
  1566  	header_             http.Header
  1567  }
  1568  
  1569  // GetIamPolicy: Gets the IAM Policy for a resource
  1570  //
  1571  //   - resource: REQUIRED: The resource for which the policy is being requested.
  1572  //     See Resource names (https://cloud.google.com/apis/design/resource_names)
  1573  //     for the appropriate value for this field.
  1574  func (r *ProjectsLocationsNamespacesService) GetIamPolicy(resource string, getiampolicyrequest *GetIamPolicyRequest) *ProjectsLocationsNamespacesGetIamPolicyCall {
  1575  	c := &ProjectsLocationsNamespacesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1576  	c.resource = resource
  1577  	c.getiampolicyrequest = getiampolicyrequest
  1578  	return c
  1579  }
  1580  
  1581  // Fields allows partial responses to be retrieved. See
  1582  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1583  // details.
  1584  func (c *ProjectsLocationsNamespacesGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsNamespacesGetIamPolicyCall {
  1585  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1586  	return c
  1587  }
  1588  
  1589  // Context sets the context to be used in this call's Do method.
  1590  func (c *ProjectsLocationsNamespacesGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsNamespacesGetIamPolicyCall {
  1591  	c.ctx_ = ctx
  1592  	return c
  1593  }
  1594  
  1595  // Header returns a http.Header that can be modified by the caller to add
  1596  // headers to the request.
  1597  func (c *ProjectsLocationsNamespacesGetIamPolicyCall) Header() http.Header {
  1598  	if c.header_ == nil {
  1599  		c.header_ = make(http.Header)
  1600  	}
  1601  	return c.header_
  1602  }
  1603  
  1604  func (c *ProjectsLocationsNamespacesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  1605  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1606  	var body io.Reader = nil
  1607  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest)
  1608  	if err != nil {
  1609  		return nil, err
  1610  	}
  1611  	c.urlParams_.Set("alt", alt)
  1612  	c.urlParams_.Set("prettyPrint", "false")
  1613  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:getIamPolicy")
  1614  	urls += "?" + c.urlParams_.Encode()
  1615  	req, err := http.NewRequest("POST", urls, body)
  1616  	if err != nil {
  1617  		return nil, err
  1618  	}
  1619  	req.Header = reqHeaders
  1620  	googleapi.Expand(req.URL, map[string]string{
  1621  		"resource": c.resource,
  1622  	})
  1623  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1624  }
  1625  
  1626  // Do executes the "servicedirectory.projects.locations.namespaces.getIamPolicy" call.
  1627  // Any non-2xx status code is an error. Response headers are in either
  1628  // *Policy.ServerResponse.Header or (if a response was returned at all) in
  1629  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1630  // whether the returned error was because http.StatusNotModified was returned.
  1631  func (c *ProjectsLocationsNamespacesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  1632  	gensupport.SetOptions(c.urlParams_, opts...)
  1633  	res, err := c.doRequest("json")
  1634  	if res != nil && res.StatusCode == http.StatusNotModified {
  1635  		if res.Body != nil {
  1636  			res.Body.Close()
  1637  		}
  1638  		return nil, gensupport.WrapError(&googleapi.Error{
  1639  			Code:   res.StatusCode,
  1640  			Header: res.Header,
  1641  		})
  1642  	}
  1643  	if err != nil {
  1644  		return nil, err
  1645  	}
  1646  	defer googleapi.CloseBody(res)
  1647  	if err := googleapi.CheckResponse(res); err != nil {
  1648  		return nil, gensupport.WrapError(err)
  1649  	}
  1650  	ret := &Policy{
  1651  		ServerResponse: googleapi.ServerResponse{
  1652  			Header:         res.Header,
  1653  			HTTPStatusCode: res.StatusCode,
  1654  		},
  1655  	}
  1656  	target := &ret
  1657  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1658  		return nil, err
  1659  	}
  1660  	return ret, nil
  1661  }
  1662  
  1663  type ProjectsLocationsNamespacesListCall struct {
  1664  	s            *APIService
  1665  	parent       string
  1666  	urlParams_   gensupport.URLParams
  1667  	ifNoneMatch_ string
  1668  	ctx_         context.Context
  1669  	header_      http.Header
  1670  }
  1671  
  1672  // List: Lists all namespaces.
  1673  //
  1674  //   - parent: The resource name of the project and location whose namespaces
  1675  //     you'd like to list.
  1676  func (r *ProjectsLocationsNamespacesService) List(parent string) *ProjectsLocationsNamespacesListCall {
  1677  	c := &ProjectsLocationsNamespacesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1678  	c.parent = parent
  1679  	return c
  1680  }
  1681  
  1682  // Filter sets the optional parameter "filter": The filter to list results by.
  1683  // General `filter` string syntax: ` ()` * “ can be `name`, `labels.` for map
  1684  // field, or `attributes.` for attributes field * “ can be `<`, `>`, `<=`,
  1685  // `>=`, `!=`, `=`, `:`. Of which `:` means `HAS`, and is roughly the same as
  1686  // `=` * “ must be the same data type as field * “ can be `AND`, `OR`, `NOT`
  1687  // Examples of valid filters: * `labels.owner` returns namespaces that have a
  1688  // label with the key `owner`, this is the same as `labels:owner` *
  1689  // `labels.owner=sd` returns namespaces that have key/value `owner=sd` *
  1690  // `name>projects/my-project/locations/us-east1/namespaces/namespace-c` returns
  1691  // namespaces that have name that is alphabetically later than the string, so
  1692  // "namespace-e" is returned but "namespace-a" is not * `labels.owner!=sd AND
  1693  // labels.foo=bar` returns namespaces that have `owner` in label key but value
  1694  // is not `sd` AND have key/value `foo=bar` * `doesnotexist.foo=bar` returns an
  1695  // empty list. Note that namespace doesn't have a field called "doesnotexist".
  1696  // Since the filter does not match any namespaces, it returns no results *
  1697  // `attributes.managed_registration=true` returns namespaces that are managed
  1698  // by a GCP product or service For more information about filtering, see API
  1699  // Filtering (https://aip.dev/160).
  1700  func (c *ProjectsLocationsNamespacesListCall) Filter(filter string) *ProjectsLocationsNamespacesListCall {
  1701  	c.urlParams_.Set("filter", filter)
  1702  	return c
  1703  }
  1704  
  1705  // OrderBy sets the optional parameter "orderBy": The order to list results by.
  1706  // General `order_by` string syntax: ` () (,)` * “ allows value: `name` * “
  1707  // ascending or descending order by “. If this is left blank, `asc` is used
  1708  // Note that an empty `order_by` string results in default order, which is
  1709  // order by `name` in ascending order.
  1710  func (c *ProjectsLocationsNamespacesListCall) OrderBy(orderBy string) *ProjectsLocationsNamespacesListCall {
  1711  	c.urlParams_.Set("orderBy", orderBy)
  1712  	return c
  1713  }
  1714  
  1715  // PageSize sets the optional parameter "pageSize": The maximum number of items
  1716  // to return. The default value is 100.
  1717  func (c *ProjectsLocationsNamespacesListCall) PageSize(pageSize int64) *ProjectsLocationsNamespacesListCall {
  1718  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  1719  	return c
  1720  }
  1721  
  1722  // PageToken sets the optional parameter "pageToken": The next_page_token value
  1723  // returned from a previous List request, if any.
  1724  func (c *ProjectsLocationsNamespacesListCall) PageToken(pageToken string) *ProjectsLocationsNamespacesListCall {
  1725  	c.urlParams_.Set("pageToken", pageToken)
  1726  	return c
  1727  }
  1728  
  1729  // Fields allows partial responses to be retrieved. See
  1730  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1731  // details.
  1732  func (c *ProjectsLocationsNamespacesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsNamespacesListCall {
  1733  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1734  	return c
  1735  }
  1736  
  1737  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1738  // object's ETag matches the given value. This is useful for getting updates
  1739  // only after the object has changed since the last request.
  1740  func (c *ProjectsLocationsNamespacesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsNamespacesListCall {
  1741  	c.ifNoneMatch_ = entityTag
  1742  	return c
  1743  }
  1744  
  1745  // Context sets the context to be used in this call's Do method.
  1746  func (c *ProjectsLocationsNamespacesListCall) Context(ctx context.Context) *ProjectsLocationsNamespacesListCall {
  1747  	c.ctx_ = ctx
  1748  	return c
  1749  }
  1750  
  1751  // Header returns a http.Header that can be modified by the caller to add
  1752  // headers to the request.
  1753  func (c *ProjectsLocationsNamespacesListCall) Header() http.Header {
  1754  	if c.header_ == nil {
  1755  		c.header_ = make(http.Header)
  1756  	}
  1757  	return c.header_
  1758  }
  1759  
  1760  func (c *ProjectsLocationsNamespacesListCall) doRequest(alt string) (*http.Response, error) {
  1761  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1762  	if c.ifNoneMatch_ != "" {
  1763  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1764  	}
  1765  	var body io.Reader = nil
  1766  	c.urlParams_.Set("alt", alt)
  1767  	c.urlParams_.Set("prettyPrint", "false")
  1768  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/namespaces")
  1769  	urls += "?" + c.urlParams_.Encode()
  1770  	req, err := http.NewRequest("GET", urls, body)
  1771  	if err != nil {
  1772  		return nil, err
  1773  	}
  1774  	req.Header = reqHeaders
  1775  	googleapi.Expand(req.URL, map[string]string{
  1776  		"parent": c.parent,
  1777  	})
  1778  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1779  }
  1780  
  1781  // Do executes the "servicedirectory.projects.locations.namespaces.list" call.
  1782  // Any non-2xx status code is an error. Response headers are in either
  1783  // *ListNamespacesResponse.ServerResponse.Header or (if a response was returned
  1784  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1785  // check whether the returned error was because http.StatusNotModified was
  1786  // returned.
  1787  func (c *ProjectsLocationsNamespacesListCall) Do(opts ...googleapi.CallOption) (*ListNamespacesResponse, error) {
  1788  	gensupport.SetOptions(c.urlParams_, opts...)
  1789  	res, err := c.doRequest("json")
  1790  	if res != nil && res.StatusCode == http.StatusNotModified {
  1791  		if res.Body != nil {
  1792  			res.Body.Close()
  1793  		}
  1794  		return nil, gensupport.WrapError(&googleapi.Error{
  1795  			Code:   res.StatusCode,
  1796  			Header: res.Header,
  1797  		})
  1798  	}
  1799  	if err != nil {
  1800  		return nil, err
  1801  	}
  1802  	defer googleapi.CloseBody(res)
  1803  	if err := googleapi.CheckResponse(res); err != nil {
  1804  		return nil, gensupport.WrapError(err)
  1805  	}
  1806  	ret := &ListNamespacesResponse{
  1807  		ServerResponse: googleapi.ServerResponse{
  1808  			Header:         res.Header,
  1809  			HTTPStatusCode: res.StatusCode,
  1810  		},
  1811  	}
  1812  	target := &ret
  1813  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1814  		return nil, err
  1815  	}
  1816  	return ret, nil
  1817  }
  1818  
  1819  // Pages invokes f for each page of results.
  1820  // A non-nil error returned from f will halt the iteration.
  1821  // The provided context supersedes any context provided to the Context method.
  1822  func (c *ProjectsLocationsNamespacesListCall) Pages(ctx context.Context, f func(*ListNamespacesResponse) error) error {
  1823  	c.ctx_ = ctx
  1824  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  1825  	for {
  1826  		x, err := c.Do()
  1827  		if err != nil {
  1828  			return err
  1829  		}
  1830  		if err := f(x); err != nil {
  1831  			return err
  1832  		}
  1833  		if x.NextPageToken == "" {
  1834  			return nil
  1835  		}
  1836  		c.PageToken(x.NextPageToken)
  1837  	}
  1838  }
  1839  
  1840  type ProjectsLocationsNamespacesPatchCall struct {
  1841  	s          *APIService
  1842  	name       string
  1843  	namespace  *Namespace
  1844  	urlParams_ gensupport.URLParams
  1845  	ctx_       context.Context
  1846  	header_    http.Header
  1847  }
  1848  
  1849  // Patch: Updates a namespace.
  1850  //
  1851  //   - name: Immutable. The resource name for the namespace in the format
  1852  //     `projects/*/locations/*/namespaces/*`.
  1853  func (r *ProjectsLocationsNamespacesService) Patch(name string, namespace *Namespace) *ProjectsLocationsNamespacesPatchCall {
  1854  	c := &ProjectsLocationsNamespacesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1855  	c.name = name
  1856  	c.namespace = namespace
  1857  	return c
  1858  }
  1859  
  1860  // UpdateMask sets the optional parameter "updateMask": Required. List of
  1861  // fields to be updated in this request.
  1862  func (c *ProjectsLocationsNamespacesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsNamespacesPatchCall {
  1863  	c.urlParams_.Set("updateMask", updateMask)
  1864  	return c
  1865  }
  1866  
  1867  // Fields allows partial responses to be retrieved. See
  1868  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1869  // details.
  1870  func (c *ProjectsLocationsNamespacesPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsNamespacesPatchCall {
  1871  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1872  	return c
  1873  }
  1874  
  1875  // Context sets the context to be used in this call's Do method.
  1876  func (c *ProjectsLocationsNamespacesPatchCall) Context(ctx context.Context) *ProjectsLocationsNamespacesPatchCall {
  1877  	c.ctx_ = ctx
  1878  	return c
  1879  }
  1880  
  1881  // Header returns a http.Header that can be modified by the caller to add
  1882  // headers to the request.
  1883  func (c *ProjectsLocationsNamespacesPatchCall) Header() http.Header {
  1884  	if c.header_ == nil {
  1885  		c.header_ = make(http.Header)
  1886  	}
  1887  	return c.header_
  1888  }
  1889  
  1890  func (c *ProjectsLocationsNamespacesPatchCall) doRequest(alt string) (*http.Response, error) {
  1891  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1892  	var body io.Reader = nil
  1893  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.namespace)
  1894  	if err != nil {
  1895  		return nil, err
  1896  	}
  1897  	c.urlParams_.Set("alt", alt)
  1898  	c.urlParams_.Set("prettyPrint", "false")
  1899  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  1900  	urls += "?" + c.urlParams_.Encode()
  1901  	req, err := http.NewRequest("PATCH", urls, body)
  1902  	if err != nil {
  1903  		return nil, err
  1904  	}
  1905  	req.Header = reqHeaders
  1906  	googleapi.Expand(req.URL, map[string]string{
  1907  		"name": c.name,
  1908  	})
  1909  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1910  }
  1911  
  1912  // Do executes the "servicedirectory.projects.locations.namespaces.patch" call.
  1913  // Any non-2xx status code is an error. Response headers are in either
  1914  // *Namespace.ServerResponse.Header or (if a response was returned at all) in
  1915  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1916  // whether the returned error was because http.StatusNotModified was returned.
  1917  func (c *ProjectsLocationsNamespacesPatchCall) Do(opts ...googleapi.CallOption) (*Namespace, error) {
  1918  	gensupport.SetOptions(c.urlParams_, opts...)
  1919  	res, err := c.doRequest("json")
  1920  	if res != nil && res.StatusCode == http.StatusNotModified {
  1921  		if res.Body != nil {
  1922  			res.Body.Close()
  1923  		}
  1924  		return nil, gensupport.WrapError(&googleapi.Error{
  1925  			Code:   res.StatusCode,
  1926  			Header: res.Header,
  1927  		})
  1928  	}
  1929  	if err != nil {
  1930  		return nil, err
  1931  	}
  1932  	defer googleapi.CloseBody(res)
  1933  	if err := googleapi.CheckResponse(res); err != nil {
  1934  		return nil, gensupport.WrapError(err)
  1935  	}
  1936  	ret := &Namespace{
  1937  		ServerResponse: googleapi.ServerResponse{
  1938  			Header:         res.Header,
  1939  			HTTPStatusCode: res.StatusCode,
  1940  		},
  1941  	}
  1942  	target := &ret
  1943  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1944  		return nil, err
  1945  	}
  1946  	return ret, nil
  1947  }
  1948  
  1949  type ProjectsLocationsNamespacesSetIamPolicyCall struct {
  1950  	s                   *APIService
  1951  	resource            string
  1952  	setiampolicyrequest *SetIamPolicyRequest
  1953  	urlParams_          gensupport.URLParams
  1954  	ctx_                context.Context
  1955  	header_             http.Header
  1956  }
  1957  
  1958  // SetIamPolicy: Sets the IAM Policy for a resource
  1959  //
  1960  //   - resource: REQUIRED: The resource for which the policy is being specified.
  1961  //     See Resource names (https://cloud.google.com/apis/design/resource_names)
  1962  //     for the appropriate value for this field.
  1963  func (r *ProjectsLocationsNamespacesService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsNamespacesSetIamPolicyCall {
  1964  	c := &ProjectsLocationsNamespacesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1965  	c.resource = resource
  1966  	c.setiampolicyrequest = setiampolicyrequest
  1967  	return c
  1968  }
  1969  
  1970  // Fields allows partial responses to be retrieved. See
  1971  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1972  // details.
  1973  func (c *ProjectsLocationsNamespacesSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsNamespacesSetIamPolicyCall {
  1974  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1975  	return c
  1976  }
  1977  
  1978  // Context sets the context to be used in this call's Do method.
  1979  func (c *ProjectsLocationsNamespacesSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsNamespacesSetIamPolicyCall {
  1980  	c.ctx_ = ctx
  1981  	return c
  1982  }
  1983  
  1984  // Header returns a http.Header that can be modified by the caller to add
  1985  // headers to the request.
  1986  func (c *ProjectsLocationsNamespacesSetIamPolicyCall) Header() http.Header {
  1987  	if c.header_ == nil {
  1988  		c.header_ = make(http.Header)
  1989  	}
  1990  	return c.header_
  1991  }
  1992  
  1993  func (c *ProjectsLocationsNamespacesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  1994  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1995  	var body io.Reader = nil
  1996  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
  1997  	if err != nil {
  1998  		return nil, err
  1999  	}
  2000  	c.urlParams_.Set("alt", alt)
  2001  	c.urlParams_.Set("prettyPrint", "false")
  2002  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:setIamPolicy")
  2003  	urls += "?" + c.urlParams_.Encode()
  2004  	req, err := http.NewRequest("POST", urls, body)
  2005  	if err != nil {
  2006  		return nil, err
  2007  	}
  2008  	req.Header = reqHeaders
  2009  	googleapi.Expand(req.URL, map[string]string{
  2010  		"resource": c.resource,
  2011  	})
  2012  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2013  }
  2014  
  2015  // Do executes the "servicedirectory.projects.locations.namespaces.setIamPolicy" call.
  2016  // Any non-2xx status code is an error. Response headers are in either
  2017  // *Policy.ServerResponse.Header or (if a response was returned at all) in
  2018  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2019  // whether the returned error was because http.StatusNotModified was returned.
  2020  func (c *ProjectsLocationsNamespacesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  2021  	gensupport.SetOptions(c.urlParams_, opts...)
  2022  	res, err := c.doRequest("json")
  2023  	if res != nil && res.StatusCode == http.StatusNotModified {
  2024  		if res.Body != nil {
  2025  			res.Body.Close()
  2026  		}
  2027  		return nil, gensupport.WrapError(&googleapi.Error{
  2028  			Code:   res.StatusCode,
  2029  			Header: res.Header,
  2030  		})
  2031  	}
  2032  	if err != nil {
  2033  		return nil, err
  2034  	}
  2035  	defer googleapi.CloseBody(res)
  2036  	if err := googleapi.CheckResponse(res); err != nil {
  2037  		return nil, gensupport.WrapError(err)
  2038  	}
  2039  	ret := &Policy{
  2040  		ServerResponse: googleapi.ServerResponse{
  2041  			Header:         res.Header,
  2042  			HTTPStatusCode: res.StatusCode,
  2043  		},
  2044  	}
  2045  	target := &ret
  2046  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2047  		return nil, err
  2048  	}
  2049  	return ret, nil
  2050  }
  2051  
  2052  type ProjectsLocationsNamespacesTestIamPermissionsCall struct {
  2053  	s                         *APIService
  2054  	resource                  string
  2055  	testiampermissionsrequest *TestIamPermissionsRequest
  2056  	urlParams_                gensupport.URLParams
  2057  	ctx_                      context.Context
  2058  	header_                   http.Header
  2059  }
  2060  
  2061  // TestIamPermissions: Tests IAM permissions for a resource (namespace, service
  2062  // or service workload only).
  2063  //
  2064  //   - resource: REQUIRED: The resource for which the policy detail is being
  2065  //     requested. See Resource names
  2066  //     (https://cloud.google.com/apis/design/resource_names) for the appropriate
  2067  //     value for this field.
  2068  func (r *ProjectsLocationsNamespacesService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsNamespacesTestIamPermissionsCall {
  2069  	c := &ProjectsLocationsNamespacesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2070  	c.resource = resource
  2071  	c.testiampermissionsrequest = testiampermissionsrequest
  2072  	return c
  2073  }
  2074  
  2075  // Fields allows partial responses to be retrieved. See
  2076  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2077  // details.
  2078  func (c *ProjectsLocationsNamespacesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsNamespacesTestIamPermissionsCall {
  2079  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2080  	return c
  2081  }
  2082  
  2083  // Context sets the context to be used in this call's Do method.
  2084  func (c *ProjectsLocationsNamespacesTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsNamespacesTestIamPermissionsCall {
  2085  	c.ctx_ = ctx
  2086  	return c
  2087  }
  2088  
  2089  // Header returns a http.Header that can be modified by the caller to add
  2090  // headers to the request.
  2091  func (c *ProjectsLocationsNamespacesTestIamPermissionsCall) Header() http.Header {
  2092  	if c.header_ == nil {
  2093  		c.header_ = make(http.Header)
  2094  	}
  2095  	return c.header_
  2096  }
  2097  
  2098  func (c *ProjectsLocationsNamespacesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  2099  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  2100  	var body io.Reader = nil
  2101  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
  2102  	if err != nil {
  2103  		return nil, err
  2104  	}
  2105  	c.urlParams_.Set("alt", alt)
  2106  	c.urlParams_.Set("prettyPrint", "false")
  2107  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:testIamPermissions")
  2108  	urls += "?" + c.urlParams_.Encode()
  2109  	req, err := http.NewRequest("POST", urls, body)
  2110  	if err != nil {
  2111  		return nil, err
  2112  	}
  2113  	req.Header = reqHeaders
  2114  	googleapi.Expand(req.URL, map[string]string{
  2115  		"resource": c.resource,
  2116  	})
  2117  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2118  }
  2119  
  2120  // Do executes the "servicedirectory.projects.locations.namespaces.testIamPermissions" call.
  2121  // Any non-2xx status code is an error. Response headers are in either
  2122  // *TestIamPermissionsResponse.ServerResponse.Header or (if a response was
  2123  // returned at all) in error.(*googleapi.Error).Header. Use
  2124  // googleapi.IsNotModified to check whether the returned error was because
  2125  // http.StatusNotModified was returned.
  2126  func (c *ProjectsLocationsNamespacesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
  2127  	gensupport.SetOptions(c.urlParams_, opts...)
  2128  	res, err := c.doRequest("json")
  2129  	if res != nil && res.StatusCode == http.StatusNotModified {
  2130  		if res.Body != nil {
  2131  			res.Body.Close()
  2132  		}
  2133  		return nil, gensupport.WrapError(&googleapi.Error{
  2134  			Code:   res.StatusCode,
  2135  			Header: res.Header,
  2136  		})
  2137  	}
  2138  	if err != nil {
  2139  		return nil, err
  2140  	}
  2141  	defer googleapi.CloseBody(res)
  2142  	if err := googleapi.CheckResponse(res); err != nil {
  2143  		return nil, gensupport.WrapError(err)
  2144  	}
  2145  	ret := &TestIamPermissionsResponse{
  2146  		ServerResponse: googleapi.ServerResponse{
  2147  			Header:         res.Header,
  2148  			HTTPStatusCode: res.StatusCode,
  2149  		},
  2150  	}
  2151  	target := &ret
  2152  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2153  		return nil, err
  2154  	}
  2155  	return ret, nil
  2156  }
  2157  
  2158  type ProjectsLocationsNamespacesServicesCreateCall struct {
  2159  	s          *APIService
  2160  	parent     string
  2161  	service    *Service
  2162  	urlParams_ gensupport.URLParams
  2163  	ctx_       context.Context
  2164  	header_    http.Header
  2165  }
  2166  
  2167  // Create: Creates a service, and returns the new service.
  2168  //
  2169  // - parent: The resource name of the namespace this service will belong to.
  2170  func (r *ProjectsLocationsNamespacesServicesService) Create(parent string, service *Service) *ProjectsLocationsNamespacesServicesCreateCall {
  2171  	c := &ProjectsLocationsNamespacesServicesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2172  	c.parent = parent
  2173  	c.service = service
  2174  	return c
  2175  }
  2176  
  2177  // ServiceId sets the optional parameter "serviceId": Required. The Resource ID
  2178  // must be 1-63 characters long, and comply with RFC1035. Specifically, the
  2179  // name must be 1-63 characters long and match the regular expression
  2180  // `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first character must be
  2181  // a lowercase letter, and all following characters must be a dash, lowercase
  2182  // letter, or digit, except the last character, which cannot be a dash.
  2183  func (c *ProjectsLocationsNamespacesServicesCreateCall) ServiceId(serviceId string) *ProjectsLocationsNamespacesServicesCreateCall {
  2184  	c.urlParams_.Set("serviceId", serviceId)
  2185  	return c
  2186  }
  2187  
  2188  // Fields allows partial responses to be retrieved. See
  2189  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2190  // details.
  2191  func (c *ProjectsLocationsNamespacesServicesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsNamespacesServicesCreateCall {
  2192  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2193  	return c
  2194  }
  2195  
  2196  // Context sets the context to be used in this call's Do method.
  2197  func (c *ProjectsLocationsNamespacesServicesCreateCall) Context(ctx context.Context) *ProjectsLocationsNamespacesServicesCreateCall {
  2198  	c.ctx_ = ctx
  2199  	return c
  2200  }
  2201  
  2202  // Header returns a http.Header that can be modified by the caller to add
  2203  // headers to the request.
  2204  func (c *ProjectsLocationsNamespacesServicesCreateCall) Header() http.Header {
  2205  	if c.header_ == nil {
  2206  		c.header_ = make(http.Header)
  2207  	}
  2208  	return c.header_
  2209  }
  2210  
  2211  func (c *ProjectsLocationsNamespacesServicesCreateCall) doRequest(alt string) (*http.Response, error) {
  2212  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  2213  	var body io.Reader = nil
  2214  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.service)
  2215  	if err != nil {
  2216  		return nil, err
  2217  	}
  2218  	c.urlParams_.Set("alt", alt)
  2219  	c.urlParams_.Set("prettyPrint", "false")
  2220  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/services")
  2221  	urls += "?" + c.urlParams_.Encode()
  2222  	req, err := http.NewRequest("POST", urls, body)
  2223  	if err != nil {
  2224  		return nil, err
  2225  	}
  2226  	req.Header = reqHeaders
  2227  	googleapi.Expand(req.URL, map[string]string{
  2228  		"parent": c.parent,
  2229  	})
  2230  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2231  }
  2232  
  2233  // Do executes the "servicedirectory.projects.locations.namespaces.services.create" call.
  2234  // Any non-2xx status code is an error. Response headers are in either
  2235  // *Service.ServerResponse.Header or (if a response was returned at all) in
  2236  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2237  // whether the returned error was because http.StatusNotModified was returned.
  2238  func (c *ProjectsLocationsNamespacesServicesCreateCall) Do(opts ...googleapi.CallOption) (*Service, error) {
  2239  	gensupport.SetOptions(c.urlParams_, opts...)
  2240  	res, err := c.doRequest("json")
  2241  	if res != nil && res.StatusCode == http.StatusNotModified {
  2242  		if res.Body != nil {
  2243  			res.Body.Close()
  2244  		}
  2245  		return nil, gensupport.WrapError(&googleapi.Error{
  2246  			Code:   res.StatusCode,
  2247  			Header: res.Header,
  2248  		})
  2249  	}
  2250  	if err != nil {
  2251  		return nil, err
  2252  	}
  2253  	defer googleapi.CloseBody(res)
  2254  	if err := googleapi.CheckResponse(res); err != nil {
  2255  		return nil, gensupport.WrapError(err)
  2256  	}
  2257  	ret := &Service{
  2258  		ServerResponse: googleapi.ServerResponse{
  2259  			Header:         res.Header,
  2260  			HTTPStatusCode: res.StatusCode,
  2261  		},
  2262  	}
  2263  	target := &ret
  2264  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2265  		return nil, err
  2266  	}
  2267  	return ret, nil
  2268  }
  2269  
  2270  type ProjectsLocationsNamespacesServicesDeleteCall struct {
  2271  	s          *APIService
  2272  	name       string
  2273  	urlParams_ gensupport.URLParams
  2274  	ctx_       context.Context
  2275  	header_    http.Header
  2276  }
  2277  
  2278  // Delete: Deletes a service. This also deletes all endpoints associated with
  2279  // the service.
  2280  //
  2281  // - name: The name of the service to delete.
  2282  func (r *ProjectsLocationsNamespacesServicesService) Delete(name string) *ProjectsLocationsNamespacesServicesDeleteCall {
  2283  	c := &ProjectsLocationsNamespacesServicesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2284  	c.name = name
  2285  	return c
  2286  }
  2287  
  2288  // Fields allows partial responses to be retrieved. See
  2289  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2290  // details.
  2291  func (c *ProjectsLocationsNamespacesServicesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsNamespacesServicesDeleteCall {
  2292  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2293  	return c
  2294  }
  2295  
  2296  // Context sets the context to be used in this call's Do method.
  2297  func (c *ProjectsLocationsNamespacesServicesDeleteCall) Context(ctx context.Context) *ProjectsLocationsNamespacesServicesDeleteCall {
  2298  	c.ctx_ = ctx
  2299  	return c
  2300  }
  2301  
  2302  // Header returns a http.Header that can be modified by the caller to add
  2303  // headers to the request.
  2304  func (c *ProjectsLocationsNamespacesServicesDeleteCall) Header() http.Header {
  2305  	if c.header_ == nil {
  2306  		c.header_ = make(http.Header)
  2307  	}
  2308  	return c.header_
  2309  }
  2310  
  2311  func (c *ProjectsLocationsNamespacesServicesDeleteCall) doRequest(alt string) (*http.Response, error) {
  2312  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2313  	var body io.Reader = nil
  2314  	c.urlParams_.Set("alt", alt)
  2315  	c.urlParams_.Set("prettyPrint", "false")
  2316  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  2317  	urls += "?" + c.urlParams_.Encode()
  2318  	req, err := http.NewRequest("DELETE", urls, body)
  2319  	if err != nil {
  2320  		return nil, err
  2321  	}
  2322  	req.Header = reqHeaders
  2323  	googleapi.Expand(req.URL, map[string]string{
  2324  		"name": c.name,
  2325  	})
  2326  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2327  }
  2328  
  2329  // Do executes the "servicedirectory.projects.locations.namespaces.services.delete" call.
  2330  // Any non-2xx status code is an error. Response headers are in either
  2331  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  2332  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2333  // whether the returned error was because http.StatusNotModified was returned.
  2334  func (c *ProjectsLocationsNamespacesServicesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  2335  	gensupport.SetOptions(c.urlParams_, opts...)
  2336  	res, err := c.doRequest("json")
  2337  	if res != nil && res.StatusCode == http.StatusNotModified {
  2338  		if res.Body != nil {
  2339  			res.Body.Close()
  2340  		}
  2341  		return nil, gensupport.WrapError(&googleapi.Error{
  2342  			Code:   res.StatusCode,
  2343  			Header: res.Header,
  2344  		})
  2345  	}
  2346  	if err != nil {
  2347  		return nil, err
  2348  	}
  2349  	defer googleapi.CloseBody(res)
  2350  	if err := googleapi.CheckResponse(res); err != nil {
  2351  		return nil, gensupport.WrapError(err)
  2352  	}
  2353  	ret := &Empty{
  2354  		ServerResponse: googleapi.ServerResponse{
  2355  			Header:         res.Header,
  2356  			HTTPStatusCode: res.StatusCode,
  2357  		},
  2358  	}
  2359  	target := &ret
  2360  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2361  		return nil, err
  2362  	}
  2363  	return ret, nil
  2364  }
  2365  
  2366  type ProjectsLocationsNamespacesServicesGetCall struct {
  2367  	s            *APIService
  2368  	name         string
  2369  	urlParams_   gensupport.URLParams
  2370  	ifNoneMatch_ string
  2371  	ctx_         context.Context
  2372  	header_      http.Header
  2373  }
  2374  
  2375  // Get: Gets a service.
  2376  //
  2377  // - name: The name of the service to get.
  2378  func (r *ProjectsLocationsNamespacesServicesService) Get(name string) *ProjectsLocationsNamespacesServicesGetCall {
  2379  	c := &ProjectsLocationsNamespacesServicesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2380  	c.name = name
  2381  	return c
  2382  }
  2383  
  2384  // Fields allows partial responses to be retrieved. See
  2385  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2386  // details.
  2387  func (c *ProjectsLocationsNamespacesServicesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsNamespacesServicesGetCall {
  2388  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2389  	return c
  2390  }
  2391  
  2392  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2393  // object's ETag matches the given value. This is useful for getting updates
  2394  // only after the object has changed since the last request.
  2395  func (c *ProjectsLocationsNamespacesServicesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsNamespacesServicesGetCall {
  2396  	c.ifNoneMatch_ = entityTag
  2397  	return c
  2398  }
  2399  
  2400  // Context sets the context to be used in this call's Do method.
  2401  func (c *ProjectsLocationsNamespacesServicesGetCall) Context(ctx context.Context) *ProjectsLocationsNamespacesServicesGetCall {
  2402  	c.ctx_ = ctx
  2403  	return c
  2404  }
  2405  
  2406  // Header returns a http.Header that can be modified by the caller to add
  2407  // headers to the request.
  2408  func (c *ProjectsLocationsNamespacesServicesGetCall) Header() http.Header {
  2409  	if c.header_ == nil {
  2410  		c.header_ = make(http.Header)
  2411  	}
  2412  	return c.header_
  2413  }
  2414  
  2415  func (c *ProjectsLocationsNamespacesServicesGetCall) doRequest(alt string) (*http.Response, error) {
  2416  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2417  	if c.ifNoneMatch_ != "" {
  2418  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2419  	}
  2420  	var body io.Reader = nil
  2421  	c.urlParams_.Set("alt", alt)
  2422  	c.urlParams_.Set("prettyPrint", "false")
  2423  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  2424  	urls += "?" + c.urlParams_.Encode()
  2425  	req, err := http.NewRequest("GET", urls, body)
  2426  	if err != nil {
  2427  		return nil, err
  2428  	}
  2429  	req.Header = reqHeaders
  2430  	googleapi.Expand(req.URL, map[string]string{
  2431  		"name": c.name,
  2432  	})
  2433  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2434  }
  2435  
  2436  // Do executes the "servicedirectory.projects.locations.namespaces.services.get" call.
  2437  // Any non-2xx status code is an error. Response headers are in either
  2438  // *Service.ServerResponse.Header or (if a response was returned at all) in
  2439  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2440  // whether the returned error was because http.StatusNotModified was returned.
  2441  func (c *ProjectsLocationsNamespacesServicesGetCall) Do(opts ...googleapi.CallOption) (*Service, error) {
  2442  	gensupport.SetOptions(c.urlParams_, opts...)
  2443  	res, err := c.doRequest("json")
  2444  	if res != nil && res.StatusCode == http.StatusNotModified {
  2445  		if res.Body != nil {
  2446  			res.Body.Close()
  2447  		}
  2448  		return nil, gensupport.WrapError(&googleapi.Error{
  2449  			Code:   res.StatusCode,
  2450  			Header: res.Header,
  2451  		})
  2452  	}
  2453  	if err != nil {
  2454  		return nil, err
  2455  	}
  2456  	defer googleapi.CloseBody(res)
  2457  	if err := googleapi.CheckResponse(res); err != nil {
  2458  		return nil, gensupport.WrapError(err)
  2459  	}
  2460  	ret := &Service{
  2461  		ServerResponse: googleapi.ServerResponse{
  2462  			Header:         res.Header,
  2463  			HTTPStatusCode: res.StatusCode,
  2464  		},
  2465  	}
  2466  	target := &ret
  2467  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2468  		return nil, err
  2469  	}
  2470  	return ret, nil
  2471  }
  2472  
  2473  type ProjectsLocationsNamespacesServicesGetIamPolicyCall struct {
  2474  	s                   *APIService
  2475  	resource            string
  2476  	getiampolicyrequest *GetIamPolicyRequest
  2477  	urlParams_          gensupport.URLParams
  2478  	ctx_                context.Context
  2479  	header_             http.Header
  2480  }
  2481  
  2482  // GetIamPolicy: Gets the IAM Policy for a resource
  2483  //
  2484  //   - resource: REQUIRED: The resource for which the policy is being requested.
  2485  //     See Resource names (https://cloud.google.com/apis/design/resource_names)
  2486  //     for the appropriate value for this field.
  2487  func (r *ProjectsLocationsNamespacesServicesService) GetIamPolicy(resource string, getiampolicyrequest *GetIamPolicyRequest) *ProjectsLocationsNamespacesServicesGetIamPolicyCall {
  2488  	c := &ProjectsLocationsNamespacesServicesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2489  	c.resource = resource
  2490  	c.getiampolicyrequest = getiampolicyrequest
  2491  	return c
  2492  }
  2493  
  2494  // Fields allows partial responses to be retrieved. See
  2495  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2496  // details.
  2497  func (c *ProjectsLocationsNamespacesServicesGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsNamespacesServicesGetIamPolicyCall {
  2498  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2499  	return c
  2500  }
  2501  
  2502  // Context sets the context to be used in this call's Do method.
  2503  func (c *ProjectsLocationsNamespacesServicesGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsNamespacesServicesGetIamPolicyCall {
  2504  	c.ctx_ = ctx
  2505  	return c
  2506  }
  2507  
  2508  // Header returns a http.Header that can be modified by the caller to add
  2509  // headers to the request.
  2510  func (c *ProjectsLocationsNamespacesServicesGetIamPolicyCall) Header() http.Header {
  2511  	if c.header_ == nil {
  2512  		c.header_ = make(http.Header)
  2513  	}
  2514  	return c.header_
  2515  }
  2516  
  2517  func (c *ProjectsLocationsNamespacesServicesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  2518  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  2519  	var body io.Reader = nil
  2520  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest)
  2521  	if err != nil {
  2522  		return nil, err
  2523  	}
  2524  	c.urlParams_.Set("alt", alt)
  2525  	c.urlParams_.Set("prettyPrint", "false")
  2526  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:getIamPolicy")
  2527  	urls += "?" + c.urlParams_.Encode()
  2528  	req, err := http.NewRequest("POST", urls, body)
  2529  	if err != nil {
  2530  		return nil, err
  2531  	}
  2532  	req.Header = reqHeaders
  2533  	googleapi.Expand(req.URL, map[string]string{
  2534  		"resource": c.resource,
  2535  	})
  2536  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2537  }
  2538  
  2539  // Do executes the "servicedirectory.projects.locations.namespaces.services.getIamPolicy" call.
  2540  // Any non-2xx status code is an error. Response headers are in either
  2541  // *Policy.ServerResponse.Header or (if a response was returned at all) in
  2542  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2543  // whether the returned error was because http.StatusNotModified was returned.
  2544  func (c *ProjectsLocationsNamespacesServicesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  2545  	gensupport.SetOptions(c.urlParams_, opts...)
  2546  	res, err := c.doRequest("json")
  2547  	if res != nil && res.StatusCode == http.StatusNotModified {
  2548  		if res.Body != nil {
  2549  			res.Body.Close()
  2550  		}
  2551  		return nil, gensupport.WrapError(&googleapi.Error{
  2552  			Code:   res.StatusCode,
  2553  			Header: res.Header,
  2554  		})
  2555  	}
  2556  	if err != nil {
  2557  		return nil, err
  2558  	}
  2559  	defer googleapi.CloseBody(res)
  2560  	if err := googleapi.CheckResponse(res); err != nil {
  2561  		return nil, gensupport.WrapError(err)
  2562  	}
  2563  	ret := &Policy{
  2564  		ServerResponse: googleapi.ServerResponse{
  2565  			Header:         res.Header,
  2566  			HTTPStatusCode: res.StatusCode,
  2567  		},
  2568  	}
  2569  	target := &ret
  2570  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2571  		return nil, err
  2572  	}
  2573  	return ret, nil
  2574  }
  2575  
  2576  type ProjectsLocationsNamespacesServicesListCall struct {
  2577  	s            *APIService
  2578  	parent       string
  2579  	urlParams_   gensupport.URLParams
  2580  	ifNoneMatch_ string
  2581  	ctx_         context.Context
  2582  	header_      http.Header
  2583  }
  2584  
  2585  // List: Lists all services belonging to a namespace.
  2586  //
  2587  //   - parent: The resource name of the namespace whose services you'd like to
  2588  //     list.
  2589  func (r *ProjectsLocationsNamespacesServicesService) List(parent string) *ProjectsLocationsNamespacesServicesListCall {
  2590  	c := &ProjectsLocationsNamespacesServicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2591  	c.parent = parent
  2592  	return c
  2593  }
  2594  
  2595  // Filter sets the optional parameter "filter": The filter to list results by.
  2596  // General `filter` string syntax: ` ()` * “ can be `name` or `metadata.` for
  2597  // map field * “ can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:`
  2598  // means `HAS`, and is roughly the same as `=` * “ must be the same data type
  2599  // as field * “ can be `AND`, `OR`, `NOT` Examples of valid filters: *
  2600  // `metadata.owner` returns services that have a metadata with the key `owner`,
  2601  // this is the same as `metadata:owner` * `metadata.protocol=gRPC` returns
  2602  // services that have key/value `protocol=gRPC` *
  2603  // `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services
  2604  // /service-c` returns services that have name that is alphabetically later
  2605  // than the string, so "service-e" is returned but "service-a" is not *
  2606  // `metadata.owner!=sd AND metadata.foo=bar` returns services that have `owner`
  2607  // in metadata key but value is not `sd` AND have key/value `foo=bar` *
  2608  // `doesnotexist.foo=bar` returns an empty list. Note that service doesn't have
  2609  // a field called "doesnotexist". Since the filter does not match any services,
  2610  // it returns no results * `attributes.managed_registration=true` returns
  2611  // services that are managed by a GCP product or service For more information
  2612  // about filtering, see API Filtering (https://aip.dev/160).
  2613  func (c *ProjectsLocationsNamespacesServicesListCall) Filter(filter string) *ProjectsLocationsNamespacesServicesListCall {
  2614  	c.urlParams_.Set("filter", filter)
  2615  	return c
  2616  }
  2617  
  2618  // OrderBy sets the optional parameter "orderBy": The order to list results by.
  2619  // General `order_by` string syntax: ` () (,)` * “ allows value: `name` * “
  2620  // ascending or descending order by “. If this is left blank, `asc` is used
  2621  // Note that an empty `order_by` string results in default order, which is
  2622  // order by `name` in ascending order.
  2623  func (c *ProjectsLocationsNamespacesServicesListCall) OrderBy(orderBy string) *ProjectsLocationsNamespacesServicesListCall {
  2624  	c.urlParams_.Set("orderBy", orderBy)
  2625  	return c
  2626  }
  2627  
  2628  // PageSize sets the optional parameter "pageSize": The maximum number of items
  2629  // to return. The default value is 100.
  2630  func (c *ProjectsLocationsNamespacesServicesListCall) PageSize(pageSize int64) *ProjectsLocationsNamespacesServicesListCall {
  2631  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  2632  	return c
  2633  }
  2634  
  2635  // PageToken sets the optional parameter "pageToken": The next_page_token value
  2636  // returned from a previous List request, if any.
  2637  func (c *ProjectsLocationsNamespacesServicesListCall) PageToken(pageToken string) *ProjectsLocationsNamespacesServicesListCall {
  2638  	c.urlParams_.Set("pageToken", pageToken)
  2639  	return c
  2640  }
  2641  
  2642  // Fields allows partial responses to be retrieved. See
  2643  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2644  // details.
  2645  func (c *ProjectsLocationsNamespacesServicesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsNamespacesServicesListCall {
  2646  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2647  	return c
  2648  }
  2649  
  2650  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2651  // object's ETag matches the given value. This is useful for getting updates
  2652  // only after the object has changed since the last request.
  2653  func (c *ProjectsLocationsNamespacesServicesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsNamespacesServicesListCall {
  2654  	c.ifNoneMatch_ = entityTag
  2655  	return c
  2656  }
  2657  
  2658  // Context sets the context to be used in this call's Do method.
  2659  func (c *ProjectsLocationsNamespacesServicesListCall) Context(ctx context.Context) *ProjectsLocationsNamespacesServicesListCall {
  2660  	c.ctx_ = ctx
  2661  	return c
  2662  }
  2663  
  2664  // Header returns a http.Header that can be modified by the caller to add
  2665  // headers to the request.
  2666  func (c *ProjectsLocationsNamespacesServicesListCall) Header() http.Header {
  2667  	if c.header_ == nil {
  2668  		c.header_ = make(http.Header)
  2669  	}
  2670  	return c.header_
  2671  }
  2672  
  2673  func (c *ProjectsLocationsNamespacesServicesListCall) doRequest(alt string) (*http.Response, error) {
  2674  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2675  	if c.ifNoneMatch_ != "" {
  2676  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2677  	}
  2678  	var body io.Reader = nil
  2679  	c.urlParams_.Set("alt", alt)
  2680  	c.urlParams_.Set("prettyPrint", "false")
  2681  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/services")
  2682  	urls += "?" + c.urlParams_.Encode()
  2683  	req, err := http.NewRequest("GET", urls, body)
  2684  	if err != nil {
  2685  		return nil, err
  2686  	}
  2687  	req.Header = reqHeaders
  2688  	googleapi.Expand(req.URL, map[string]string{
  2689  		"parent": c.parent,
  2690  	})
  2691  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2692  }
  2693  
  2694  // Do executes the "servicedirectory.projects.locations.namespaces.services.list" call.
  2695  // Any non-2xx status code is an error. Response headers are in either
  2696  // *ListServicesResponse.ServerResponse.Header or (if a response was returned
  2697  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2698  // check whether the returned error was because http.StatusNotModified was
  2699  // returned.
  2700  func (c *ProjectsLocationsNamespacesServicesListCall) Do(opts ...googleapi.CallOption) (*ListServicesResponse, error) {
  2701  	gensupport.SetOptions(c.urlParams_, opts...)
  2702  	res, err := c.doRequest("json")
  2703  	if res != nil && res.StatusCode == http.StatusNotModified {
  2704  		if res.Body != nil {
  2705  			res.Body.Close()
  2706  		}
  2707  		return nil, gensupport.WrapError(&googleapi.Error{
  2708  			Code:   res.StatusCode,
  2709  			Header: res.Header,
  2710  		})
  2711  	}
  2712  	if err != nil {
  2713  		return nil, err
  2714  	}
  2715  	defer googleapi.CloseBody(res)
  2716  	if err := googleapi.CheckResponse(res); err != nil {
  2717  		return nil, gensupport.WrapError(err)
  2718  	}
  2719  	ret := &ListServicesResponse{
  2720  		ServerResponse: googleapi.ServerResponse{
  2721  			Header:         res.Header,
  2722  			HTTPStatusCode: res.StatusCode,
  2723  		},
  2724  	}
  2725  	target := &ret
  2726  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2727  		return nil, err
  2728  	}
  2729  	return ret, nil
  2730  }
  2731  
  2732  // Pages invokes f for each page of results.
  2733  // A non-nil error returned from f will halt the iteration.
  2734  // The provided context supersedes any context provided to the Context method.
  2735  func (c *ProjectsLocationsNamespacesServicesListCall) Pages(ctx context.Context, f func(*ListServicesResponse) error) error {
  2736  	c.ctx_ = ctx
  2737  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  2738  	for {
  2739  		x, err := c.Do()
  2740  		if err != nil {
  2741  			return err
  2742  		}
  2743  		if err := f(x); err != nil {
  2744  			return err
  2745  		}
  2746  		if x.NextPageToken == "" {
  2747  			return nil
  2748  		}
  2749  		c.PageToken(x.NextPageToken)
  2750  	}
  2751  }
  2752  
  2753  type ProjectsLocationsNamespacesServicesPatchCall struct {
  2754  	s          *APIService
  2755  	name       string
  2756  	service    *Service
  2757  	urlParams_ gensupport.URLParams
  2758  	ctx_       context.Context
  2759  	header_    http.Header
  2760  }
  2761  
  2762  // Patch: Updates a service.
  2763  //
  2764  //   - name: Immutable. The resource name for the service in the format
  2765  //     `projects/*/locations/*/namespaces/*/services/*`.
  2766  func (r *ProjectsLocationsNamespacesServicesService) Patch(name string, service *Service) *ProjectsLocationsNamespacesServicesPatchCall {
  2767  	c := &ProjectsLocationsNamespacesServicesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2768  	c.name = name
  2769  	c.service = service
  2770  	return c
  2771  }
  2772  
  2773  // UpdateMask sets the optional parameter "updateMask": Required. List of
  2774  // fields to be updated in this request.
  2775  func (c *ProjectsLocationsNamespacesServicesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsNamespacesServicesPatchCall {
  2776  	c.urlParams_.Set("updateMask", updateMask)
  2777  	return c
  2778  }
  2779  
  2780  // Fields allows partial responses to be retrieved. See
  2781  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2782  // details.
  2783  func (c *ProjectsLocationsNamespacesServicesPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsNamespacesServicesPatchCall {
  2784  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2785  	return c
  2786  }
  2787  
  2788  // Context sets the context to be used in this call's Do method.
  2789  func (c *ProjectsLocationsNamespacesServicesPatchCall) Context(ctx context.Context) *ProjectsLocationsNamespacesServicesPatchCall {
  2790  	c.ctx_ = ctx
  2791  	return c
  2792  }
  2793  
  2794  // Header returns a http.Header that can be modified by the caller to add
  2795  // headers to the request.
  2796  func (c *ProjectsLocationsNamespacesServicesPatchCall) Header() http.Header {
  2797  	if c.header_ == nil {
  2798  		c.header_ = make(http.Header)
  2799  	}
  2800  	return c.header_
  2801  }
  2802  
  2803  func (c *ProjectsLocationsNamespacesServicesPatchCall) doRequest(alt string) (*http.Response, error) {
  2804  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  2805  	var body io.Reader = nil
  2806  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.service)
  2807  	if err != nil {
  2808  		return nil, err
  2809  	}
  2810  	c.urlParams_.Set("alt", alt)
  2811  	c.urlParams_.Set("prettyPrint", "false")
  2812  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  2813  	urls += "?" + c.urlParams_.Encode()
  2814  	req, err := http.NewRequest("PATCH", urls, body)
  2815  	if err != nil {
  2816  		return nil, err
  2817  	}
  2818  	req.Header = reqHeaders
  2819  	googleapi.Expand(req.URL, map[string]string{
  2820  		"name": c.name,
  2821  	})
  2822  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2823  }
  2824  
  2825  // Do executes the "servicedirectory.projects.locations.namespaces.services.patch" call.
  2826  // Any non-2xx status code is an error. Response headers are in either
  2827  // *Service.ServerResponse.Header or (if a response was returned at all) in
  2828  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2829  // whether the returned error was because http.StatusNotModified was returned.
  2830  func (c *ProjectsLocationsNamespacesServicesPatchCall) Do(opts ...googleapi.CallOption) (*Service, error) {
  2831  	gensupport.SetOptions(c.urlParams_, opts...)
  2832  	res, err := c.doRequest("json")
  2833  	if res != nil && res.StatusCode == http.StatusNotModified {
  2834  		if res.Body != nil {
  2835  			res.Body.Close()
  2836  		}
  2837  		return nil, gensupport.WrapError(&googleapi.Error{
  2838  			Code:   res.StatusCode,
  2839  			Header: res.Header,
  2840  		})
  2841  	}
  2842  	if err != nil {
  2843  		return nil, err
  2844  	}
  2845  	defer googleapi.CloseBody(res)
  2846  	if err := googleapi.CheckResponse(res); err != nil {
  2847  		return nil, gensupport.WrapError(err)
  2848  	}
  2849  	ret := &Service{
  2850  		ServerResponse: googleapi.ServerResponse{
  2851  			Header:         res.Header,
  2852  			HTTPStatusCode: res.StatusCode,
  2853  		},
  2854  	}
  2855  	target := &ret
  2856  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2857  		return nil, err
  2858  	}
  2859  	return ret, nil
  2860  }
  2861  
  2862  type ProjectsLocationsNamespacesServicesResolveCall struct {
  2863  	s                     *APIService
  2864  	name                  string
  2865  	resolveservicerequest *ResolveServiceRequest
  2866  	urlParams_            gensupport.URLParams
  2867  	ctx_                  context.Context
  2868  	header_               http.Header
  2869  }
  2870  
  2871  // Resolve: Returns a service and its associated endpoints. Resolving a service
  2872  // is not considered an active developer method.
  2873  //
  2874  // - name: The name of the service to resolve.
  2875  func (r *ProjectsLocationsNamespacesServicesService) Resolve(name string, resolveservicerequest *ResolveServiceRequest) *ProjectsLocationsNamespacesServicesResolveCall {
  2876  	c := &ProjectsLocationsNamespacesServicesResolveCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2877  	c.name = name
  2878  	c.resolveservicerequest = resolveservicerequest
  2879  	return c
  2880  }
  2881  
  2882  // Fields allows partial responses to be retrieved. See
  2883  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2884  // details.
  2885  func (c *ProjectsLocationsNamespacesServicesResolveCall) Fields(s ...googleapi.Field) *ProjectsLocationsNamespacesServicesResolveCall {
  2886  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2887  	return c
  2888  }
  2889  
  2890  // Context sets the context to be used in this call's Do method.
  2891  func (c *ProjectsLocationsNamespacesServicesResolveCall) Context(ctx context.Context) *ProjectsLocationsNamespacesServicesResolveCall {
  2892  	c.ctx_ = ctx
  2893  	return c
  2894  }
  2895  
  2896  // Header returns a http.Header that can be modified by the caller to add
  2897  // headers to the request.
  2898  func (c *ProjectsLocationsNamespacesServicesResolveCall) Header() http.Header {
  2899  	if c.header_ == nil {
  2900  		c.header_ = make(http.Header)
  2901  	}
  2902  	return c.header_
  2903  }
  2904  
  2905  func (c *ProjectsLocationsNamespacesServicesResolveCall) doRequest(alt string) (*http.Response, error) {
  2906  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  2907  	var body io.Reader = nil
  2908  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.resolveservicerequest)
  2909  	if err != nil {
  2910  		return nil, err
  2911  	}
  2912  	c.urlParams_.Set("alt", alt)
  2913  	c.urlParams_.Set("prettyPrint", "false")
  2914  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:resolve")
  2915  	urls += "?" + c.urlParams_.Encode()
  2916  	req, err := http.NewRequest("POST", urls, body)
  2917  	if err != nil {
  2918  		return nil, err
  2919  	}
  2920  	req.Header = reqHeaders
  2921  	googleapi.Expand(req.URL, map[string]string{
  2922  		"name": c.name,
  2923  	})
  2924  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2925  }
  2926  
  2927  // Do executes the "servicedirectory.projects.locations.namespaces.services.resolve" call.
  2928  // Any non-2xx status code is an error. Response headers are in either
  2929  // *ResolveServiceResponse.ServerResponse.Header or (if a response was returned
  2930  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2931  // check whether the returned error was because http.StatusNotModified was
  2932  // returned.
  2933  func (c *ProjectsLocationsNamespacesServicesResolveCall) Do(opts ...googleapi.CallOption) (*ResolveServiceResponse, error) {
  2934  	gensupport.SetOptions(c.urlParams_, opts...)
  2935  	res, err := c.doRequest("json")
  2936  	if res != nil && res.StatusCode == http.StatusNotModified {
  2937  		if res.Body != nil {
  2938  			res.Body.Close()
  2939  		}
  2940  		return nil, gensupport.WrapError(&googleapi.Error{
  2941  			Code:   res.StatusCode,
  2942  			Header: res.Header,
  2943  		})
  2944  	}
  2945  	if err != nil {
  2946  		return nil, err
  2947  	}
  2948  	defer googleapi.CloseBody(res)
  2949  	if err := googleapi.CheckResponse(res); err != nil {
  2950  		return nil, gensupport.WrapError(err)
  2951  	}
  2952  	ret := &ResolveServiceResponse{
  2953  		ServerResponse: googleapi.ServerResponse{
  2954  			Header:         res.Header,
  2955  			HTTPStatusCode: res.StatusCode,
  2956  		},
  2957  	}
  2958  	target := &ret
  2959  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2960  		return nil, err
  2961  	}
  2962  	return ret, nil
  2963  }
  2964  
  2965  type ProjectsLocationsNamespacesServicesSetIamPolicyCall struct {
  2966  	s                   *APIService
  2967  	resource            string
  2968  	setiampolicyrequest *SetIamPolicyRequest
  2969  	urlParams_          gensupport.URLParams
  2970  	ctx_                context.Context
  2971  	header_             http.Header
  2972  }
  2973  
  2974  // SetIamPolicy: Sets the IAM Policy for a resource
  2975  //
  2976  //   - resource: REQUIRED: The resource for which the policy is being specified.
  2977  //     See Resource names (https://cloud.google.com/apis/design/resource_names)
  2978  //     for the appropriate value for this field.
  2979  func (r *ProjectsLocationsNamespacesServicesService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsNamespacesServicesSetIamPolicyCall {
  2980  	c := &ProjectsLocationsNamespacesServicesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2981  	c.resource = resource
  2982  	c.setiampolicyrequest = setiampolicyrequest
  2983  	return c
  2984  }
  2985  
  2986  // Fields allows partial responses to be retrieved. See
  2987  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2988  // details.
  2989  func (c *ProjectsLocationsNamespacesServicesSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsNamespacesServicesSetIamPolicyCall {
  2990  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2991  	return c
  2992  }
  2993  
  2994  // Context sets the context to be used in this call's Do method.
  2995  func (c *ProjectsLocationsNamespacesServicesSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsNamespacesServicesSetIamPolicyCall {
  2996  	c.ctx_ = ctx
  2997  	return c
  2998  }
  2999  
  3000  // Header returns a http.Header that can be modified by the caller to add
  3001  // headers to the request.
  3002  func (c *ProjectsLocationsNamespacesServicesSetIamPolicyCall) Header() http.Header {
  3003  	if c.header_ == nil {
  3004  		c.header_ = make(http.Header)
  3005  	}
  3006  	return c.header_
  3007  }
  3008  
  3009  func (c *ProjectsLocationsNamespacesServicesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  3010  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3011  	var body io.Reader = nil
  3012  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
  3013  	if err != nil {
  3014  		return nil, err
  3015  	}
  3016  	c.urlParams_.Set("alt", alt)
  3017  	c.urlParams_.Set("prettyPrint", "false")
  3018  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:setIamPolicy")
  3019  	urls += "?" + c.urlParams_.Encode()
  3020  	req, err := http.NewRequest("POST", urls, body)
  3021  	if err != nil {
  3022  		return nil, err
  3023  	}
  3024  	req.Header = reqHeaders
  3025  	googleapi.Expand(req.URL, map[string]string{
  3026  		"resource": c.resource,
  3027  	})
  3028  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3029  }
  3030  
  3031  // Do executes the "servicedirectory.projects.locations.namespaces.services.setIamPolicy" call.
  3032  // Any non-2xx status code is an error. Response headers are in either
  3033  // *Policy.ServerResponse.Header or (if a response was returned at all) in
  3034  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3035  // whether the returned error was because http.StatusNotModified was returned.
  3036  func (c *ProjectsLocationsNamespacesServicesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  3037  	gensupport.SetOptions(c.urlParams_, opts...)
  3038  	res, err := c.doRequest("json")
  3039  	if res != nil && res.StatusCode == http.StatusNotModified {
  3040  		if res.Body != nil {
  3041  			res.Body.Close()
  3042  		}
  3043  		return nil, gensupport.WrapError(&googleapi.Error{
  3044  			Code:   res.StatusCode,
  3045  			Header: res.Header,
  3046  		})
  3047  	}
  3048  	if err != nil {
  3049  		return nil, err
  3050  	}
  3051  	defer googleapi.CloseBody(res)
  3052  	if err := googleapi.CheckResponse(res); err != nil {
  3053  		return nil, gensupport.WrapError(err)
  3054  	}
  3055  	ret := &Policy{
  3056  		ServerResponse: googleapi.ServerResponse{
  3057  			Header:         res.Header,
  3058  			HTTPStatusCode: res.StatusCode,
  3059  		},
  3060  	}
  3061  	target := &ret
  3062  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3063  		return nil, err
  3064  	}
  3065  	return ret, nil
  3066  }
  3067  
  3068  type ProjectsLocationsNamespacesServicesTestIamPermissionsCall struct {
  3069  	s                         *APIService
  3070  	resource                  string
  3071  	testiampermissionsrequest *TestIamPermissionsRequest
  3072  	urlParams_                gensupport.URLParams
  3073  	ctx_                      context.Context
  3074  	header_                   http.Header
  3075  }
  3076  
  3077  // TestIamPermissions: Tests IAM permissions for a resource (namespace, service
  3078  // or service workload only).
  3079  //
  3080  //   - resource: REQUIRED: The resource for which the policy detail is being
  3081  //     requested. See Resource names
  3082  //     (https://cloud.google.com/apis/design/resource_names) for the appropriate
  3083  //     value for this field.
  3084  func (r *ProjectsLocationsNamespacesServicesService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsNamespacesServicesTestIamPermissionsCall {
  3085  	c := &ProjectsLocationsNamespacesServicesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3086  	c.resource = resource
  3087  	c.testiampermissionsrequest = testiampermissionsrequest
  3088  	return c
  3089  }
  3090  
  3091  // Fields allows partial responses to be retrieved. See
  3092  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3093  // details.
  3094  func (c *ProjectsLocationsNamespacesServicesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsNamespacesServicesTestIamPermissionsCall {
  3095  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3096  	return c
  3097  }
  3098  
  3099  // Context sets the context to be used in this call's Do method.
  3100  func (c *ProjectsLocationsNamespacesServicesTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsNamespacesServicesTestIamPermissionsCall {
  3101  	c.ctx_ = ctx
  3102  	return c
  3103  }
  3104  
  3105  // Header returns a http.Header that can be modified by the caller to add
  3106  // headers to the request.
  3107  func (c *ProjectsLocationsNamespacesServicesTestIamPermissionsCall) Header() http.Header {
  3108  	if c.header_ == nil {
  3109  		c.header_ = make(http.Header)
  3110  	}
  3111  	return c.header_
  3112  }
  3113  
  3114  func (c *ProjectsLocationsNamespacesServicesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  3115  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3116  	var body io.Reader = nil
  3117  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
  3118  	if err != nil {
  3119  		return nil, err
  3120  	}
  3121  	c.urlParams_.Set("alt", alt)
  3122  	c.urlParams_.Set("prettyPrint", "false")
  3123  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:testIamPermissions")
  3124  	urls += "?" + c.urlParams_.Encode()
  3125  	req, err := http.NewRequest("POST", urls, body)
  3126  	if err != nil {
  3127  		return nil, err
  3128  	}
  3129  	req.Header = reqHeaders
  3130  	googleapi.Expand(req.URL, map[string]string{
  3131  		"resource": c.resource,
  3132  	})
  3133  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3134  }
  3135  
  3136  // Do executes the "servicedirectory.projects.locations.namespaces.services.testIamPermissions" call.
  3137  // Any non-2xx status code is an error. Response headers are in either
  3138  // *TestIamPermissionsResponse.ServerResponse.Header or (if a response was
  3139  // returned at all) in error.(*googleapi.Error).Header. Use
  3140  // googleapi.IsNotModified to check whether the returned error was because
  3141  // http.StatusNotModified was returned.
  3142  func (c *ProjectsLocationsNamespacesServicesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
  3143  	gensupport.SetOptions(c.urlParams_, opts...)
  3144  	res, err := c.doRequest("json")
  3145  	if res != nil && res.StatusCode == http.StatusNotModified {
  3146  		if res.Body != nil {
  3147  			res.Body.Close()
  3148  		}
  3149  		return nil, gensupport.WrapError(&googleapi.Error{
  3150  			Code:   res.StatusCode,
  3151  			Header: res.Header,
  3152  		})
  3153  	}
  3154  	if err != nil {
  3155  		return nil, err
  3156  	}
  3157  	defer googleapi.CloseBody(res)
  3158  	if err := googleapi.CheckResponse(res); err != nil {
  3159  		return nil, gensupport.WrapError(err)
  3160  	}
  3161  	ret := &TestIamPermissionsResponse{
  3162  		ServerResponse: googleapi.ServerResponse{
  3163  			Header:         res.Header,
  3164  			HTTPStatusCode: res.StatusCode,
  3165  		},
  3166  	}
  3167  	target := &ret
  3168  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3169  		return nil, err
  3170  	}
  3171  	return ret, nil
  3172  }
  3173  
  3174  type ProjectsLocationsNamespacesServicesEndpointsCreateCall struct {
  3175  	s          *APIService
  3176  	parent     string
  3177  	endpoint   *Endpoint
  3178  	urlParams_ gensupport.URLParams
  3179  	ctx_       context.Context
  3180  	header_    http.Header
  3181  }
  3182  
  3183  // Create: Creates an endpoint, and returns the new endpoint.
  3184  //
  3185  // - parent: The resource name of the service that this endpoint provides.
  3186  func (r *ProjectsLocationsNamespacesServicesEndpointsService) Create(parent string, endpoint *Endpoint) *ProjectsLocationsNamespacesServicesEndpointsCreateCall {
  3187  	c := &ProjectsLocationsNamespacesServicesEndpointsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3188  	c.parent = parent
  3189  	c.endpoint = endpoint
  3190  	return c
  3191  }
  3192  
  3193  // EndpointId sets the optional parameter "endpointId": Required. The Resource
  3194  // ID must be 1-63 characters long, and comply with RFC1035. Specifically, the
  3195  // name must be 1-63 characters long and match the regular expression
  3196  // `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first character must be
  3197  // a lowercase letter, and all following characters must be a dash, lowercase
  3198  // letter, or digit, except the last character, which cannot be a dash.
  3199  func (c *ProjectsLocationsNamespacesServicesEndpointsCreateCall) EndpointId(endpointId string) *ProjectsLocationsNamespacesServicesEndpointsCreateCall {
  3200  	c.urlParams_.Set("endpointId", endpointId)
  3201  	return c
  3202  }
  3203  
  3204  // Fields allows partial responses to be retrieved. See
  3205  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3206  // details.
  3207  func (c *ProjectsLocationsNamespacesServicesEndpointsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsNamespacesServicesEndpointsCreateCall {
  3208  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3209  	return c
  3210  }
  3211  
  3212  // Context sets the context to be used in this call's Do method.
  3213  func (c *ProjectsLocationsNamespacesServicesEndpointsCreateCall) Context(ctx context.Context) *ProjectsLocationsNamespacesServicesEndpointsCreateCall {
  3214  	c.ctx_ = ctx
  3215  	return c
  3216  }
  3217  
  3218  // Header returns a http.Header that can be modified by the caller to add
  3219  // headers to the request.
  3220  func (c *ProjectsLocationsNamespacesServicesEndpointsCreateCall) Header() http.Header {
  3221  	if c.header_ == nil {
  3222  		c.header_ = make(http.Header)
  3223  	}
  3224  	return c.header_
  3225  }
  3226  
  3227  func (c *ProjectsLocationsNamespacesServicesEndpointsCreateCall) doRequest(alt string) (*http.Response, error) {
  3228  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3229  	var body io.Reader = nil
  3230  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.endpoint)
  3231  	if err != nil {
  3232  		return nil, err
  3233  	}
  3234  	c.urlParams_.Set("alt", alt)
  3235  	c.urlParams_.Set("prettyPrint", "false")
  3236  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/endpoints")
  3237  	urls += "?" + c.urlParams_.Encode()
  3238  	req, err := http.NewRequest("POST", urls, body)
  3239  	if err != nil {
  3240  		return nil, err
  3241  	}
  3242  	req.Header = reqHeaders
  3243  	googleapi.Expand(req.URL, map[string]string{
  3244  		"parent": c.parent,
  3245  	})
  3246  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3247  }
  3248  
  3249  // Do executes the "servicedirectory.projects.locations.namespaces.services.endpoints.create" call.
  3250  // Any non-2xx status code is an error. Response headers are in either
  3251  // *Endpoint.ServerResponse.Header or (if a response was returned at all) in
  3252  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3253  // whether the returned error was because http.StatusNotModified was returned.
  3254  func (c *ProjectsLocationsNamespacesServicesEndpointsCreateCall) Do(opts ...googleapi.CallOption) (*Endpoint, error) {
  3255  	gensupport.SetOptions(c.urlParams_, opts...)
  3256  	res, err := c.doRequest("json")
  3257  	if res != nil && res.StatusCode == http.StatusNotModified {
  3258  		if res.Body != nil {
  3259  			res.Body.Close()
  3260  		}
  3261  		return nil, gensupport.WrapError(&googleapi.Error{
  3262  			Code:   res.StatusCode,
  3263  			Header: res.Header,
  3264  		})
  3265  	}
  3266  	if err != nil {
  3267  		return nil, err
  3268  	}
  3269  	defer googleapi.CloseBody(res)
  3270  	if err := googleapi.CheckResponse(res); err != nil {
  3271  		return nil, gensupport.WrapError(err)
  3272  	}
  3273  	ret := &Endpoint{
  3274  		ServerResponse: googleapi.ServerResponse{
  3275  			Header:         res.Header,
  3276  			HTTPStatusCode: res.StatusCode,
  3277  		},
  3278  	}
  3279  	target := &ret
  3280  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3281  		return nil, err
  3282  	}
  3283  	return ret, nil
  3284  }
  3285  
  3286  type ProjectsLocationsNamespacesServicesEndpointsDeleteCall struct {
  3287  	s          *APIService
  3288  	name       string
  3289  	urlParams_ gensupport.URLParams
  3290  	ctx_       context.Context
  3291  	header_    http.Header
  3292  }
  3293  
  3294  // Delete: Deletes an endpoint.
  3295  //
  3296  // - name: The name of the endpoint to delete.
  3297  func (r *ProjectsLocationsNamespacesServicesEndpointsService) Delete(name string) *ProjectsLocationsNamespacesServicesEndpointsDeleteCall {
  3298  	c := &ProjectsLocationsNamespacesServicesEndpointsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3299  	c.name = name
  3300  	return c
  3301  }
  3302  
  3303  // Fields allows partial responses to be retrieved. See
  3304  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3305  // details.
  3306  func (c *ProjectsLocationsNamespacesServicesEndpointsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsNamespacesServicesEndpointsDeleteCall {
  3307  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3308  	return c
  3309  }
  3310  
  3311  // Context sets the context to be used in this call's Do method.
  3312  func (c *ProjectsLocationsNamespacesServicesEndpointsDeleteCall) Context(ctx context.Context) *ProjectsLocationsNamespacesServicesEndpointsDeleteCall {
  3313  	c.ctx_ = ctx
  3314  	return c
  3315  }
  3316  
  3317  // Header returns a http.Header that can be modified by the caller to add
  3318  // headers to the request.
  3319  func (c *ProjectsLocationsNamespacesServicesEndpointsDeleteCall) Header() http.Header {
  3320  	if c.header_ == nil {
  3321  		c.header_ = make(http.Header)
  3322  	}
  3323  	return c.header_
  3324  }
  3325  
  3326  func (c *ProjectsLocationsNamespacesServicesEndpointsDeleteCall) doRequest(alt string) (*http.Response, error) {
  3327  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  3328  	var body io.Reader = nil
  3329  	c.urlParams_.Set("alt", alt)
  3330  	c.urlParams_.Set("prettyPrint", "false")
  3331  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  3332  	urls += "?" + c.urlParams_.Encode()
  3333  	req, err := http.NewRequest("DELETE", urls, body)
  3334  	if err != nil {
  3335  		return nil, err
  3336  	}
  3337  	req.Header = reqHeaders
  3338  	googleapi.Expand(req.URL, map[string]string{
  3339  		"name": c.name,
  3340  	})
  3341  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3342  }
  3343  
  3344  // Do executes the "servicedirectory.projects.locations.namespaces.services.endpoints.delete" call.
  3345  // Any non-2xx status code is an error. Response headers are in either
  3346  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  3347  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3348  // whether the returned error was because http.StatusNotModified was returned.
  3349  func (c *ProjectsLocationsNamespacesServicesEndpointsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  3350  	gensupport.SetOptions(c.urlParams_, opts...)
  3351  	res, err := c.doRequest("json")
  3352  	if res != nil && res.StatusCode == http.StatusNotModified {
  3353  		if res.Body != nil {
  3354  			res.Body.Close()
  3355  		}
  3356  		return nil, gensupport.WrapError(&googleapi.Error{
  3357  			Code:   res.StatusCode,
  3358  			Header: res.Header,
  3359  		})
  3360  	}
  3361  	if err != nil {
  3362  		return nil, err
  3363  	}
  3364  	defer googleapi.CloseBody(res)
  3365  	if err := googleapi.CheckResponse(res); err != nil {
  3366  		return nil, gensupport.WrapError(err)
  3367  	}
  3368  	ret := &Empty{
  3369  		ServerResponse: googleapi.ServerResponse{
  3370  			Header:         res.Header,
  3371  			HTTPStatusCode: res.StatusCode,
  3372  		},
  3373  	}
  3374  	target := &ret
  3375  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3376  		return nil, err
  3377  	}
  3378  	return ret, nil
  3379  }
  3380  
  3381  type ProjectsLocationsNamespacesServicesEndpointsGetCall struct {
  3382  	s            *APIService
  3383  	name         string
  3384  	urlParams_   gensupport.URLParams
  3385  	ifNoneMatch_ string
  3386  	ctx_         context.Context
  3387  	header_      http.Header
  3388  }
  3389  
  3390  // Get: Gets an endpoint.
  3391  //
  3392  // - name: The name of the endpoint to get.
  3393  func (r *ProjectsLocationsNamespacesServicesEndpointsService) Get(name string) *ProjectsLocationsNamespacesServicesEndpointsGetCall {
  3394  	c := &ProjectsLocationsNamespacesServicesEndpointsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3395  	c.name = name
  3396  	return c
  3397  }
  3398  
  3399  // Fields allows partial responses to be retrieved. See
  3400  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3401  // details.
  3402  func (c *ProjectsLocationsNamespacesServicesEndpointsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsNamespacesServicesEndpointsGetCall {
  3403  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3404  	return c
  3405  }
  3406  
  3407  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  3408  // object's ETag matches the given value. This is useful for getting updates
  3409  // only after the object has changed since the last request.
  3410  func (c *ProjectsLocationsNamespacesServicesEndpointsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsNamespacesServicesEndpointsGetCall {
  3411  	c.ifNoneMatch_ = entityTag
  3412  	return c
  3413  }
  3414  
  3415  // Context sets the context to be used in this call's Do method.
  3416  func (c *ProjectsLocationsNamespacesServicesEndpointsGetCall) Context(ctx context.Context) *ProjectsLocationsNamespacesServicesEndpointsGetCall {
  3417  	c.ctx_ = ctx
  3418  	return c
  3419  }
  3420  
  3421  // Header returns a http.Header that can be modified by the caller to add
  3422  // headers to the request.
  3423  func (c *ProjectsLocationsNamespacesServicesEndpointsGetCall) Header() http.Header {
  3424  	if c.header_ == nil {
  3425  		c.header_ = make(http.Header)
  3426  	}
  3427  	return c.header_
  3428  }
  3429  
  3430  func (c *ProjectsLocationsNamespacesServicesEndpointsGetCall) doRequest(alt string) (*http.Response, error) {
  3431  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  3432  	if c.ifNoneMatch_ != "" {
  3433  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3434  	}
  3435  	var body io.Reader = nil
  3436  	c.urlParams_.Set("alt", alt)
  3437  	c.urlParams_.Set("prettyPrint", "false")
  3438  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  3439  	urls += "?" + c.urlParams_.Encode()
  3440  	req, err := http.NewRequest("GET", urls, body)
  3441  	if err != nil {
  3442  		return nil, err
  3443  	}
  3444  	req.Header = reqHeaders
  3445  	googleapi.Expand(req.URL, map[string]string{
  3446  		"name": c.name,
  3447  	})
  3448  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3449  }
  3450  
  3451  // Do executes the "servicedirectory.projects.locations.namespaces.services.endpoints.get" call.
  3452  // Any non-2xx status code is an error. Response headers are in either
  3453  // *Endpoint.ServerResponse.Header or (if a response was returned at all) in
  3454  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3455  // whether the returned error was because http.StatusNotModified was returned.
  3456  func (c *ProjectsLocationsNamespacesServicesEndpointsGetCall) Do(opts ...googleapi.CallOption) (*Endpoint, error) {
  3457  	gensupport.SetOptions(c.urlParams_, opts...)
  3458  	res, err := c.doRequest("json")
  3459  	if res != nil && res.StatusCode == http.StatusNotModified {
  3460  		if res.Body != nil {
  3461  			res.Body.Close()
  3462  		}
  3463  		return nil, gensupport.WrapError(&googleapi.Error{
  3464  			Code:   res.StatusCode,
  3465  			Header: res.Header,
  3466  		})
  3467  	}
  3468  	if err != nil {
  3469  		return nil, err
  3470  	}
  3471  	defer googleapi.CloseBody(res)
  3472  	if err := googleapi.CheckResponse(res); err != nil {
  3473  		return nil, gensupport.WrapError(err)
  3474  	}
  3475  	ret := &Endpoint{
  3476  		ServerResponse: googleapi.ServerResponse{
  3477  			Header:         res.Header,
  3478  			HTTPStatusCode: res.StatusCode,
  3479  		},
  3480  	}
  3481  	target := &ret
  3482  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3483  		return nil, err
  3484  	}
  3485  	return ret, nil
  3486  }
  3487  
  3488  type ProjectsLocationsNamespacesServicesEndpointsListCall struct {
  3489  	s            *APIService
  3490  	parent       string
  3491  	urlParams_   gensupport.URLParams
  3492  	ifNoneMatch_ string
  3493  	ctx_         context.Context
  3494  	header_      http.Header
  3495  }
  3496  
  3497  // List: Lists all endpoints.
  3498  //
  3499  //   - parent: The resource name of the service whose endpoints you'd like to
  3500  //     list.
  3501  func (r *ProjectsLocationsNamespacesServicesEndpointsService) List(parent string) *ProjectsLocationsNamespacesServicesEndpointsListCall {
  3502  	c := &ProjectsLocationsNamespacesServicesEndpointsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3503  	c.parent = parent
  3504  	return c
  3505  }
  3506  
  3507  // Filter sets the optional parameter "filter": The filter to list results by.
  3508  // General `filter` string syntax: ` ()` * “ can be `name`, `address`, `port`,
  3509  // `metadata.` for map field, or `attributes.` for attributes field * “ can be
  3510  // `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` means `HAS`, and is
  3511  // roughly the same as `=` * “ must be the same data type as field * “ can be
  3512  // `AND`, `OR`, `NOT` Examples of valid filters: * `metadata.owner` returns
  3513  // endpoints that have a metadata with the key `owner`, this is the same as
  3514  // `metadata:owner` * `metadata.protocol=gRPC` returns endpoints that have
  3515  // key/value `protocol=gRPC` * `address=192.108.1.105` returns endpoints that
  3516  // have this address * `port>8080` returns endpoints that have port number
  3517  // larger than 8080 *
  3518  // `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services
  3519  // /my-service/endpoints/endpoint-c` returns endpoints that have name that is
  3520  // alphabetically later than the string, so "endpoint-e" is returned but
  3521  // "endpoint-a" is not * `metadata.owner!=sd AND metadata.foo=bar` returns
  3522  // endpoints that have `owner` in metadata key but value is not `sd` AND have
  3523  // key/value `foo=bar` * `doesnotexist.foo=bar` returns an empty list. Note
  3524  // that endpoint doesn't have a field called "doesnotexist". Since the filter
  3525  // does not match any endpoints, it returns no results *
  3526  // `attributes.kubernetes_resource_type=KUBERNETES_RESOURCE_TYPE_CLUSTER_ IP`
  3527  // returns endpoints with the corresponding kubernetes_resource_type For more
  3528  // information about filtering, see API Filtering (https://aip.dev/160).
  3529  func (c *ProjectsLocationsNamespacesServicesEndpointsListCall) Filter(filter string) *ProjectsLocationsNamespacesServicesEndpointsListCall {
  3530  	c.urlParams_.Set("filter", filter)
  3531  	return c
  3532  }
  3533  
  3534  // OrderBy sets the optional parameter "orderBy": The order to list results by.
  3535  // General `order_by` string syntax: ` () (,)` * “ allows values: `name`,
  3536  // `address`, `port` * “ ascending or descending order by “. If this is left
  3537  // blank, `asc` is used Note that an empty `order_by` string results in default
  3538  // order, which is order by `name` in ascending order.
  3539  func (c *ProjectsLocationsNamespacesServicesEndpointsListCall) OrderBy(orderBy string) *ProjectsLocationsNamespacesServicesEndpointsListCall {
  3540  	c.urlParams_.Set("orderBy", orderBy)
  3541  	return c
  3542  }
  3543  
  3544  // PageSize sets the optional parameter "pageSize": The maximum number of items
  3545  // to return. The default value is 100.
  3546  func (c *ProjectsLocationsNamespacesServicesEndpointsListCall) PageSize(pageSize int64) *ProjectsLocationsNamespacesServicesEndpointsListCall {
  3547  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  3548  	return c
  3549  }
  3550  
  3551  // PageToken sets the optional parameter "pageToken": The next_page_token value
  3552  // returned from a previous List request, if any.
  3553  func (c *ProjectsLocationsNamespacesServicesEndpointsListCall) PageToken(pageToken string) *ProjectsLocationsNamespacesServicesEndpointsListCall {
  3554  	c.urlParams_.Set("pageToken", pageToken)
  3555  	return c
  3556  }
  3557  
  3558  // Fields allows partial responses to be retrieved. See
  3559  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3560  // details.
  3561  func (c *ProjectsLocationsNamespacesServicesEndpointsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsNamespacesServicesEndpointsListCall {
  3562  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3563  	return c
  3564  }
  3565  
  3566  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  3567  // object's ETag matches the given value. This is useful for getting updates
  3568  // only after the object has changed since the last request.
  3569  func (c *ProjectsLocationsNamespacesServicesEndpointsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsNamespacesServicesEndpointsListCall {
  3570  	c.ifNoneMatch_ = entityTag
  3571  	return c
  3572  }
  3573  
  3574  // Context sets the context to be used in this call's Do method.
  3575  func (c *ProjectsLocationsNamespacesServicesEndpointsListCall) Context(ctx context.Context) *ProjectsLocationsNamespacesServicesEndpointsListCall {
  3576  	c.ctx_ = ctx
  3577  	return c
  3578  }
  3579  
  3580  // Header returns a http.Header that can be modified by the caller to add
  3581  // headers to the request.
  3582  func (c *ProjectsLocationsNamespacesServicesEndpointsListCall) Header() http.Header {
  3583  	if c.header_ == nil {
  3584  		c.header_ = make(http.Header)
  3585  	}
  3586  	return c.header_
  3587  }
  3588  
  3589  func (c *ProjectsLocationsNamespacesServicesEndpointsListCall) doRequest(alt string) (*http.Response, error) {
  3590  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  3591  	if c.ifNoneMatch_ != "" {
  3592  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3593  	}
  3594  	var body io.Reader = nil
  3595  	c.urlParams_.Set("alt", alt)
  3596  	c.urlParams_.Set("prettyPrint", "false")
  3597  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/endpoints")
  3598  	urls += "?" + c.urlParams_.Encode()
  3599  	req, err := http.NewRequest("GET", urls, body)
  3600  	if err != nil {
  3601  		return nil, err
  3602  	}
  3603  	req.Header = reqHeaders
  3604  	googleapi.Expand(req.URL, map[string]string{
  3605  		"parent": c.parent,
  3606  	})
  3607  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3608  }
  3609  
  3610  // Do executes the "servicedirectory.projects.locations.namespaces.services.endpoints.list" call.
  3611  // Any non-2xx status code is an error. Response headers are in either
  3612  // *ListEndpointsResponse.ServerResponse.Header or (if a response was returned
  3613  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3614  // check whether the returned error was because http.StatusNotModified was
  3615  // returned.
  3616  func (c *ProjectsLocationsNamespacesServicesEndpointsListCall) Do(opts ...googleapi.CallOption) (*ListEndpointsResponse, error) {
  3617  	gensupport.SetOptions(c.urlParams_, opts...)
  3618  	res, err := c.doRequest("json")
  3619  	if res != nil && res.StatusCode == http.StatusNotModified {
  3620  		if res.Body != nil {
  3621  			res.Body.Close()
  3622  		}
  3623  		return nil, gensupport.WrapError(&googleapi.Error{
  3624  			Code:   res.StatusCode,
  3625  			Header: res.Header,
  3626  		})
  3627  	}
  3628  	if err != nil {
  3629  		return nil, err
  3630  	}
  3631  	defer googleapi.CloseBody(res)
  3632  	if err := googleapi.CheckResponse(res); err != nil {
  3633  		return nil, gensupport.WrapError(err)
  3634  	}
  3635  	ret := &ListEndpointsResponse{
  3636  		ServerResponse: googleapi.ServerResponse{
  3637  			Header:         res.Header,
  3638  			HTTPStatusCode: res.StatusCode,
  3639  		},
  3640  	}
  3641  	target := &ret
  3642  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3643  		return nil, err
  3644  	}
  3645  	return ret, nil
  3646  }
  3647  
  3648  // Pages invokes f for each page of results.
  3649  // A non-nil error returned from f will halt the iteration.
  3650  // The provided context supersedes any context provided to the Context method.
  3651  func (c *ProjectsLocationsNamespacesServicesEndpointsListCall) Pages(ctx context.Context, f func(*ListEndpointsResponse) error) error {
  3652  	c.ctx_ = ctx
  3653  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  3654  	for {
  3655  		x, err := c.Do()
  3656  		if err != nil {
  3657  			return err
  3658  		}
  3659  		if err := f(x); err != nil {
  3660  			return err
  3661  		}
  3662  		if x.NextPageToken == "" {
  3663  			return nil
  3664  		}
  3665  		c.PageToken(x.NextPageToken)
  3666  	}
  3667  }
  3668  
  3669  type ProjectsLocationsNamespacesServicesEndpointsPatchCall struct {
  3670  	s          *APIService
  3671  	name       string
  3672  	endpoint   *Endpoint
  3673  	urlParams_ gensupport.URLParams
  3674  	ctx_       context.Context
  3675  	header_    http.Header
  3676  }
  3677  
  3678  // Patch: Updates an endpoint.
  3679  //
  3680  //   - name: Immutable. The resource name for the endpoint in the format
  3681  //     `projects/*/locations/*/namespaces/*/services/*/endpoints/*`.
  3682  func (r *ProjectsLocationsNamespacesServicesEndpointsService) Patch(name string, endpoint *Endpoint) *ProjectsLocationsNamespacesServicesEndpointsPatchCall {
  3683  	c := &ProjectsLocationsNamespacesServicesEndpointsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3684  	c.name = name
  3685  	c.endpoint = endpoint
  3686  	return c
  3687  }
  3688  
  3689  // UpdateMask sets the optional parameter "updateMask": Required. List of
  3690  // fields to be updated in this request.
  3691  func (c *ProjectsLocationsNamespacesServicesEndpointsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsNamespacesServicesEndpointsPatchCall {
  3692  	c.urlParams_.Set("updateMask", updateMask)
  3693  	return c
  3694  }
  3695  
  3696  // Fields allows partial responses to be retrieved. See
  3697  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3698  // details.
  3699  func (c *ProjectsLocationsNamespacesServicesEndpointsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsNamespacesServicesEndpointsPatchCall {
  3700  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3701  	return c
  3702  }
  3703  
  3704  // Context sets the context to be used in this call's Do method.
  3705  func (c *ProjectsLocationsNamespacesServicesEndpointsPatchCall) Context(ctx context.Context) *ProjectsLocationsNamespacesServicesEndpointsPatchCall {
  3706  	c.ctx_ = ctx
  3707  	return c
  3708  }
  3709  
  3710  // Header returns a http.Header that can be modified by the caller to add
  3711  // headers to the request.
  3712  func (c *ProjectsLocationsNamespacesServicesEndpointsPatchCall) Header() http.Header {
  3713  	if c.header_ == nil {
  3714  		c.header_ = make(http.Header)
  3715  	}
  3716  	return c.header_
  3717  }
  3718  
  3719  func (c *ProjectsLocationsNamespacesServicesEndpointsPatchCall) doRequest(alt string) (*http.Response, error) {
  3720  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3721  	var body io.Reader = nil
  3722  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.endpoint)
  3723  	if err != nil {
  3724  		return nil, err
  3725  	}
  3726  	c.urlParams_.Set("alt", alt)
  3727  	c.urlParams_.Set("prettyPrint", "false")
  3728  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  3729  	urls += "?" + c.urlParams_.Encode()
  3730  	req, err := http.NewRequest("PATCH", urls, body)
  3731  	if err != nil {
  3732  		return nil, err
  3733  	}
  3734  	req.Header = reqHeaders
  3735  	googleapi.Expand(req.URL, map[string]string{
  3736  		"name": c.name,
  3737  	})
  3738  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3739  }
  3740  
  3741  // Do executes the "servicedirectory.projects.locations.namespaces.services.endpoints.patch" call.
  3742  // Any non-2xx status code is an error. Response headers are in either
  3743  // *Endpoint.ServerResponse.Header or (if a response was returned at all) in
  3744  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3745  // whether the returned error was because http.StatusNotModified was returned.
  3746  func (c *ProjectsLocationsNamespacesServicesEndpointsPatchCall) Do(opts ...googleapi.CallOption) (*Endpoint, error) {
  3747  	gensupport.SetOptions(c.urlParams_, opts...)
  3748  	res, err := c.doRequest("json")
  3749  	if res != nil && res.StatusCode == http.StatusNotModified {
  3750  		if res.Body != nil {
  3751  			res.Body.Close()
  3752  		}
  3753  		return nil, gensupport.WrapError(&googleapi.Error{
  3754  			Code:   res.StatusCode,
  3755  			Header: res.Header,
  3756  		})
  3757  	}
  3758  	if err != nil {
  3759  		return nil, err
  3760  	}
  3761  	defer googleapi.CloseBody(res)
  3762  	if err := googleapi.CheckResponse(res); err != nil {
  3763  		return nil, gensupport.WrapError(err)
  3764  	}
  3765  	ret := &Endpoint{
  3766  		ServerResponse: googleapi.ServerResponse{
  3767  			Header:         res.Header,
  3768  			HTTPStatusCode: res.StatusCode,
  3769  		},
  3770  	}
  3771  	target := &ret
  3772  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3773  		return nil, err
  3774  	}
  3775  	return ret, nil
  3776  }
  3777  
  3778  type ProjectsLocationsNamespacesWorkloadsGetIamPolicyCall struct {
  3779  	s                   *APIService
  3780  	resource            string
  3781  	getiampolicyrequest *GetIamPolicyRequest
  3782  	urlParams_          gensupport.URLParams
  3783  	ctx_                context.Context
  3784  	header_             http.Header
  3785  }
  3786  
  3787  // GetIamPolicy: Gets the IAM Policy for a resource
  3788  //
  3789  //   - resource: REQUIRED: The resource for which the policy is being requested.
  3790  //     See Resource names (https://cloud.google.com/apis/design/resource_names)
  3791  //     for the appropriate value for this field.
  3792  func (r *ProjectsLocationsNamespacesWorkloadsService) GetIamPolicy(resource string, getiampolicyrequest *GetIamPolicyRequest) *ProjectsLocationsNamespacesWorkloadsGetIamPolicyCall {
  3793  	c := &ProjectsLocationsNamespacesWorkloadsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3794  	c.resource = resource
  3795  	c.getiampolicyrequest = getiampolicyrequest
  3796  	return c
  3797  }
  3798  
  3799  // Fields allows partial responses to be retrieved. See
  3800  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3801  // details.
  3802  func (c *ProjectsLocationsNamespacesWorkloadsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsNamespacesWorkloadsGetIamPolicyCall {
  3803  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3804  	return c
  3805  }
  3806  
  3807  // Context sets the context to be used in this call's Do method.
  3808  func (c *ProjectsLocationsNamespacesWorkloadsGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsNamespacesWorkloadsGetIamPolicyCall {
  3809  	c.ctx_ = ctx
  3810  	return c
  3811  }
  3812  
  3813  // Header returns a http.Header that can be modified by the caller to add
  3814  // headers to the request.
  3815  func (c *ProjectsLocationsNamespacesWorkloadsGetIamPolicyCall) Header() http.Header {
  3816  	if c.header_ == nil {
  3817  		c.header_ = make(http.Header)
  3818  	}
  3819  	return c.header_
  3820  }
  3821  
  3822  func (c *ProjectsLocationsNamespacesWorkloadsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  3823  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3824  	var body io.Reader = nil
  3825  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest)
  3826  	if err != nil {
  3827  		return nil, err
  3828  	}
  3829  	c.urlParams_.Set("alt", alt)
  3830  	c.urlParams_.Set("prettyPrint", "false")
  3831  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:getIamPolicy")
  3832  	urls += "?" + c.urlParams_.Encode()
  3833  	req, err := http.NewRequest("POST", urls, body)
  3834  	if err != nil {
  3835  		return nil, err
  3836  	}
  3837  	req.Header = reqHeaders
  3838  	googleapi.Expand(req.URL, map[string]string{
  3839  		"resource": c.resource,
  3840  	})
  3841  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3842  }
  3843  
  3844  // Do executes the "servicedirectory.projects.locations.namespaces.workloads.getIamPolicy" call.
  3845  // Any non-2xx status code is an error. Response headers are in either
  3846  // *Policy.ServerResponse.Header or (if a response was returned at all) in
  3847  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3848  // whether the returned error was because http.StatusNotModified was returned.
  3849  func (c *ProjectsLocationsNamespacesWorkloadsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  3850  	gensupport.SetOptions(c.urlParams_, opts...)
  3851  	res, err := c.doRequest("json")
  3852  	if res != nil && res.StatusCode == http.StatusNotModified {
  3853  		if res.Body != nil {
  3854  			res.Body.Close()
  3855  		}
  3856  		return nil, gensupport.WrapError(&googleapi.Error{
  3857  			Code:   res.StatusCode,
  3858  			Header: res.Header,
  3859  		})
  3860  	}
  3861  	if err != nil {
  3862  		return nil, err
  3863  	}
  3864  	defer googleapi.CloseBody(res)
  3865  	if err := googleapi.CheckResponse(res); err != nil {
  3866  		return nil, gensupport.WrapError(err)
  3867  	}
  3868  	ret := &Policy{
  3869  		ServerResponse: googleapi.ServerResponse{
  3870  			Header:         res.Header,
  3871  			HTTPStatusCode: res.StatusCode,
  3872  		},
  3873  	}
  3874  	target := &ret
  3875  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3876  		return nil, err
  3877  	}
  3878  	return ret, nil
  3879  }
  3880  
  3881  type ProjectsLocationsNamespacesWorkloadsSetIamPolicyCall struct {
  3882  	s                   *APIService
  3883  	resource            string
  3884  	setiampolicyrequest *SetIamPolicyRequest
  3885  	urlParams_          gensupport.URLParams
  3886  	ctx_                context.Context
  3887  	header_             http.Header
  3888  }
  3889  
  3890  // SetIamPolicy: Sets the IAM Policy for a resource
  3891  //
  3892  //   - resource: REQUIRED: The resource for which the policy is being specified.
  3893  //     See Resource names (https://cloud.google.com/apis/design/resource_names)
  3894  //     for the appropriate value for this field.
  3895  func (r *ProjectsLocationsNamespacesWorkloadsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsNamespacesWorkloadsSetIamPolicyCall {
  3896  	c := &ProjectsLocationsNamespacesWorkloadsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3897  	c.resource = resource
  3898  	c.setiampolicyrequest = setiampolicyrequest
  3899  	return c
  3900  }
  3901  
  3902  // Fields allows partial responses to be retrieved. See
  3903  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3904  // details.
  3905  func (c *ProjectsLocationsNamespacesWorkloadsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsNamespacesWorkloadsSetIamPolicyCall {
  3906  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3907  	return c
  3908  }
  3909  
  3910  // Context sets the context to be used in this call's Do method.
  3911  func (c *ProjectsLocationsNamespacesWorkloadsSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsNamespacesWorkloadsSetIamPolicyCall {
  3912  	c.ctx_ = ctx
  3913  	return c
  3914  }
  3915  
  3916  // Header returns a http.Header that can be modified by the caller to add
  3917  // headers to the request.
  3918  func (c *ProjectsLocationsNamespacesWorkloadsSetIamPolicyCall) Header() http.Header {
  3919  	if c.header_ == nil {
  3920  		c.header_ = make(http.Header)
  3921  	}
  3922  	return c.header_
  3923  }
  3924  
  3925  func (c *ProjectsLocationsNamespacesWorkloadsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  3926  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3927  	var body io.Reader = nil
  3928  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
  3929  	if err != nil {
  3930  		return nil, err
  3931  	}
  3932  	c.urlParams_.Set("alt", alt)
  3933  	c.urlParams_.Set("prettyPrint", "false")
  3934  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:setIamPolicy")
  3935  	urls += "?" + c.urlParams_.Encode()
  3936  	req, err := http.NewRequest("POST", urls, body)
  3937  	if err != nil {
  3938  		return nil, err
  3939  	}
  3940  	req.Header = reqHeaders
  3941  	googleapi.Expand(req.URL, map[string]string{
  3942  		"resource": c.resource,
  3943  	})
  3944  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3945  }
  3946  
  3947  // Do executes the "servicedirectory.projects.locations.namespaces.workloads.setIamPolicy" call.
  3948  // Any non-2xx status code is an error. Response headers are in either
  3949  // *Policy.ServerResponse.Header or (if a response was returned at all) in
  3950  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3951  // whether the returned error was because http.StatusNotModified was returned.
  3952  func (c *ProjectsLocationsNamespacesWorkloadsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  3953  	gensupport.SetOptions(c.urlParams_, opts...)
  3954  	res, err := c.doRequest("json")
  3955  	if res != nil && res.StatusCode == http.StatusNotModified {
  3956  		if res.Body != nil {
  3957  			res.Body.Close()
  3958  		}
  3959  		return nil, gensupport.WrapError(&googleapi.Error{
  3960  			Code:   res.StatusCode,
  3961  			Header: res.Header,
  3962  		})
  3963  	}
  3964  	if err != nil {
  3965  		return nil, err
  3966  	}
  3967  	defer googleapi.CloseBody(res)
  3968  	if err := googleapi.CheckResponse(res); err != nil {
  3969  		return nil, gensupport.WrapError(err)
  3970  	}
  3971  	ret := &Policy{
  3972  		ServerResponse: googleapi.ServerResponse{
  3973  			Header:         res.Header,
  3974  			HTTPStatusCode: res.StatusCode,
  3975  		},
  3976  	}
  3977  	target := &ret
  3978  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3979  		return nil, err
  3980  	}
  3981  	return ret, nil
  3982  }
  3983  
  3984  type ProjectsLocationsNamespacesWorkloadsTestIamPermissionsCall struct {
  3985  	s                         *APIService
  3986  	resource                  string
  3987  	testiampermissionsrequest *TestIamPermissionsRequest
  3988  	urlParams_                gensupport.URLParams
  3989  	ctx_                      context.Context
  3990  	header_                   http.Header
  3991  }
  3992  
  3993  // TestIamPermissions: Tests IAM permissions for a resource (namespace, service
  3994  // or service workload only).
  3995  //
  3996  //   - resource: REQUIRED: The resource for which the policy detail is being
  3997  //     requested. See Resource names
  3998  //     (https://cloud.google.com/apis/design/resource_names) for the appropriate
  3999  //     value for this field.
  4000  func (r *ProjectsLocationsNamespacesWorkloadsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsNamespacesWorkloadsTestIamPermissionsCall {
  4001  	c := &ProjectsLocationsNamespacesWorkloadsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4002  	c.resource = resource
  4003  	c.testiampermissionsrequest = testiampermissionsrequest
  4004  	return c
  4005  }
  4006  
  4007  // Fields allows partial responses to be retrieved. See
  4008  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4009  // details.
  4010  func (c *ProjectsLocationsNamespacesWorkloadsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsNamespacesWorkloadsTestIamPermissionsCall {
  4011  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4012  	return c
  4013  }
  4014  
  4015  // Context sets the context to be used in this call's Do method.
  4016  func (c *ProjectsLocationsNamespacesWorkloadsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsNamespacesWorkloadsTestIamPermissionsCall {
  4017  	c.ctx_ = ctx
  4018  	return c
  4019  }
  4020  
  4021  // Header returns a http.Header that can be modified by the caller to add
  4022  // headers to the request.
  4023  func (c *ProjectsLocationsNamespacesWorkloadsTestIamPermissionsCall) Header() http.Header {
  4024  	if c.header_ == nil {
  4025  		c.header_ = make(http.Header)
  4026  	}
  4027  	return c.header_
  4028  }
  4029  
  4030  func (c *ProjectsLocationsNamespacesWorkloadsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  4031  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  4032  	var body io.Reader = nil
  4033  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
  4034  	if err != nil {
  4035  		return nil, err
  4036  	}
  4037  	c.urlParams_.Set("alt", alt)
  4038  	c.urlParams_.Set("prettyPrint", "false")
  4039  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:testIamPermissions")
  4040  	urls += "?" + c.urlParams_.Encode()
  4041  	req, err := http.NewRequest("POST", urls, body)
  4042  	if err != nil {
  4043  		return nil, err
  4044  	}
  4045  	req.Header = reqHeaders
  4046  	googleapi.Expand(req.URL, map[string]string{
  4047  		"resource": c.resource,
  4048  	})
  4049  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4050  }
  4051  
  4052  // Do executes the "servicedirectory.projects.locations.namespaces.workloads.testIamPermissions" call.
  4053  // Any non-2xx status code is an error. Response headers are in either
  4054  // *TestIamPermissionsResponse.ServerResponse.Header or (if a response was
  4055  // returned at all) in error.(*googleapi.Error).Header. Use
  4056  // googleapi.IsNotModified to check whether the returned error was because
  4057  // http.StatusNotModified was returned.
  4058  func (c *ProjectsLocationsNamespacesWorkloadsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
  4059  	gensupport.SetOptions(c.urlParams_, opts...)
  4060  	res, err := c.doRequest("json")
  4061  	if res != nil && res.StatusCode == http.StatusNotModified {
  4062  		if res.Body != nil {
  4063  			res.Body.Close()
  4064  		}
  4065  		return nil, gensupport.WrapError(&googleapi.Error{
  4066  			Code:   res.StatusCode,
  4067  			Header: res.Header,
  4068  		})
  4069  	}
  4070  	if err != nil {
  4071  		return nil, err
  4072  	}
  4073  	defer googleapi.CloseBody(res)
  4074  	if err := googleapi.CheckResponse(res); err != nil {
  4075  		return nil, gensupport.WrapError(err)
  4076  	}
  4077  	ret := &TestIamPermissionsResponse{
  4078  		ServerResponse: googleapi.ServerResponse{
  4079  			Header:         res.Header,
  4080  			HTTPStatusCode: res.StatusCode,
  4081  		},
  4082  	}
  4083  	target := &ret
  4084  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4085  		return nil, err
  4086  	}
  4087  	return ret, nil
  4088  }
  4089  

View as plain text