...

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

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

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

View as plain text