...

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

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

     1  // Copyright 2024 Google LLC.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  // Code generated file. DO NOT EDIT.
     6  
     7  // Package privateca provides access to the Certificate Authority API.
     8  //
     9  // For product documentation, see: https://cloud.google.com/
    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/privateca/v1beta1"
    27  //	...
    28  //	ctx := context.Background()
    29  //	privatecaService, err := privateca.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  //	privatecaService, err := privateca.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  //	privatecaService, err := privateca.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
    49  //
    50  // See [google.golang.org/api/option.ClientOption] for details on options.
    51  package privateca // import "google.golang.org/api/privateca/v1beta1"
    52  
    53  import (
    54  	"bytes"
    55  	"context"
    56  	"encoding/json"
    57  	"errors"
    58  	"fmt"
    59  	"io"
    60  	"net/http"
    61  	"net/url"
    62  	"strconv"
    63  	"strings"
    64  
    65  	googleapi "google.golang.org/api/googleapi"
    66  	internal "google.golang.org/api/internal"
    67  	gensupport "google.golang.org/api/internal/gensupport"
    68  	option "google.golang.org/api/option"
    69  	internaloption "google.golang.org/api/option/internaloption"
    70  	htransport "google.golang.org/api/transport/http"
    71  )
    72  
    73  // Always reference these packages, just in case the auto-generated code
    74  // below doesn't.
    75  var _ = bytes.NewBuffer
    76  var _ = strconv.Itoa
    77  var _ = fmt.Sprintf
    78  var _ = json.NewDecoder
    79  var _ = io.Copy
    80  var _ = url.Parse
    81  var _ = gensupport.MarshalJSON
    82  var _ = googleapi.Version
    83  var _ = errors.New
    84  var _ = strings.Replace
    85  var _ = context.Canceled
    86  var _ = internaloption.WithDefaultEndpoint
    87  var _ = internal.Version
    88  
    89  const apiId = "privateca:v1beta1"
    90  const apiName = "privateca"
    91  const apiVersion = "v1beta1"
    92  const basePath = "https://privateca.googleapis.com/"
    93  const basePathTemplate = "https://privateca.UNIVERSE_DOMAIN/"
    94  const mtlsBasePath = "https://privateca.mtls.googleapis.com/"
    95  
    96  // OAuth2 scopes used by this API.
    97  const (
    98  	// See, edit, configure, and delete your Google Cloud data and see the email
    99  	// address for your Google Account.
   100  	CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
   101  )
   102  
   103  // NewService creates a new Service.
   104  func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
   105  	scopesOption := internaloption.WithDefaultScopes(
   106  		"https://www.googleapis.com/auth/cloud-platform",
   107  	)
   108  	// NOTE: prepend, so we don't override user-specified scopes.
   109  	opts = append([]option.ClientOption{scopesOption}, opts...)
   110  	opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
   111  	opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
   112  	opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
   113  	opts = append(opts, internaloption.EnableNewAuthLibrary())
   114  	client, endpoint, err := htransport.NewClient(ctx, opts...)
   115  	if err != nil {
   116  		return nil, err
   117  	}
   118  	s, err := New(client)
   119  	if err != nil {
   120  		return nil, err
   121  	}
   122  	if endpoint != "" {
   123  		s.BasePath = endpoint
   124  	}
   125  	return s, nil
   126  }
   127  
   128  // New creates a new Service. It uses the provided http.Client for requests.
   129  //
   130  // Deprecated: please use NewService instead.
   131  // To provide a custom HTTP client, use option.WithHTTPClient.
   132  // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
   133  func New(client *http.Client) (*Service, error) {
   134  	if client == nil {
   135  		return nil, errors.New("client is nil")
   136  	}
   137  	s := &Service{client: client, BasePath: basePath}
   138  	s.Projects = NewProjectsService(s)
   139  	return s, nil
   140  }
   141  
   142  type Service struct {
   143  	client    *http.Client
   144  	BasePath  string // API endpoint base URL
   145  	UserAgent string // optional additional User-Agent fragment
   146  
   147  	Projects *ProjectsService
   148  }
   149  
   150  func (s *Service) userAgent() string {
   151  	if s.UserAgent == "" {
   152  		return googleapi.UserAgent
   153  	}
   154  	return googleapi.UserAgent + " " + s.UserAgent
   155  }
   156  
   157  func NewProjectsService(s *Service) *ProjectsService {
   158  	rs := &ProjectsService{s: s}
   159  	rs.Locations = NewProjectsLocationsService(s)
   160  	return rs
   161  }
   162  
   163  type ProjectsService struct {
   164  	s *Service
   165  
   166  	Locations *ProjectsLocationsService
   167  }
   168  
   169  func NewProjectsLocationsService(s *Service) *ProjectsLocationsService {
   170  	rs := &ProjectsLocationsService{s: s}
   171  	rs.CertificateAuthorities = NewProjectsLocationsCertificateAuthoritiesService(s)
   172  	rs.Operations = NewProjectsLocationsOperationsService(s)
   173  	rs.ReusableConfigs = NewProjectsLocationsReusableConfigsService(s)
   174  	return rs
   175  }
   176  
   177  type ProjectsLocationsService struct {
   178  	s *Service
   179  
   180  	CertificateAuthorities *ProjectsLocationsCertificateAuthoritiesService
   181  
   182  	Operations *ProjectsLocationsOperationsService
   183  
   184  	ReusableConfigs *ProjectsLocationsReusableConfigsService
   185  }
   186  
   187  func NewProjectsLocationsCertificateAuthoritiesService(s *Service) *ProjectsLocationsCertificateAuthoritiesService {
   188  	rs := &ProjectsLocationsCertificateAuthoritiesService{s: s}
   189  	rs.CertificateRevocationLists = NewProjectsLocationsCertificateAuthoritiesCertificateRevocationListsService(s)
   190  	return rs
   191  }
   192  
   193  type ProjectsLocationsCertificateAuthoritiesService struct {
   194  	s *Service
   195  
   196  	CertificateRevocationLists *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsService
   197  }
   198  
   199  func NewProjectsLocationsCertificateAuthoritiesCertificateRevocationListsService(s *Service) *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsService {
   200  	rs := &ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsService{s: s}
   201  	return rs
   202  }
   203  
   204  type ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsService struct {
   205  	s *Service
   206  }
   207  
   208  func NewProjectsLocationsOperationsService(s *Service) *ProjectsLocationsOperationsService {
   209  	rs := &ProjectsLocationsOperationsService{s: s}
   210  	return rs
   211  }
   212  
   213  type ProjectsLocationsOperationsService struct {
   214  	s *Service
   215  }
   216  
   217  func NewProjectsLocationsReusableConfigsService(s *Service) *ProjectsLocationsReusableConfigsService {
   218  	rs := &ProjectsLocationsReusableConfigsService{s: s}
   219  	return rs
   220  }
   221  
   222  type ProjectsLocationsReusableConfigsService struct {
   223  	s *Service
   224  }
   225  
   226  // AuditConfig: Specifies the audit configuration for a service. The
   227  // configuration determines which permission types are logged, and what
   228  // identities, if any, are exempted from logging. An AuditConfig must have one
   229  // or more AuditLogConfigs. If there are AuditConfigs for both `allServices`
   230  // and a specific service, the union of the two AuditConfigs is used for that
   231  // service: the log_types specified in each AuditConfig are enabled, and the
   232  // exempted_members in each AuditLogConfig are exempted. Example Policy with
   233  // multiple AuditConfigs: { "audit_configs": [ { "service": "allServices",
   234  // "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [
   235  // "user:jose@example.com" ] }, { "log_type": "DATA_WRITE" }, { "log_type":
   236  // "ADMIN_READ" } ] }, { "service": "sampleservice.googleapis.com",
   237  // "audit_log_configs": [ { "log_type": "DATA_READ" }, { "log_type":
   238  // "DATA_WRITE", "exempted_members": [ "user:aliya@example.com" ] } ] } ] } For
   239  // sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ
   240  // logging. It also exempts `jose@example.com` from DATA_READ logging, and
   241  // `aliya@example.com` from DATA_WRITE logging.
   242  type AuditConfig struct {
   243  	// AuditLogConfigs: The configuration for logging of each type of permission.
   244  	AuditLogConfigs []*AuditLogConfig `json:"auditLogConfigs,omitempty"`
   245  	// Service: Specifies a service that will be enabled for audit logging. For
   246  	// example, `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices`
   247  	// is a special value that covers all services.
   248  	Service string `json:"service,omitempty"`
   249  	// ForceSendFields is a list of field names (e.g. "AuditLogConfigs") to
   250  	// unconditionally include in API requests. By default, fields with empty or
   251  	// default values are omitted from API requests. See
   252  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   253  	// details.
   254  	ForceSendFields []string `json:"-"`
   255  	// NullFields is a list of field names (e.g. "AuditLogConfigs") to include in
   256  	// API requests with the JSON null value. By default, fields with empty values
   257  	// are omitted from API requests. See
   258  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   259  	NullFields []string `json:"-"`
   260  }
   261  
   262  func (s *AuditConfig) MarshalJSON() ([]byte, error) {
   263  	type NoMethod AuditConfig
   264  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   265  }
   266  
   267  // AuditLogConfig: Provides the configuration for logging a type of
   268  // permissions. Example: { "audit_log_configs": [ { "log_type": "DATA_READ",
   269  // "exempted_members": [ "user:jose@example.com" ] }, { "log_type":
   270  // "DATA_WRITE" } ] } This enables 'DATA_READ' and 'DATA_WRITE' logging, while
   271  // exempting jose@example.com from DATA_READ logging.
   272  type AuditLogConfig struct {
   273  	// ExemptedMembers: Specifies the identities that do not cause logging for this
   274  	// type of permission. Follows the same format of Binding.members.
   275  	ExemptedMembers []string `json:"exemptedMembers,omitempty"`
   276  	// LogType: The log type that this config enables.
   277  	//
   278  	// Possible values:
   279  	//   "LOG_TYPE_UNSPECIFIED" - Default case. Should never be this.
   280  	//   "ADMIN_READ" - Admin reads. Example: CloudIAM getIamPolicy
   281  	//   "DATA_WRITE" - Data writes. Example: CloudSQL Users create
   282  	//   "DATA_READ" - Data reads. Example: CloudSQL Users list
   283  	LogType string `json:"logType,omitempty"`
   284  	// ForceSendFields is a list of field names (e.g. "ExemptedMembers") to
   285  	// unconditionally include in API requests. By default, fields with empty or
   286  	// default values are omitted from API requests. See
   287  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   288  	// details.
   289  	ForceSendFields []string `json:"-"`
   290  	// NullFields is a list of field names (e.g. "ExemptedMembers") to include in
   291  	// API requests with the JSON null value. By default, fields with empty values
   292  	// are omitted from API requests. See
   293  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   294  	NullFields []string `json:"-"`
   295  }
   296  
   297  func (s *AuditLogConfig) MarshalJSON() ([]byte, error) {
   298  	type NoMethod AuditLogConfig
   299  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   300  }
   301  
   302  // Binding: Associates `members`, or principals, with a `role`.
   303  type Binding struct {
   304  	// Condition: The condition that is associated with this binding. If the
   305  	// condition evaluates to `true`, then this binding applies to the current
   306  	// request. If the condition evaluates to `false`, then this binding does not
   307  	// apply to the current request. However, a different role binding might grant
   308  	// the same role to one or more of the principals in this binding. To learn
   309  	// which resources support conditions in their IAM policies, see the IAM
   310  	// documentation
   311  	// (https://cloud.google.com/iam/help/conditions/resource-policies).
   312  	Condition *Expr `json:"condition,omitempty"`
   313  	// Members: Specifies the principals requesting access for a Google Cloud
   314  	// resource. `members` can have the following values: * `allUsers`: A special
   315  	// identifier that represents anyone who is on the internet; with or without a
   316  	// Google account. * `allAuthenticatedUsers`: A special identifier that
   317  	// represents anyone who is authenticated with a Google account or a service
   318  	// account. Does not include identities that come from external identity
   319  	// providers (IdPs) through identity federation. * `user:{emailid}`: An email
   320  	// address that represents a specific Google account. For example,
   321  	// `alice@example.com` . * `serviceAccount:{emailid}`: An email address that
   322  	// represents a Google service account. For example,
   323  	// `my-other-app@appspot.gserviceaccount.com`. *
   324  	// `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: An
   325  	// identifier for a Kubernetes service account
   326  	// (https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts).
   327  	// For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. *
   328  	// `group:{emailid}`: An email address that represents a Google group. For
   329  	// example, `admins@example.com`. * `domain:{domain}`: The G Suite domain
   330  	// (primary) that represents all the users of that domain. For example,
   331  	// `google.com` or `example.com`. *
   332  	// `principal://iam.googleapis.com/locations/global/workforcePools/{pool_id}/sub
   333  	// ject/{subject_attribute_value}`: A single identity in a workforce identity
   334  	// pool. *
   335  	// `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/
   336  	// group/{group_id}`: All workforce identities in a group. *
   337  	// `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/
   338  	// attribute.{attribute_name}/{attribute_value}`: All workforce identities with
   339  	// a specific attribute value. *
   340  	// `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/
   341  	// *`: All identities in a workforce identity pool. *
   342  	// `principal://iam.googleapis.com/projects/{project_number}/locations/global/wo
   343  	// rkloadIdentityPools/{pool_id}/subject/{subject_attribute_value}`: A single
   344  	// identity in a workload identity pool. *
   345  	// `principalSet://iam.googleapis.com/projects/{project_number}/locations/global
   346  	// /workloadIdentityPools/{pool_id}/group/{group_id}`: A workload identity pool
   347  	// group. *
   348  	// `principalSet://iam.googleapis.com/projects/{project_number}/locations/global
   349  	// /workloadIdentityPools/{pool_id}/attribute.{attribute_name}/{attribute_value}
   350  	// `: All identities in a workload identity pool with a certain attribute. *
   351  	// `principalSet://iam.googleapis.com/projects/{project_number}/locations/global
   352  	// /workloadIdentityPools/{pool_id}/*`: All identities in a workload identity
   353  	// pool. * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus
   354  	// unique identifier) representing a user that has been recently deleted. For
   355  	// example, `alice@example.com?uid=123456789012345678901`. If the user is
   356  	// recovered, this value reverts to `user:{emailid}` and the recovered user
   357  	// retains the role in the binding. *
   358  	// `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus
   359  	// unique identifier) representing a service account that has been recently
   360  	// deleted. For example,
   361  	// `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the
   362  	// service account is undeleted, this value reverts to
   363  	// `serviceAccount:{emailid}` and the undeleted service account retains the
   364  	// role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email
   365  	// address (plus unique identifier) representing a Google group that has been
   366  	// recently deleted. For example,
   367  	// `admins@example.com?uid=123456789012345678901`. If the group is recovered,
   368  	// this value reverts to `group:{emailid}` and the recovered group retains the
   369  	// role in the binding. *
   370  	// `deleted:principal://iam.googleapis.com/locations/global/workforcePools/{pool
   371  	// _id}/subject/{subject_attribute_value}`: Deleted single identity in a
   372  	// workforce identity pool. For example,
   373  	// `deleted:principal://iam.googleapis.com/locations/global/workforcePools/my-po
   374  	// ol-id/subject/my-subject-attribute-value`.
   375  	Members []string `json:"members,omitempty"`
   376  	// Role: Role that is assigned to the list of `members`, or principals. For
   377  	// example, `roles/viewer`, `roles/editor`, or `roles/owner`. For an overview
   378  	// of the IAM roles and permissions, see the IAM documentation
   379  	// (https://cloud.google.com/iam/docs/roles-overview). For a list of the
   380  	// available pre-defined roles, see here
   381  	// (https://cloud.google.com/iam/docs/understanding-roles).
   382  	Role string `json:"role,omitempty"`
   383  	// ForceSendFields is a list of field names (e.g. "Condition") to
   384  	// unconditionally include in API requests. By default, fields with empty or
   385  	// default values are omitted from API requests. See
   386  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   387  	// details.
   388  	ForceSendFields []string `json:"-"`
   389  	// NullFields is a list of field names (e.g. "Condition") to include in API
   390  	// requests with the JSON null value. By default, fields with empty values are
   391  	// omitted from API requests. See
   392  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   393  	NullFields []string `json:"-"`
   394  }
   395  
   396  func (s *Binding) MarshalJSON() ([]byte, error) {
   397  	type NoMethod Binding
   398  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   399  }
   400  
   401  // CancelOperationRequest: The request message for Operations.CancelOperation.
   402  type CancelOperationRequest struct {
   403  }
   404  
   405  // Empty: A generic empty message that you can re-use to avoid defining
   406  // duplicated empty messages in your APIs. A typical example is to use it as
   407  // the request or the response type of an API method. For instance: service Foo
   408  // { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }
   409  type Empty struct {
   410  	// ServerResponse contains the HTTP response code and headers from the server.
   411  	googleapi.ServerResponse `json:"-"`
   412  }
   413  
   414  // Expr: Represents a textual expression in the Common Expression Language
   415  // (CEL) syntax. CEL is a C-like expression language. The syntax and semantics
   416  // of CEL are documented at https://github.com/google/cel-spec. Example
   417  // (Comparison): title: "Summary size limit" description: "Determines if a
   418  // summary is less than 100 chars" expression: "document.summary.size() < 100"
   419  // Example (Equality): title: "Requestor is owner" description: "Determines if
   420  // requestor is the document owner" expression: "document.owner ==
   421  // request.auth.claims.email" Example (Logic): title: "Public documents"
   422  // description: "Determine whether the document should be publicly visible"
   423  // expression: "document.type != 'private' && document.type != 'internal'"
   424  // Example (Data Manipulation): title: "Notification string" description:
   425  // "Create a notification string with a timestamp." expression: "'New message
   426  // received at ' + string(document.create_time)" The exact variables and
   427  // functions that may be referenced within an expression are determined by the
   428  // service that evaluates it. See the service documentation for additional
   429  // information.
   430  type Expr struct {
   431  	// Description: Optional. Description of the expression. This is a longer text
   432  	// which describes the expression, e.g. when hovered over it in a UI.
   433  	Description string `json:"description,omitempty"`
   434  	// Expression: Textual representation of an expression in Common Expression
   435  	// Language syntax.
   436  	Expression string `json:"expression,omitempty"`
   437  	// Location: Optional. String indicating the location of the expression for
   438  	// error reporting, e.g. a file name and a position in the file.
   439  	Location string `json:"location,omitempty"`
   440  	// Title: Optional. Title for the expression, i.e. a short string describing
   441  	// its purpose. This can be used e.g. in UIs which allow to enter the
   442  	// expression.
   443  	Title string `json:"title,omitempty"`
   444  	// ForceSendFields is a list of field names (e.g. "Description") to
   445  	// unconditionally include in API requests. By default, fields with empty or
   446  	// default values are omitted from API requests. See
   447  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   448  	// details.
   449  	ForceSendFields []string `json:"-"`
   450  	// NullFields is a list of field names (e.g. "Description") to include in API
   451  	// requests with the JSON null value. By default, fields with empty values are
   452  	// omitted from API requests. See
   453  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   454  	NullFields []string `json:"-"`
   455  }
   456  
   457  func (s *Expr) MarshalJSON() ([]byte, error) {
   458  	type NoMethod Expr
   459  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   460  }
   461  
   462  // ListLocationsResponse: The response message for Locations.ListLocations.
   463  type ListLocationsResponse struct {
   464  	// Locations: A list of locations that matches the specified filter in the
   465  	// request.
   466  	Locations []*Location `json:"locations,omitempty"`
   467  	// NextPageToken: The standard List next-page token.
   468  	NextPageToken string `json:"nextPageToken,omitempty"`
   469  
   470  	// ServerResponse contains the HTTP response code and headers from the server.
   471  	googleapi.ServerResponse `json:"-"`
   472  	// ForceSendFields is a list of field names (e.g. "Locations") to
   473  	// unconditionally include in API requests. By default, fields with empty or
   474  	// default values are omitted from API requests. See
   475  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   476  	// details.
   477  	ForceSendFields []string `json:"-"`
   478  	// NullFields is a list of field names (e.g. "Locations") to include in API
   479  	// requests with the JSON null value. By default, fields with empty values are
   480  	// omitted from API requests. See
   481  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   482  	NullFields []string `json:"-"`
   483  }
   484  
   485  func (s *ListLocationsResponse) MarshalJSON() ([]byte, error) {
   486  	type NoMethod ListLocationsResponse
   487  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   488  }
   489  
   490  // ListOperationsResponse: The response message for Operations.ListOperations.
   491  type ListOperationsResponse struct {
   492  	// NextPageToken: The standard List next-page token.
   493  	NextPageToken string `json:"nextPageToken,omitempty"`
   494  	// Operations: A list of operations that matches the specified filter in the
   495  	// request.
   496  	Operations []*Operation `json:"operations,omitempty"`
   497  
   498  	// ServerResponse contains the HTTP response code and headers from the server.
   499  	googleapi.ServerResponse `json:"-"`
   500  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
   501  	// unconditionally include in API requests. By default, fields with empty or
   502  	// default values are omitted from API requests. See
   503  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   504  	// details.
   505  	ForceSendFields []string `json:"-"`
   506  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
   507  	// requests with the JSON null value. By default, fields with empty values are
   508  	// omitted from API requests. See
   509  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   510  	NullFields []string `json:"-"`
   511  }
   512  
   513  func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) {
   514  	type NoMethod ListOperationsResponse
   515  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   516  }
   517  
   518  // Location: A resource that represents a Google Cloud location.
   519  type Location struct {
   520  	// DisplayName: The friendly name for this location, typically a nearby city
   521  	// name. For example, "Tokyo".
   522  	DisplayName string `json:"displayName,omitempty"`
   523  	// Labels: Cross-service attributes for the location. For example
   524  	// {"cloud.googleapis.com/region": "us-east1"}
   525  	Labels map[string]string `json:"labels,omitempty"`
   526  	// LocationId: The canonical id for this location. For example: "us-east1".
   527  	LocationId string `json:"locationId,omitempty"`
   528  	// Metadata: Service-specific metadata. For example the available capacity at
   529  	// the given location.
   530  	Metadata googleapi.RawMessage `json:"metadata,omitempty"`
   531  	// Name: Resource name for the location, which may vary between
   532  	// implementations. For example:
   533  	// "projects/example-project/locations/us-east1"
   534  	Name string `json:"name,omitempty"`
   535  
   536  	// ServerResponse contains the HTTP response code and headers from the server.
   537  	googleapi.ServerResponse `json:"-"`
   538  	// ForceSendFields is a list of field names (e.g. "DisplayName") to
   539  	// unconditionally include in API requests. By default, fields with empty or
   540  	// default values are omitted from API requests. See
   541  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   542  	// details.
   543  	ForceSendFields []string `json:"-"`
   544  	// NullFields is a list of field names (e.g. "DisplayName") to include in API
   545  	// requests with the JSON null value. By default, fields with empty values are
   546  	// omitted from API requests. See
   547  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   548  	NullFields []string `json:"-"`
   549  }
   550  
   551  func (s *Location) MarshalJSON() ([]byte, error) {
   552  	type NoMethod Location
   553  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   554  }
   555  
   556  // Operation: This resource represents a long-running operation that is the
   557  // result of a network API call.
   558  type Operation struct {
   559  	// Done: If the value is `false`, it means the operation is still in progress.
   560  	// If `true`, the operation is completed, and either `error` or `response` is
   561  	// available.
   562  	Done bool `json:"done,omitempty"`
   563  	// Error: The error result of the operation in case of failure or cancellation.
   564  	Error *Status `json:"error,omitempty"`
   565  	// Metadata: Service-specific metadata associated with the operation. It
   566  	// typically contains progress information and common metadata such as create
   567  	// time. Some services might not provide such metadata. Any method that returns
   568  	// a long-running operation should document the metadata type, if any.
   569  	Metadata googleapi.RawMessage `json:"metadata,omitempty"`
   570  	// Name: The server-assigned name, which is only unique within the same service
   571  	// that originally returns it. If you use the default HTTP mapping, the `name`
   572  	// should be a resource name ending with `operations/{unique_id}`.
   573  	Name string `json:"name,omitempty"`
   574  	// Response: The normal, successful response of the operation. If the original
   575  	// method returns no data on success, such as `Delete`, the response is
   576  	// `google.protobuf.Empty`. If the original method is standard
   577  	// `Get`/`Create`/`Update`, the response should be the resource. For other
   578  	// methods, the response should have the type `XxxResponse`, where `Xxx` is the
   579  	// original method name. For example, if the original method name is
   580  	// `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
   581  	Response googleapi.RawMessage `json:"response,omitempty"`
   582  
   583  	// ServerResponse contains the HTTP response code and headers from the server.
   584  	googleapi.ServerResponse `json:"-"`
   585  	// ForceSendFields is a list of field names (e.g. "Done") to unconditionally
   586  	// include in API requests. By default, fields with empty or default values are
   587  	// omitted from API requests. See
   588  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   589  	// details.
   590  	ForceSendFields []string `json:"-"`
   591  	// NullFields is a list of field names (e.g. "Done") to include in API requests
   592  	// with the JSON null value. By default, fields with empty values are omitted
   593  	// from API requests. See
   594  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   595  	NullFields []string `json:"-"`
   596  }
   597  
   598  func (s *Operation) MarshalJSON() ([]byte, error) {
   599  	type NoMethod Operation
   600  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   601  }
   602  
   603  // Policy: An Identity and Access Management (IAM) policy, which specifies
   604  // access controls for Google Cloud resources. A `Policy` is a collection of
   605  // `bindings`. A `binding` binds one or more `members`, or principals, to a
   606  // single `role`. Principals can be user accounts, service accounts, Google
   607  // groups, and domains (such as G Suite). A `role` is a named list of
   608  // permissions; each `role` can be an IAM predefined role or a user-created
   609  // custom role. For some types of Google Cloud resources, a `binding` can also
   610  // specify a `condition`, which is a logical expression that allows access to a
   611  // resource only if the expression evaluates to `true`. A condition can add
   612  // constraints based on attributes of the request, the resource, or both. To
   613  // learn which resources support conditions in their IAM policies, see the IAM
   614  // documentation
   615  // (https://cloud.google.com/iam/help/conditions/resource-policies). **JSON
   616  // example:** ``` { "bindings": [ { "role":
   617  // "roles/resourcemanager.organizationAdmin", "members": [
   618  // "user:mike@example.com", "group:admins@example.com", "domain:google.com",
   619  // "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role":
   620  // "roles/resourcemanager.organizationViewer", "members": [
   621  // "user:eve@example.com" ], "condition": { "title": "expirable access",
   622  // "description": "Does not grant access after Sep 2020", "expression":
   623  // "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag":
   624  // "BwWWja0YfJA=", "version": 3 } ``` **YAML example:** ``` bindings: -
   625  // members: - user:mike@example.com - group:admins@example.com -
   626  // domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com
   627  // role: roles/resourcemanager.organizationAdmin - members: -
   628  // user:eve@example.com role: roles/resourcemanager.organizationViewer
   629  // condition: title: expirable access description: Does not grant access after
   630  // Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z')
   631  // etag: BwWWja0YfJA= version: 3 ``` For a description of IAM and its features,
   632  // see the IAM documentation (https://cloud.google.com/iam/docs/).
   633  type Policy struct {
   634  	// AuditConfigs: Specifies cloud audit logging configuration for this policy.
   635  	AuditConfigs []*AuditConfig `json:"auditConfigs,omitempty"`
   636  	// Bindings: Associates a list of `members`, or principals, with a `role`.
   637  	// Optionally, may specify a `condition` that determines how and when the
   638  	// `bindings` are applied. Each of the `bindings` must contain at least one
   639  	// principal. The `bindings` in a `Policy` can refer to up to 1,500 principals;
   640  	// up to 250 of these principals can be Google groups. Each occurrence of a
   641  	// principal counts towards these limits. For example, if the `bindings` grant
   642  	// 50 different roles to `user:alice@example.com`, and not to any other
   643  	// principal, then you can add another 1,450 principals to the `bindings` in
   644  	// the `Policy`.
   645  	Bindings []*Binding `json:"bindings,omitempty"`
   646  	// Etag: `etag` is used for optimistic concurrency control as a way to help
   647  	// prevent simultaneous updates of a policy from overwriting each other. It is
   648  	// strongly suggested that systems make use of the `etag` in the
   649  	// read-modify-write cycle to perform policy updates in order to avoid race
   650  	// conditions: An `etag` is returned in the response to `getIamPolicy`, and
   651  	// systems are expected to put that etag in the request to `setIamPolicy` to
   652  	// ensure that their change will be applied to the same version of the policy.
   653  	// **Important:** If you use IAM Conditions, you must include the `etag` field
   654  	// whenever you call `setIamPolicy`. If you omit this field, then IAM allows
   655  	// you to overwrite a version `3` policy with a version `1` policy, and all of
   656  	// the conditions in the version `3` policy are lost.
   657  	Etag string `json:"etag,omitempty"`
   658  	// Version: Specifies the format of the policy. Valid values are `0`, `1`, and
   659  	// `3`. Requests that specify an invalid value are rejected. Any operation that
   660  	// affects conditional role bindings must specify version `3`. This requirement
   661  	// applies to the following operations: * Getting a policy that includes a
   662  	// conditional role binding * Adding a conditional role binding to a policy *
   663  	// Changing a conditional role binding in a policy * Removing any role binding,
   664  	// with or without a condition, from a policy that includes conditions
   665  	// **Important:** If you use IAM Conditions, you must include the `etag` field
   666  	// whenever you call `setIamPolicy`. If you omit this field, then IAM allows
   667  	// you to overwrite a version `3` policy with a version `1` policy, and all of
   668  	// the conditions in the version `3` policy are lost. If a policy does not
   669  	// include any conditions, operations on that policy may specify any valid
   670  	// version or leave the field unset. To learn which resources support
   671  	// conditions in their IAM policies, see the IAM documentation
   672  	// (https://cloud.google.com/iam/help/conditions/resource-policies).
   673  	Version int64 `json:"version,omitempty"`
   674  
   675  	// ServerResponse contains the HTTP response code and headers from the server.
   676  	googleapi.ServerResponse `json:"-"`
   677  	// ForceSendFields is a list of field names (e.g. "AuditConfigs") to
   678  	// unconditionally include in API requests. By default, fields with empty or
   679  	// default values are omitted from API requests. See
   680  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   681  	// details.
   682  	ForceSendFields []string `json:"-"`
   683  	// NullFields is a list of field names (e.g. "AuditConfigs") to include in API
   684  	// requests with the JSON null value. By default, fields with empty values are
   685  	// omitted from API requests. See
   686  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   687  	NullFields []string `json:"-"`
   688  }
   689  
   690  func (s *Policy) MarshalJSON() ([]byte, error) {
   691  	type NoMethod Policy
   692  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   693  }
   694  
   695  // ReconciliationOperationMetadata: Operation metadata returned by the CLH
   696  // during resource state reconciliation.
   697  type ReconciliationOperationMetadata struct {
   698  	// DeleteResource: DEPRECATED. Use exclusive_action instead.
   699  	DeleteResource bool `json:"deleteResource,omitempty"`
   700  	// ExclusiveAction: Excluisive action returned by the CLH.
   701  	//
   702  	// Possible values:
   703  	//   "UNKNOWN_REPAIR_ACTION" - Unknown repair action.
   704  	//   "DELETE" - The resource has to be deleted. When using this bit, the CLH
   705  	// should fail the operation. DEPRECATED. Instead use DELETE_RESOURCE
   706  	// OperationSignal in SideChannel.
   707  	//   "RETRY" - This resource could not be repaired but the repair should be
   708  	// tried again at a later time. This can happen if there is a dependency that
   709  	// needs to be resolved first- e.g. if a parent resource must be repaired
   710  	// before a child resource.
   711  	ExclusiveAction string `json:"exclusiveAction,omitempty"`
   712  	// ForceSendFields is a list of field names (e.g. "DeleteResource") to
   713  	// unconditionally include in API requests. By default, fields with empty or
   714  	// default values are omitted from API requests. See
   715  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   716  	// details.
   717  	ForceSendFields []string `json:"-"`
   718  	// NullFields is a list of field names (e.g. "DeleteResource") to include in
   719  	// API requests with the JSON null value. By default, fields with empty values
   720  	// are omitted from API requests. See
   721  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   722  	NullFields []string `json:"-"`
   723  }
   724  
   725  func (s *ReconciliationOperationMetadata) MarshalJSON() ([]byte, error) {
   726  	type NoMethod ReconciliationOperationMetadata
   727  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   728  }
   729  
   730  // SetIamPolicyRequest: Request message for `SetIamPolicy` method.
   731  type SetIamPolicyRequest struct {
   732  	// Policy: REQUIRED: The complete policy to be applied to the `resource`. The
   733  	// size of the policy is limited to a few 10s of KB. An empty policy is a valid
   734  	// policy but certain Google Cloud services (such as Projects) might reject
   735  	// them.
   736  	Policy *Policy `json:"policy,omitempty"`
   737  	// UpdateMask: OPTIONAL: A FieldMask specifying which fields of the policy to
   738  	// modify. Only the fields in the mask will be modified. If no mask is
   739  	// provided, the following default mask is used: `paths: "bindings, etag"
   740  	UpdateMask string `json:"updateMask,omitempty"`
   741  	// ForceSendFields is a list of field names (e.g. "Policy") to unconditionally
   742  	// include in API requests. By default, fields with empty or default values are
   743  	// 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. "Policy") 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 *SetIamPolicyRequest) MarshalJSON() ([]byte, error) {
   755  	type NoMethod SetIamPolicyRequest
   756  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   757  }
   758  
   759  // Status: The `Status` type defines a logical error model that is suitable for
   760  // different programming environments, including REST APIs and RPC APIs. It is
   761  // used by gRPC (https://github.com/grpc). Each `Status` message contains three
   762  // pieces of data: error code, error message, and error details. You can find
   763  // out more about this error model and how to work with it in the API Design
   764  // Guide (https://cloud.google.com/apis/design/errors).
   765  type Status struct {
   766  	// Code: The status code, which should be an enum value of google.rpc.Code.
   767  	Code int64 `json:"code,omitempty"`
   768  	// Details: A list of messages that carry the error details. There is a common
   769  	// set of message types for APIs to use.
   770  	Details []googleapi.RawMessage `json:"details,omitempty"`
   771  	// Message: A developer-facing error message, which should be in English. Any
   772  	// user-facing error message should be localized and sent in the
   773  	// google.rpc.Status.details field, or localized by the client.
   774  	Message string `json:"message,omitempty"`
   775  	// ForceSendFields is a list of field names (e.g. "Code") to unconditionally
   776  	// include in API requests. By default, fields with empty or default values are
   777  	// omitted from API requests. See
   778  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   779  	// details.
   780  	ForceSendFields []string `json:"-"`
   781  	// NullFields is a list of field names (e.g. "Code") to include in API requests
   782  	// with the JSON null value. By default, fields with empty values are omitted
   783  	// from API requests. See
   784  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   785  	NullFields []string `json:"-"`
   786  }
   787  
   788  func (s *Status) MarshalJSON() ([]byte, error) {
   789  	type NoMethod Status
   790  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   791  }
   792  
   793  // TestIamPermissionsRequest: Request message for `TestIamPermissions` method.
   794  type TestIamPermissionsRequest struct {
   795  	// Permissions: The set of permissions to check for the `resource`. Permissions
   796  	// with wildcards (such as `*` or `storage.*`) are not allowed. For more
   797  	// information see IAM Overview
   798  	// (https://cloud.google.com/iam/docs/overview#permissions).
   799  	Permissions []string `json:"permissions,omitempty"`
   800  	// ForceSendFields is a list of field names (e.g. "Permissions") to
   801  	// unconditionally include in API requests. By default, fields with empty or
   802  	// default values are omitted from API requests. See
   803  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   804  	// details.
   805  	ForceSendFields []string `json:"-"`
   806  	// NullFields is a list of field names (e.g. "Permissions") to include in API
   807  	// requests with the JSON null value. By default, fields with empty values are
   808  	// omitted from API requests. See
   809  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   810  	NullFields []string `json:"-"`
   811  }
   812  
   813  func (s *TestIamPermissionsRequest) MarshalJSON() ([]byte, error) {
   814  	type NoMethod TestIamPermissionsRequest
   815  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   816  }
   817  
   818  // TestIamPermissionsResponse: Response message for `TestIamPermissions`
   819  // method.
   820  type TestIamPermissionsResponse struct {
   821  	// Permissions: A subset of `TestPermissionsRequest.permissions` that the
   822  	// caller is allowed.
   823  	Permissions []string `json:"permissions,omitempty"`
   824  
   825  	// ServerResponse contains the HTTP response code and headers from the server.
   826  	googleapi.ServerResponse `json:"-"`
   827  	// ForceSendFields is a list of field names (e.g. "Permissions") to
   828  	// unconditionally include in API requests. By default, fields with empty or
   829  	// default values are omitted from API requests. See
   830  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   831  	// details.
   832  	ForceSendFields []string `json:"-"`
   833  	// NullFields is a list of field names (e.g. "Permissions") to include in API
   834  	// requests with the JSON null value. By default, fields with empty values are
   835  	// omitted from API requests. See
   836  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   837  	NullFields []string `json:"-"`
   838  }
   839  
   840  func (s *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) {
   841  	type NoMethod TestIamPermissionsResponse
   842  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   843  }
   844  
   845  type ProjectsLocationsGetCall struct {
   846  	s            *Service
   847  	name         string
   848  	urlParams_   gensupport.URLParams
   849  	ifNoneMatch_ string
   850  	ctx_         context.Context
   851  	header_      http.Header
   852  }
   853  
   854  // Get: Gets information about a location.
   855  //
   856  // - name: Resource name for the location.
   857  func (r *ProjectsLocationsService) Get(name string) *ProjectsLocationsGetCall {
   858  	c := &ProjectsLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
   859  	c.name = name
   860  	return c
   861  }
   862  
   863  // Fields allows partial responses to be retrieved. See
   864  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
   865  // details.
   866  func (c *ProjectsLocationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGetCall {
   867  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
   868  	return c
   869  }
   870  
   871  // IfNoneMatch sets an optional parameter which makes the operation fail if the
   872  // object's ETag matches the given value. This is useful for getting updates
   873  // only after the object has changed since the last request.
   874  func (c *ProjectsLocationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGetCall {
   875  	c.ifNoneMatch_ = entityTag
   876  	return c
   877  }
   878  
   879  // Context sets the context to be used in this call's Do method.
   880  func (c *ProjectsLocationsGetCall) Context(ctx context.Context) *ProjectsLocationsGetCall {
   881  	c.ctx_ = ctx
   882  	return c
   883  }
   884  
   885  // Header returns a http.Header that can be modified by the caller to add
   886  // headers to the request.
   887  func (c *ProjectsLocationsGetCall) Header() http.Header {
   888  	if c.header_ == nil {
   889  		c.header_ = make(http.Header)
   890  	}
   891  	return c.header_
   892  }
   893  
   894  func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) {
   895  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
   896  	if c.ifNoneMatch_ != "" {
   897  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
   898  	}
   899  	var body io.Reader = nil
   900  	c.urlParams_.Set("alt", alt)
   901  	c.urlParams_.Set("prettyPrint", "false")
   902  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
   903  	urls += "?" + c.urlParams_.Encode()
   904  	req, err := http.NewRequest("GET", urls, body)
   905  	if err != nil {
   906  		return nil, err
   907  	}
   908  	req.Header = reqHeaders
   909  	googleapi.Expand(req.URL, map[string]string{
   910  		"name": c.name,
   911  	})
   912  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
   913  }
   914  
   915  // Do executes the "privateca.projects.locations.get" call.
   916  // Any non-2xx status code is an error. Response headers are in either
   917  // *Location.ServerResponse.Header or (if a response was returned at all) in
   918  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
   919  // whether the returned error was because http.StatusNotModified was returned.
   920  func (c *ProjectsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) {
   921  	gensupport.SetOptions(c.urlParams_, opts...)
   922  	res, err := c.doRequest("json")
   923  	if res != nil && res.StatusCode == http.StatusNotModified {
   924  		if res.Body != nil {
   925  			res.Body.Close()
   926  		}
   927  		return nil, gensupport.WrapError(&googleapi.Error{
   928  			Code:   res.StatusCode,
   929  			Header: res.Header,
   930  		})
   931  	}
   932  	if err != nil {
   933  		return nil, err
   934  	}
   935  	defer googleapi.CloseBody(res)
   936  	if err := googleapi.CheckResponse(res); err != nil {
   937  		return nil, gensupport.WrapError(err)
   938  	}
   939  	ret := &Location{
   940  		ServerResponse: googleapi.ServerResponse{
   941  			Header:         res.Header,
   942  			HTTPStatusCode: res.StatusCode,
   943  		},
   944  	}
   945  	target := &ret
   946  	if err := gensupport.DecodeResponse(target, res); err != nil {
   947  		return nil, err
   948  	}
   949  	return ret, nil
   950  }
   951  
   952  type ProjectsLocationsListCall struct {
   953  	s            *Service
   954  	name         string
   955  	urlParams_   gensupport.URLParams
   956  	ifNoneMatch_ string
   957  	ctx_         context.Context
   958  	header_      http.Header
   959  }
   960  
   961  // List: Lists information about the supported locations for this service.
   962  //
   963  // - name: The resource that owns the locations collection, if applicable.
   964  func (r *ProjectsLocationsService) List(name string) *ProjectsLocationsListCall {
   965  	c := &ProjectsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
   966  	c.name = name
   967  	return c
   968  }
   969  
   970  // Filter sets the optional parameter "filter": A filter to narrow down results
   971  // to a preferred subset. The filtering language accepts strings like
   972  // "displayName=tokyo", and is documented in more detail in AIP-160
   973  // (https://google.aip.dev/160).
   974  func (c *ProjectsLocationsListCall) Filter(filter string) *ProjectsLocationsListCall {
   975  	c.urlParams_.Set("filter", filter)
   976  	return c
   977  }
   978  
   979  // PageSize sets the optional parameter "pageSize": The maximum number of
   980  // results to return. If not set, the service selects a default.
   981  func (c *ProjectsLocationsListCall) PageSize(pageSize int64) *ProjectsLocationsListCall {
   982  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
   983  	return c
   984  }
   985  
   986  // PageToken sets the optional parameter "pageToken": A page token received
   987  // from the `next_page_token` field in the response. Send that page token to
   988  // receive the subsequent page.
   989  func (c *ProjectsLocationsListCall) PageToken(pageToken string) *ProjectsLocationsListCall {
   990  	c.urlParams_.Set("pageToken", pageToken)
   991  	return c
   992  }
   993  
   994  // Fields allows partial responses to be retrieved. See
   995  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
   996  // details.
   997  func (c *ProjectsLocationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsListCall {
   998  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
   999  	return c
  1000  }
  1001  
  1002  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1003  // object's ETag matches the given value. This is useful for getting updates
  1004  // only after the object has changed since the last request.
  1005  func (c *ProjectsLocationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsListCall {
  1006  	c.ifNoneMatch_ = entityTag
  1007  	return c
  1008  }
  1009  
  1010  // Context sets the context to be used in this call's Do method.
  1011  func (c *ProjectsLocationsListCall) Context(ctx context.Context) *ProjectsLocationsListCall {
  1012  	c.ctx_ = ctx
  1013  	return c
  1014  }
  1015  
  1016  // Header returns a http.Header that can be modified by the caller to add
  1017  // headers to the request.
  1018  func (c *ProjectsLocationsListCall) Header() http.Header {
  1019  	if c.header_ == nil {
  1020  		c.header_ = make(http.Header)
  1021  	}
  1022  	return c.header_
  1023  }
  1024  
  1025  func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error) {
  1026  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1027  	if c.ifNoneMatch_ != "" {
  1028  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1029  	}
  1030  	var body io.Reader = nil
  1031  	c.urlParams_.Set("alt", alt)
  1032  	c.urlParams_.Set("prettyPrint", "false")
  1033  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/locations")
  1034  	urls += "?" + c.urlParams_.Encode()
  1035  	req, err := http.NewRequest("GET", urls, body)
  1036  	if err != nil {
  1037  		return nil, err
  1038  	}
  1039  	req.Header = reqHeaders
  1040  	googleapi.Expand(req.URL, map[string]string{
  1041  		"name": c.name,
  1042  	})
  1043  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1044  }
  1045  
  1046  // Do executes the "privateca.projects.locations.list" call.
  1047  // Any non-2xx status code is an error. Response headers are in either
  1048  // *ListLocationsResponse.ServerResponse.Header or (if a response was returned
  1049  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1050  // check whether the returned error was because http.StatusNotModified was
  1051  // returned.
  1052  func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) {
  1053  	gensupport.SetOptions(c.urlParams_, opts...)
  1054  	res, err := c.doRequest("json")
  1055  	if res != nil && res.StatusCode == http.StatusNotModified {
  1056  		if res.Body != nil {
  1057  			res.Body.Close()
  1058  		}
  1059  		return nil, gensupport.WrapError(&googleapi.Error{
  1060  			Code:   res.StatusCode,
  1061  			Header: res.Header,
  1062  		})
  1063  	}
  1064  	if err != nil {
  1065  		return nil, err
  1066  	}
  1067  	defer googleapi.CloseBody(res)
  1068  	if err := googleapi.CheckResponse(res); err != nil {
  1069  		return nil, gensupport.WrapError(err)
  1070  	}
  1071  	ret := &ListLocationsResponse{
  1072  		ServerResponse: googleapi.ServerResponse{
  1073  			Header:         res.Header,
  1074  			HTTPStatusCode: res.StatusCode,
  1075  		},
  1076  	}
  1077  	target := &ret
  1078  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1079  		return nil, err
  1080  	}
  1081  	return ret, nil
  1082  }
  1083  
  1084  // Pages invokes f for each page of results.
  1085  // A non-nil error returned from f will halt the iteration.
  1086  // The provided context supersedes any context provided to the Context method.
  1087  func (c *ProjectsLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error {
  1088  	c.ctx_ = ctx
  1089  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  1090  	for {
  1091  		x, err := c.Do()
  1092  		if err != nil {
  1093  			return err
  1094  		}
  1095  		if err := f(x); err != nil {
  1096  			return err
  1097  		}
  1098  		if x.NextPageToken == "" {
  1099  			return nil
  1100  		}
  1101  		c.PageToken(x.NextPageToken)
  1102  	}
  1103  }
  1104  
  1105  type ProjectsLocationsCertificateAuthoritiesGetIamPolicyCall struct {
  1106  	s            *Service
  1107  	resource     string
  1108  	urlParams_   gensupport.URLParams
  1109  	ifNoneMatch_ string
  1110  	ctx_         context.Context
  1111  	header_      http.Header
  1112  }
  1113  
  1114  // GetIamPolicy: Gets the access control policy for a resource. Returns an
  1115  // empty policy if the resource exists and does not have a policy set.
  1116  //
  1117  //   - resource: REQUIRED: The resource for which the policy is being requested.
  1118  //     See Resource names (https://cloud.google.com/apis/design/resource_names)
  1119  //     for the appropriate value for this field.
  1120  func (r *ProjectsLocationsCertificateAuthoritiesService) GetIamPolicy(resource string) *ProjectsLocationsCertificateAuthoritiesGetIamPolicyCall {
  1121  	c := &ProjectsLocationsCertificateAuthoritiesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1122  	c.resource = resource
  1123  	return c
  1124  }
  1125  
  1126  // OptionsRequestedPolicyVersion sets the optional parameter
  1127  // "options.requestedPolicyVersion": The maximum policy version that will be
  1128  // used to format the policy. Valid values are 0, 1, and 3. Requests specifying
  1129  // an invalid value will be rejected. Requests for policies with any
  1130  // conditional role bindings must specify version 3. Policies with no
  1131  // conditional role bindings may specify any valid value or leave the field
  1132  // unset. The policy in the response might use the policy version that you
  1133  // specified, or it might use a lower policy version. For example, if you
  1134  // specify version 3, but the policy has no conditional role bindings, the
  1135  // response uses version 1. To learn which resources support conditions in
  1136  // their IAM policies, see the IAM documentation
  1137  // (https://cloud.google.com/iam/help/conditions/resource-policies).
  1138  func (c *ProjectsLocationsCertificateAuthoritiesGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsCertificateAuthoritiesGetIamPolicyCall {
  1139  	c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
  1140  	return c
  1141  }
  1142  
  1143  // Fields allows partial responses to be retrieved. See
  1144  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1145  // details.
  1146  func (c *ProjectsLocationsCertificateAuthoritiesGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsCertificateAuthoritiesGetIamPolicyCall {
  1147  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1148  	return c
  1149  }
  1150  
  1151  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1152  // object's ETag matches the given value. This is useful for getting updates
  1153  // only after the object has changed since the last request.
  1154  func (c *ProjectsLocationsCertificateAuthoritiesGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsCertificateAuthoritiesGetIamPolicyCall {
  1155  	c.ifNoneMatch_ = entityTag
  1156  	return c
  1157  }
  1158  
  1159  // Context sets the context to be used in this call's Do method.
  1160  func (c *ProjectsLocationsCertificateAuthoritiesGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsCertificateAuthoritiesGetIamPolicyCall {
  1161  	c.ctx_ = ctx
  1162  	return c
  1163  }
  1164  
  1165  // Header returns a http.Header that can be modified by the caller to add
  1166  // headers to the request.
  1167  func (c *ProjectsLocationsCertificateAuthoritiesGetIamPolicyCall) Header() http.Header {
  1168  	if c.header_ == nil {
  1169  		c.header_ = make(http.Header)
  1170  	}
  1171  	return c.header_
  1172  }
  1173  
  1174  func (c *ProjectsLocationsCertificateAuthoritiesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  1175  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1176  	if c.ifNoneMatch_ != "" {
  1177  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1178  	}
  1179  	var body io.Reader = nil
  1180  	c.urlParams_.Set("alt", alt)
  1181  	c.urlParams_.Set("prettyPrint", "false")
  1182  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:getIamPolicy")
  1183  	urls += "?" + c.urlParams_.Encode()
  1184  	req, err := http.NewRequest("GET", urls, body)
  1185  	if err != nil {
  1186  		return nil, err
  1187  	}
  1188  	req.Header = reqHeaders
  1189  	googleapi.Expand(req.URL, map[string]string{
  1190  		"resource": c.resource,
  1191  	})
  1192  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1193  }
  1194  
  1195  // Do executes the "privateca.projects.locations.certificateAuthorities.getIamPolicy" call.
  1196  // Any non-2xx status code is an error. Response headers are in either
  1197  // *Policy.ServerResponse.Header or (if a response was returned at all) in
  1198  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1199  // whether the returned error was because http.StatusNotModified was returned.
  1200  func (c *ProjectsLocationsCertificateAuthoritiesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  1201  	gensupport.SetOptions(c.urlParams_, opts...)
  1202  	res, err := c.doRequest("json")
  1203  	if res != nil && res.StatusCode == http.StatusNotModified {
  1204  		if res.Body != nil {
  1205  			res.Body.Close()
  1206  		}
  1207  		return nil, gensupport.WrapError(&googleapi.Error{
  1208  			Code:   res.StatusCode,
  1209  			Header: res.Header,
  1210  		})
  1211  	}
  1212  	if err != nil {
  1213  		return nil, err
  1214  	}
  1215  	defer googleapi.CloseBody(res)
  1216  	if err := googleapi.CheckResponse(res); err != nil {
  1217  		return nil, gensupport.WrapError(err)
  1218  	}
  1219  	ret := &Policy{
  1220  		ServerResponse: googleapi.ServerResponse{
  1221  			Header:         res.Header,
  1222  			HTTPStatusCode: res.StatusCode,
  1223  		},
  1224  	}
  1225  	target := &ret
  1226  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1227  		return nil, err
  1228  	}
  1229  	return ret, nil
  1230  }
  1231  
  1232  type ProjectsLocationsCertificateAuthoritiesSetIamPolicyCall struct {
  1233  	s                   *Service
  1234  	resource            string
  1235  	setiampolicyrequest *SetIamPolicyRequest
  1236  	urlParams_          gensupport.URLParams
  1237  	ctx_                context.Context
  1238  	header_             http.Header
  1239  }
  1240  
  1241  // SetIamPolicy: Sets the access control policy on the specified resource.
  1242  // Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`,
  1243  // and `PERMISSION_DENIED` errors.
  1244  //
  1245  //   - resource: REQUIRED: The resource for which the policy is being specified.
  1246  //     See Resource names (https://cloud.google.com/apis/design/resource_names)
  1247  //     for the appropriate value for this field.
  1248  func (r *ProjectsLocationsCertificateAuthoritiesService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsCertificateAuthoritiesSetIamPolicyCall {
  1249  	c := &ProjectsLocationsCertificateAuthoritiesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1250  	c.resource = resource
  1251  	c.setiampolicyrequest = setiampolicyrequest
  1252  	return c
  1253  }
  1254  
  1255  // Fields allows partial responses to be retrieved. See
  1256  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1257  // details.
  1258  func (c *ProjectsLocationsCertificateAuthoritiesSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsCertificateAuthoritiesSetIamPolicyCall {
  1259  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1260  	return c
  1261  }
  1262  
  1263  // Context sets the context to be used in this call's Do method.
  1264  func (c *ProjectsLocationsCertificateAuthoritiesSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsCertificateAuthoritiesSetIamPolicyCall {
  1265  	c.ctx_ = ctx
  1266  	return c
  1267  }
  1268  
  1269  // Header returns a http.Header that can be modified by the caller to add
  1270  // headers to the request.
  1271  func (c *ProjectsLocationsCertificateAuthoritiesSetIamPolicyCall) Header() http.Header {
  1272  	if c.header_ == nil {
  1273  		c.header_ = make(http.Header)
  1274  	}
  1275  	return c.header_
  1276  }
  1277  
  1278  func (c *ProjectsLocationsCertificateAuthoritiesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  1279  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1280  	var body io.Reader = nil
  1281  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
  1282  	if err != nil {
  1283  		return nil, err
  1284  	}
  1285  	c.urlParams_.Set("alt", alt)
  1286  	c.urlParams_.Set("prettyPrint", "false")
  1287  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:setIamPolicy")
  1288  	urls += "?" + c.urlParams_.Encode()
  1289  	req, err := http.NewRequest("POST", urls, body)
  1290  	if err != nil {
  1291  		return nil, err
  1292  	}
  1293  	req.Header = reqHeaders
  1294  	googleapi.Expand(req.URL, map[string]string{
  1295  		"resource": c.resource,
  1296  	})
  1297  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1298  }
  1299  
  1300  // Do executes the "privateca.projects.locations.certificateAuthorities.setIamPolicy" call.
  1301  // Any non-2xx status code is an error. Response headers are in either
  1302  // *Policy.ServerResponse.Header or (if a response was returned at all) in
  1303  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1304  // whether the returned error was because http.StatusNotModified was returned.
  1305  func (c *ProjectsLocationsCertificateAuthoritiesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  1306  	gensupport.SetOptions(c.urlParams_, opts...)
  1307  	res, err := c.doRequest("json")
  1308  	if res != nil && res.StatusCode == http.StatusNotModified {
  1309  		if res.Body != nil {
  1310  			res.Body.Close()
  1311  		}
  1312  		return nil, gensupport.WrapError(&googleapi.Error{
  1313  			Code:   res.StatusCode,
  1314  			Header: res.Header,
  1315  		})
  1316  	}
  1317  	if err != nil {
  1318  		return nil, err
  1319  	}
  1320  	defer googleapi.CloseBody(res)
  1321  	if err := googleapi.CheckResponse(res); err != nil {
  1322  		return nil, gensupport.WrapError(err)
  1323  	}
  1324  	ret := &Policy{
  1325  		ServerResponse: googleapi.ServerResponse{
  1326  			Header:         res.Header,
  1327  			HTTPStatusCode: res.StatusCode,
  1328  		},
  1329  	}
  1330  	target := &ret
  1331  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1332  		return nil, err
  1333  	}
  1334  	return ret, nil
  1335  }
  1336  
  1337  type ProjectsLocationsCertificateAuthoritiesTestIamPermissionsCall struct {
  1338  	s                         *Service
  1339  	resource                  string
  1340  	testiampermissionsrequest *TestIamPermissionsRequest
  1341  	urlParams_                gensupport.URLParams
  1342  	ctx_                      context.Context
  1343  	header_                   http.Header
  1344  }
  1345  
  1346  // TestIamPermissions: Returns permissions that a caller has on the specified
  1347  // resource. If the resource does not exist, this will return an empty set of
  1348  // permissions, not a `NOT_FOUND` error. Note: This operation is designed to be
  1349  // used for building permission-aware UIs and command-line tools, not for
  1350  // authorization checking. This operation may "fail open" without warning.
  1351  //
  1352  //   - resource: REQUIRED: The resource for which the policy detail is being
  1353  //     requested. See Resource names
  1354  //     (https://cloud.google.com/apis/design/resource_names) for the appropriate
  1355  //     value for this field.
  1356  func (r *ProjectsLocationsCertificateAuthoritiesService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsCertificateAuthoritiesTestIamPermissionsCall {
  1357  	c := &ProjectsLocationsCertificateAuthoritiesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1358  	c.resource = resource
  1359  	c.testiampermissionsrequest = testiampermissionsrequest
  1360  	return c
  1361  }
  1362  
  1363  // Fields allows partial responses to be retrieved. See
  1364  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1365  // details.
  1366  func (c *ProjectsLocationsCertificateAuthoritiesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsCertificateAuthoritiesTestIamPermissionsCall {
  1367  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1368  	return c
  1369  }
  1370  
  1371  // Context sets the context to be used in this call's Do method.
  1372  func (c *ProjectsLocationsCertificateAuthoritiesTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsCertificateAuthoritiesTestIamPermissionsCall {
  1373  	c.ctx_ = ctx
  1374  	return c
  1375  }
  1376  
  1377  // Header returns a http.Header that can be modified by the caller to add
  1378  // headers to the request.
  1379  func (c *ProjectsLocationsCertificateAuthoritiesTestIamPermissionsCall) Header() http.Header {
  1380  	if c.header_ == nil {
  1381  		c.header_ = make(http.Header)
  1382  	}
  1383  	return c.header_
  1384  }
  1385  
  1386  func (c *ProjectsLocationsCertificateAuthoritiesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  1387  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1388  	var body io.Reader = nil
  1389  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
  1390  	if err != nil {
  1391  		return nil, err
  1392  	}
  1393  	c.urlParams_.Set("alt", alt)
  1394  	c.urlParams_.Set("prettyPrint", "false")
  1395  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:testIamPermissions")
  1396  	urls += "?" + c.urlParams_.Encode()
  1397  	req, err := http.NewRequest("POST", urls, body)
  1398  	if err != nil {
  1399  		return nil, err
  1400  	}
  1401  	req.Header = reqHeaders
  1402  	googleapi.Expand(req.URL, map[string]string{
  1403  		"resource": c.resource,
  1404  	})
  1405  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1406  }
  1407  
  1408  // Do executes the "privateca.projects.locations.certificateAuthorities.testIamPermissions" call.
  1409  // Any non-2xx status code is an error. Response headers are in either
  1410  // *TestIamPermissionsResponse.ServerResponse.Header or (if a response was
  1411  // returned at all) in error.(*googleapi.Error).Header. Use
  1412  // googleapi.IsNotModified to check whether the returned error was because
  1413  // http.StatusNotModified was returned.
  1414  func (c *ProjectsLocationsCertificateAuthoritiesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
  1415  	gensupport.SetOptions(c.urlParams_, opts...)
  1416  	res, err := c.doRequest("json")
  1417  	if res != nil && res.StatusCode == http.StatusNotModified {
  1418  		if res.Body != nil {
  1419  			res.Body.Close()
  1420  		}
  1421  		return nil, gensupport.WrapError(&googleapi.Error{
  1422  			Code:   res.StatusCode,
  1423  			Header: res.Header,
  1424  		})
  1425  	}
  1426  	if err != nil {
  1427  		return nil, err
  1428  	}
  1429  	defer googleapi.CloseBody(res)
  1430  	if err := googleapi.CheckResponse(res); err != nil {
  1431  		return nil, gensupport.WrapError(err)
  1432  	}
  1433  	ret := &TestIamPermissionsResponse{
  1434  		ServerResponse: googleapi.ServerResponse{
  1435  			Header:         res.Header,
  1436  			HTTPStatusCode: res.StatusCode,
  1437  		},
  1438  	}
  1439  	target := &ret
  1440  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1441  		return nil, err
  1442  	}
  1443  	return ret, nil
  1444  }
  1445  
  1446  type ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsGetIamPolicyCall struct {
  1447  	s            *Service
  1448  	resource     string
  1449  	urlParams_   gensupport.URLParams
  1450  	ifNoneMatch_ string
  1451  	ctx_         context.Context
  1452  	header_      http.Header
  1453  }
  1454  
  1455  // GetIamPolicy: Gets the access control policy for a resource. Returns an
  1456  // empty policy if the resource exists and does not have a policy set.
  1457  //
  1458  //   - resource: REQUIRED: The resource for which the policy is being requested.
  1459  //     See Resource names (https://cloud.google.com/apis/design/resource_names)
  1460  //     for the appropriate value for this field.
  1461  func (r *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsService) GetIamPolicy(resource string) *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsGetIamPolicyCall {
  1462  	c := &ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1463  	c.resource = resource
  1464  	return c
  1465  }
  1466  
  1467  // OptionsRequestedPolicyVersion sets the optional parameter
  1468  // "options.requestedPolicyVersion": The maximum policy version that will be
  1469  // used to format the policy. Valid values are 0, 1, and 3. Requests specifying
  1470  // an invalid value will be rejected. Requests for policies with any
  1471  // conditional role bindings must specify version 3. Policies with no
  1472  // conditional role bindings may specify any valid value or leave the field
  1473  // unset. The policy in the response might use the policy version that you
  1474  // specified, or it might use a lower policy version. For example, if you
  1475  // specify version 3, but the policy has no conditional role bindings, the
  1476  // response uses version 1. To learn which resources support conditions in
  1477  // their IAM policies, see the IAM documentation
  1478  // (https://cloud.google.com/iam/help/conditions/resource-policies).
  1479  func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsGetIamPolicyCall {
  1480  	c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
  1481  	return c
  1482  }
  1483  
  1484  // Fields allows partial responses to be retrieved. See
  1485  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1486  // details.
  1487  func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsGetIamPolicyCall {
  1488  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1489  	return c
  1490  }
  1491  
  1492  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1493  // object's ETag matches the given value. This is useful for getting updates
  1494  // only after the object has changed since the last request.
  1495  func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsGetIamPolicyCall {
  1496  	c.ifNoneMatch_ = entityTag
  1497  	return c
  1498  }
  1499  
  1500  // Context sets the context to be used in this call's Do method.
  1501  func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsGetIamPolicyCall {
  1502  	c.ctx_ = ctx
  1503  	return c
  1504  }
  1505  
  1506  // Header returns a http.Header that can be modified by the caller to add
  1507  // headers to the request.
  1508  func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsGetIamPolicyCall) Header() http.Header {
  1509  	if c.header_ == nil {
  1510  		c.header_ = make(http.Header)
  1511  	}
  1512  	return c.header_
  1513  }
  1514  
  1515  func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  1516  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1517  	if c.ifNoneMatch_ != "" {
  1518  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1519  	}
  1520  	var body io.Reader = nil
  1521  	c.urlParams_.Set("alt", alt)
  1522  	c.urlParams_.Set("prettyPrint", "false")
  1523  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:getIamPolicy")
  1524  	urls += "?" + c.urlParams_.Encode()
  1525  	req, err := http.NewRequest("GET", urls, body)
  1526  	if err != nil {
  1527  		return nil, err
  1528  	}
  1529  	req.Header = reqHeaders
  1530  	googleapi.Expand(req.URL, map[string]string{
  1531  		"resource": c.resource,
  1532  	})
  1533  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1534  }
  1535  
  1536  // Do executes the "privateca.projects.locations.certificateAuthorities.certificateRevocationLists.getIamPolicy" call.
  1537  // Any non-2xx status code is an error. Response headers are in either
  1538  // *Policy.ServerResponse.Header or (if a response was returned at all) in
  1539  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1540  // whether the returned error was because http.StatusNotModified was returned.
  1541  func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  1542  	gensupport.SetOptions(c.urlParams_, opts...)
  1543  	res, err := c.doRequest("json")
  1544  	if res != nil && res.StatusCode == http.StatusNotModified {
  1545  		if res.Body != nil {
  1546  			res.Body.Close()
  1547  		}
  1548  		return nil, gensupport.WrapError(&googleapi.Error{
  1549  			Code:   res.StatusCode,
  1550  			Header: res.Header,
  1551  		})
  1552  	}
  1553  	if err != nil {
  1554  		return nil, err
  1555  	}
  1556  	defer googleapi.CloseBody(res)
  1557  	if err := googleapi.CheckResponse(res); err != nil {
  1558  		return nil, gensupport.WrapError(err)
  1559  	}
  1560  	ret := &Policy{
  1561  		ServerResponse: googleapi.ServerResponse{
  1562  			Header:         res.Header,
  1563  			HTTPStatusCode: res.StatusCode,
  1564  		},
  1565  	}
  1566  	target := &ret
  1567  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1568  		return nil, err
  1569  	}
  1570  	return ret, nil
  1571  }
  1572  
  1573  type ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsSetIamPolicyCall struct {
  1574  	s                   *Service
  1575  	resource            string
  1576  	setiampolicyrequest *SetIamPolicyRequest
  1577  	urlParams_          gensupport.URLParams
  1578  	ctx_                context.Context
  1579  	header_             http.Header
  1580  }
  1581  
  1582  // SetIamPolicy: Sets the access control policy on the specified resource.
  1583  // Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`,
  1584  // and `PERMISSION_DENIED` errors.
  1585  //
  1586  //   - resource: REQUIRED: The resource for which the policy is being specified.
  1587  //     See Resource names (https://cloud.google.com/apis/design/resource_names)
  1588  //     for the appropriate value for this field.
  1589  func (r *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsSetIamPolicyCall {
  1590  	c := &ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1591  	c.resource = resource
  1592  	c.setiampolicyrequest = setiampolicyrequest
  1593  	return c
  1594  }
  1595  
  1596  // Fields allows partial responses to be retrieved. See
  1597  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1598  // details.
  1599  func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsSetIamPolicyCall {
  1600  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1601  	return c
  1602  }
  1603  
  1604  // Context sets the context to be used in this call's Do method.
  1605  func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsSetIamPolicyCall {
  1606  	c.ctx_ = ctx
  1607  	return c
  1608  }
  1609  
  1610  // Header returns a http.Header that can be modified by the caller to add
  1611  // headers to the request.
  1612  func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsSetIamPolicyCall) Header() http.Header {
  1613  	if c.header_ == nil {
  1614  		c.header_ = make(http.Header)
  1615  	}
  1616  	return c.header_
  1617  }
  1618  
  1619  func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  1620  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1621  	var body io.Reader = nil
  1622  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
  1623  	if err != nil {
  1624  		return nil, err
  1625  	}
  1626  	c.urlParams_.Set("alt", alt)
  1627  	c.urlParams_.Set("prettyPrint", "false")
  1628  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:setIamPolicy")
  1629  	urls += "?" + c.urlParams_.Encode()
  1630  	req, err := http.NewRequest("POST", urls, body)
  1631  	if err != nil {
  1632  		return nil, err
  1633  	}
  1634  	req.Header = reqHeaders
  1635  	googleapi.Expand(req.URL, map[string]string{
  1636  		"resource": c.resource,
  1637  	})
  1638  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1639  }
  1640  
  1641  // Do executes the "privateca.projects.locations.certificateAuthorities.certificateRevocationLists.setIamPolicy" call.
  1642  // Any non-2xx status code is an error. Response headers are in either
  1643  // *Policy.ServerResponse.Header or (if a response was returned at all) in
  1644  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1645  // whether the returned error was because http.StatusNotModified was returned.
  1646  func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  1647  	gensupport.SetOptions(c.urlParams_, opts...)
  1648  	res, err := c.doRequest("json")
  1649  	if res != nil && res.StatusCode == http.StatusNotModified {
  1650  		if res.Body != nil {
  1651  			res.Body.Close()
  1652  		}
  1653  		return nil, gensupport.WrapError(&googleapi.Error{
  1654  			Code:   res.StatusCode,
  1655  			Header: res.Header,
  1656  		})
  1657  	}
  1658  	if err != nil {
  1659  		return nil, err
  1660  	}
  1661  	defer googleapi.CloseBody(res)
  1662  	if err := googleapi.CheckResponse(res); err != nil {
  1663  		return nil, gensupport.WrapError(err)
  1664  	}
  1665  	ret := &Policy{
  1666  		ServerResponse: googleapi.ServerResponse{
  1667  			Header:         res.Header,
  1668  			HTTPStatusCode: res.StatusCode,
  1669  		},
  1670  	}
  1671  	target := &ret
  1672  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1673  		return nil, err
  1674  	}
  1675  	return ret, nil
  1676  }
  1677  
  1678  type ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsTestIamPermissionsCall struct {
  1679  	s                         *Service
  1680  	resource                  string
  1681  	testiampermissionsrequest *TestIamPermissionsRequest
  1682  	urlParams_                gensupport.URLParams
  1683  	ctx_                      context.Context
  1684  	header_                   http.Header
  1685  }
  1686  
  1687  // TestIamPermissions: Returns permissions that a caller has on the specified
  1688  // resource. If the resource does not exist, this will return an empty set of
  1689  // permissions, not a `NOT_FOUND` error. Note: This operation is designed to be
  1690  // used for building permission-aware UIs and command-line tools, not for
  1691  // authorization checking. This operation may "fail open" without warning.
  1692  //
  1693  //   - resource: REQUIRED: The resource for which the policy detail is being
  1694  //     requested. See Resource names
  1695  //     (https://cloud.google.com/apis/design/resource_names) for the appropriate
  1696  //     value for this field.
  1697  func (r *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsTestIamPermissionsCall {
  1698  	c := &ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1699  	c.resource = resource
  1700  	c.testiampermissionsrequest = testiampermissionsrequest
  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 *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsTestIamPermissionsCall {
  1708  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1709  	return c
  1710  }
  1711  
  1712  // Context sets the context to be used in this call's Do method.
  1713  func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsTestIamPermissionsCall {
  1714  	c.ctx_ = ctx
  1715  	return c
  1716  }
  1717  
  1718  // Header returns a http.Header that can be modified by the caller to add
  1719  // headers to the request.
  1720  func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsTestIamPermissionsCall) Header() http.Header {
  1721  	if c.header_ == nil {
  1722  		c.header_ = make(http.Header)
  1723  	}
  1724  	return c.header_
  1725  }
  1726  
  1727  func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  1728  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1729  	var body io.Reader = nil
  1730  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
  1731  	if err != nil {
  1732  		return nil, err
  1733  	}
  1734  	c.urlParams_.Set("alt", alt)
  1735  	c.urlParams_.Set("prettyPrint", "false")
  1736  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:testIamPermissions")
  1737  	urls += "?" + c.urlParams_.Encode()
  1738  	req, err := http.NewRequest("POST", urls, body)
  1739  	if err != nil {
  1740  		return nil, err
  1741  	}
  1742  	req.Header = reqHeaders
  1743  	googleapi.Expand(req.URL, map[string]string{
  1744  		"resource": c.resource,
  1745  	})
  1746  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1747  }
  1748  
  1749  // Do executes the "privateca.projects.locations.certificateAuthorities.certificateRevocationLists.testIamPermissions" call.
  1750  // Any non-2xx status code is an error. Response headers are in either
  1751  // *TestIamPermissionsResponse.ServerResponse.Header or (if a response was
  1752  // returned at all) in error.(*googleapi.Error).Header. Use
  1753  // googleapi.IsNotModified to check whether the returned error was because
  1754  // http.StatusNotModified was returned.
  1755  func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
  1756  	gensupport.SetOptions(c.urlParams_, opts...)
  1757  	res, err := c.doRequest("json")
  1758  	if res != nil && res.StatusCode == http.StatusNotModified {
  1759  		if res.Body != nil {
  1760  			res.Body.Close()
  1761  		}
  1762  		return nil, gensupport.WrapError(&googleapi.Error{
  1763  			Code:   res.StatusCode,
  1764  			Header: res.Header,
  1765  		})
  1766  	}
  1767  	if err != nil {
  1768  		return nil, err
  1769  	}
  1770  	defer googleapi.CloseBody(res)
  1771  	if err := googleapi.CheckResponse(res); err != nil {
  1772  		return nil, gensupport.WrapError(err)
  1773  	}
  1774  	ret := &TestIamPermissionsResponse{
  1775  		ServerResponse: googleapi.ServerResponse{
  1776  			Header:         res.Header,
  1777  			HTTPStatusCode: res.StatusCode,
  1778  		},
  1779  	}
  1780  	target := &ret
  1781  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1782  		return nil, err
  1783  	}
  1784  	return ret, nil
  1785  }
  1786  
  1787  type ProjectsLocationsOperationsCancelCall struct {
  1788  	s                      *Service
  1789  	name                   string
  1790  	canceloperationrequest *CancelOperationRequest
  1791  	urlParams_             gensupport.URLParams
  1792  	ctx_                   context.Context
  1793  	header_                http.Header
  1794  }
  1795  
  1796  // Cancel: Starts asynchronous cancellation on a long-running operation. The
  1797  // server makes a best effort to cancel the operation, but success is not
  1798  // guaranteed. If the server doesn't support this method, it returns
  1799  // `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or
  1800  // other methods to check whether the cancellation succeeded or whether the
  1801  // operation completed despite cancellation. On successful cancellation, the
  1802  // operation is not deleted; instead, it becomes an operation with an
  1803  // Operation.error value with a google.rpc.Status.code of 1, corresponding to
  1804  // `Code.CANCELLED`.
  1805  //
  1806  // - name: The name of the operation resource to be cancelled.
  1807  func (r *ProjectsLocationsOperationsService) Cancel(name string, canceloperationrequest *CancelOperationRequest) *ProjectsLocationsOperationsCancelCall {
  1808  	c := &ProjectsLocationsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1809  	c.name = name
  1810  	c.canceloperationrequest = canceloperationrequest
  1811  	return c
  1812  }
  1813  
  1814  // Fields allows partial responses to be retrieved. See
  1815  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1816  // details.
  1817  func (c *ProjectsLocationsOperationsCancelCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsCancelCall {
  1818  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1819  	return c
  1820  }
  1821  
  1822  // Context sets the context to be used in this call's Do method.
  1823  func (c *ProjectsLocationsOperationsCancelCall) Context(ctx context.Context) *ProjectsLocationsOperationsCancelCall {
  1824  	c.ctx_ = ctx
  1825  	return c
  1826  }
  1827  
  1828  // Header returns a http.Header that can be modified by the caller to add
  1829  // headers to the request.
  1830  func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header {
  1831  	if c.header_ == nil {
  1832  		c.header_ = make(http.Header)
  1833  	}
  1834  	return c.header_
  1835  }
  1836  
  1837  func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) {
  1838  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1839  	var body io.Reader = nil
  1840  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest)
  1841  	if err != nil {
  1842  		return nil, err
  1843  	}
  1844  	c.urlParams_.Set("alt", alt)
  1845  	c.urlParams_.Set("prettyPrint", "false")
  1846  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancel")
  1847  	urls += "?" + c.urlParams_.Encode()
  1848  	req, err := http.NewRequest("POST", urls, body)
  1849  	if err != nil {
  1850  		return nil, err
  1851  	}
  1852  	req.Header = reqHeaders
  1853  	googleapi.Expand(req.URL, map[string]string{
  1854  		"name": c.name,
  1855  	})
  1856  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1857  }
  1858  
  1859  // Do executes the "privateca.projects.locations.operations.cancel" call.
  1860  // Any non-2xx status code is an error. Response headers are in either
  1861  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  1862  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1863  // whether the returned error was because http.StatusNotModified was returned.
  1864  func (c *ProjectsLocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  1865  	gensupport.SetOptions(c.urlParams_, opts...)
  1866  	res, err := c.doRequest("json")
  1867  	if res != nil && res.StatusCode == http.StatusNotModified {
  1868  		if res.Body != nil {
  1869  			res.Body.Close()
  1870  		}
  1871  		return nil, gensupport.WrapError(&googleapi.Error{
  1872  			Code:   res.StatusCode,
  1873  			Header: res.Header,
  1874  		})
  1875  	}
  1876  	if err != nil {
  1877  		return nil, err
  1878  	}
  1879  	defer googleapi.CloseBody(res)
  1880  	if err := googleapi.CheckResponse(res); err != nil {
  1881  		return nil, gensupport.WrapError(err)
  1882  	}
  1883  	ret := &Empty{
  1884  		ServerResponse: googleapi.ServerResponse{
  1885  			Header:         res.Header,
  1886  			HTTPStatusCode: res.StatusCode,
  1887  		},
  1888  	}
  1889  	target := &ret
  1890  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1891  		return nil, err
  1892  	}
  1893  	return ret, nil
  1894  }
  1895  
  1896  type ProjectsLocationsOperationsDeleteCall struct {
  1897  	s          *Service
  1898  	name       string
  1899  	urlParams_ gensupport.URLParams
  1900  	ctx_       context.Context
  1901  	header_    http.Header
  1902  }
  1903  
  1904  // Delete: Deletes a long-running operation. This method indicates that the
  1905  // client is no longer interested in the operation result. It does not cancel
  1906  // the operation. If the server doesn't support this method, it returns
  1907  // `google.rpc.Code.UNIMPLEMENTED`.
  1908  //
  1909  // - name: The name of the operation resource to be deleted.
  1910  func (r *ProjectsLocationsOperationsService) Delete(name string) *ProjectsLocationsOperationsDeleteCall {
  1911  	c := &ProjectsLocationsOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1912  	c.name = name
  1913  	return c
  1914  }
  1915  
  1916  // Fields allows partial responses to be retrieved. See
  1917  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1918  // details.
  1919  func (c *ProjectsLocationsOperationsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsDeleteCall {
  1920  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1921  	return c
  1922  }
  1923  
  1924  // Context sets the context to be used in this call's Do method.
  1925  func (c *ProjectsLocationsOperationsDeleteCall) Context(ctx context.Context) *ProjectsLocationsOperationsDeleteCall {
  1926  	c.ctx_ = ctx
  1927  	return c
  1928  }
  1929  
  1930  // Header returns a http.Header that can be modified by the caller to add
  1931  // headers to the request.
  1932  func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header {
  1933  	if c.header_ == nil {
  1934  		c.header_ = make(http.Header)
  1935  	}
  1936  	return c.header_
  1937  }
  1938  
  1939  func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  1940  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1941  	var body io.Reader = nil
  1942  	c.urlParams_.Set("alt", alt)
  1943  	c.urlParams_.Set("prettyPrint", "false")
  1944  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  1945  	urls += "?" + c.urlParams_.Encode()
  1946  	req, err := http.NewRequest("DELETE", urls, body)
  1947  	if err != nil {
  1948  		return nil, err
  1949  	}
  1950  	req.Header = reqHeaders
  1951  	googleapi.Expand(req.URL, map[string]string{
  1952  		"name": c.name,
  1953  	})
  1954  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1955  }
  1956  
  1957  // Do executes the "privateca.projects.locations.operations.delete" call.
  1958  // Any non-2xx status code is an error. Response headers are in either
  1959  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  1960  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1961  // whether the returned error was because http.StatusNotModified was returned.
  1962  func (c *ProjectsLocationsOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  1963  	gensupport.SetOptions(c.urlParams_, opts...)
  1964  	res, err := c.doRequest("json")
  1965  	if res != nil && res.StatusCode == http.StatusNotModified {
  1966  		if res.Body != nil {
  1967  			res.Body.Close()
  1968  		}
  1969  		return nil, gensupport.WrapError(&googleapi.Error{
  1970  			Code:   res.StatusCode,
  1971  			Header: res.Header,
  1972  		})
  1973  	}
  1974  	if err != nil {
  1975  		return nil, err
  1976  	}
  1977  	defer googleapi.CloseBody(res)
  1978  	if err := googleapi.CheckResponse(res); err != nil {
  1979  		return nil, gensupport.WrapError(err)
  1980  	}
  1981  	ret := &Empty{
  1982  		ServerResponse: googleapi.ServerResponse{
  1983  			Header:         res.Header,
  1984  			HTTPStatusCode: res.StatusCode,
  1985  		},
  1986  	}
  1987  	target := &ret
  1988  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1989  		return nil, err
  1990  	}
  1991  	return ret, nil
  1992  }
  1993  
  1994  type ProjectsLocationsOperationsGetCall struct {
  1995  	s            *Service
  1996  	name         string
  1997  	urlParams_   gensupport.URLParams
  1998  	ifNoneMatch_ string
  1999  	ctx_         context.Context
  2000  	header_      http.Header
  2001  }
  2002  
  2003  // Get: Gets the latest state of a long-running operation. Clients can use this
  2004  // method to poll the operation result at intervals as recommended by the API
  2005  // service.
  2006  //
  2007  // - name: The name of the operation resource.
  2008  func (r *ProjectsLocationsOperationsService) Get(name string) *ProjectsLocationsOperationsGetCall {
  2009  	c := &ProjectsLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2010  	c.name = name
  2011  	return c
  2012  }
  2013  
  2014  // Fields allows partial responses to be retrieved. See
  2015  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2016  // details.
  2017  func (c *ProjectsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsGetCall {
  2018  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2019  	return c
  2020  }
  2021  
  2022  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2023  // object's ETag matches the given value. This is useful for getting updates
  2024  // only after the object has changed since the last request.
  2025  func (c *ProjectsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsGetCall {
  2026  	c.ifNoneMatch_ = entityTag
  2027  	return c
  2028  }
  2029  
  2030  // Context sets the context to be used in this call's Do method.
  2031  func (c *ProjectsLocationsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsOperationsGetCall {
  2032  	c.ctx_ = ctx
  2033  	return c
  2034  }
  2035  
  2036  // Header returns a http.Header that can be modified by the caller to add
  2037  // headers to the request.
  2038  func (c *ProjectsLocationsOperationsGetCall) Header() http.Header {
  2039  	if c.header_ == nil {
  2040  		c.header_ = make(http.Header)
  2041  	}
  2042  	return c.header_
  2043  }
  2044  
  2045  func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  2046  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2047  	if c.ifNoneMatch_ != "" {
  2048  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2049  	}
  2050  	var body io.Reader = nil
  2051  	c.urlParams_.Set("alt", alt)
  2052  	c.urlParams_.Set("prettyPrint", "false")
  2053  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  2054  	urls += "?" + c.urlParams_.Encode()
  2055  	req, err := http.NewRequest("GET", urls, body)
  2056  	if err != nil {
  2057  		return nil, err
  2058  	}
  2059  	req.Header = reqHeaders
  2060  	googleapi.Expand(req.URL, map[string]string{
  2061  		"name": c.name,
  2062  	})
  2063  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2064  }
  2065  
  2066  // Do executes the "privateca.projects.locations.operations.get" call.
  2067  // Any non-2xx status code is an error. Response headers are in either
  2068  // *Operation.ServerResponse.Header or (if a response was returned at all) in
  2069  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2070  // whether the returned error was because http.StatusNotModified was returned.
  2071  func (c *ProjectsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  2072  	gensupport.SetOptions(c.urlParams_, opts...)
  2073  	res, err := c.doRequest("json")
  2074  	if res != nil && res.StatusCode == http.StatusNotModified {
  2075  		if res.Body != nil {
  2076  			res.Body.Close()
  2077  		}
  2078  		return nil, gensupport.WrapError(&googleapi.Error{
  2079  			Code:   res.StatusCode,
  2080  			Header: res.Header,
  2081  		})
  2082  	}
  2083  	if err != nil {
  2084  		return nil, err
  2085  	}
  2086  	defer googleapi.CloseBody(res)
  2087  	if err := googleapi.CheckResponse(res); err != nil {
  2088  		return nil, gensupport.WrapError(err)
  2089  	}
  2090  	ret := &Operation{
  2091  		ServerResponse: googleapi.ServerResponse{
  2092  			Header:         res.Header,
  2093  			HTTPStatusCode: res.StatusCode,
  2094  		},
  2095  	}
  2096  	target := &ret
  2097  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2098  		return nil, err
  2099  	}
  2100  	return ret, nil
  2101  }
  2102  
  2103  type ProjectsLocationsOperationsListCall struct {
  2104  	s            *Service
  2105  	name         string
  2106  	urlParams_   gensupport.URLParams
  2107  	ifNoneMatch_ string
  2108  	ctx_         context.Context
  2109  	header_      http.Header
  2110  }
  2111  
  2112  // List: Lists operations that match the specified filter in the request. If
  2113  // the server doesn't support this method, it returns `UNIMPLEMENTED`.
  2114  //
  2115  // - name: The name of the operation's parent resource.
  2116  func (r *ProjectsLocationsOperationsService) List(name string) *ProjectsLocationsOperationsListCall {
  2117  	c := &ProjectsLocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2118  	c.name = name
  2119  	return c
  2120  }
  2121  
  2122  // Filter sets the optional parameter "filter": The standard list filter.
  2123  func (c *ProjectsLocationsOperationsListCall) Filter(filter string) *ProjectsLocationsOperationsListCall {
  2124  	c.urlParams_.Set("filter", filter)
  2125  	return c
  2126  }
  2127  
  2128  // PageSize sets the optional parameter "pageSize": The standard list page
  2129  // size.
  2130  func (c *ProjectsLocationsOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsOperationsListCall {
  2131  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  2132  	return c
  2133  }
  2134  
  2135  // PageToken sets the optional parameter "pageToken": The standard list page
  2136  // token.
  2137  func (c *ProjectsLocationsOperationsListCall) PageToken(pageToken string) *ProjectsLocationsOperationsListCall {
  2138  	c.urlParams_.Set("pageToken", pageToken)
  2139  	return c
  2140  }
  2141  
  2142  // Fields allows partial responses to be retrieved. See
  2143  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2144  // details.
  2145  func (c *ProjectsLocationsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsListCall {
  2146  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2147  	return c
  2148  }
  2149  
  2150  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2151  // object's ETag matches the given value. This is useful for getting updates
  2152  // only after the object has changed since the last request.
  2153  func (c *ProjectsLocationsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsListCall {
  2154  	c.ifNoneMatch_ = entityTag
  2155  	return c
  2156  }
  2157  
  2158  // Context sets the context to be used in this call's Do method.
  2159  func (c *ProjectsLocationsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsOperationsListCall {
  2160  	c.ctx_ = ctx
  2161  	return c
  2162  }
  2163  
  2164  // Header returns a http.Header that can be modified by the caller to add
  2165  // headers to the request.
  2166  func (c *ProjectsLocationsOperationsListCall) Header() http.Header {
  2167  	if c.header_ == nil {
  2168  		c.header_ = make(http.Header)
  2169  	}
  2170  	return c.header_
  2171  }
  2172  
  2173  func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Response, error) {
  2174  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2175  	if c.ifNoneMatch_ != "" {
  2176  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2177  	}
  2178  	var body io.Reader = nil
  2179  	c.urlParams_.Set("alt", alt)
  2180  	c.urlParams_.Set("prettyPrint", "false")
  2181  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations")
  2182  	urls += "?" + c.urlParams_.Encode()
  2183  	req, err := http.NewRequest("GET", urls, body)
  2184  	if err != nil {
  2185  		return nil, err
  2186  	}
  2187  	req.Header = reqHeaders
  2188  	googleapi.Expand(req.URL, map[string]string{
  2189  		"name": c.name,
  2190  	})
  2191  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2192  }
  2193  
  2194  // Do executes the "privateca.projects.locations.operations.list" call.
  2195  // Any non-2xx status code is an error. Response headers are in either
  2196  // *ListOperationsResponse.ServerResponse.Header or (if a response was returned
  2197  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2198  // check whether the returned error was because http.StatusNotModified was
  2199  // returned.
  2200  func (c *ProjectsLocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) {
  2201  	gensupport.SetOptions(c.urlParams_, opts...)
  2202  	res, err := c.doRequest("json")
  2203  	if res != nil && res.StatusCode == http.StatusNotModified {
  2204  		if res.Body != nil {
  2205  			res.Body.Close()
  2206  		}
  2207  		return nil, gensupport.WrapError(&googleapi.Error{
  2208  			Code:   res.StatusCode,
  2209  			Header: res.Header,
  2210  		})
  2211  	}
  2212  	if err != nil {
  2213  		return nil, err
  2214  	}
  2215  	defer googleapi.CloseBody(res)
  2216  	if err := googleapi.CheckResponse(res); err != nil {
  2217  		return nil, gensupport.WrapError(err)
  2218  	}
  2219  	ret := &ListOperationsResponse{
  2220  		ServerResponse: googleapi.ServerResponse{
  2221  			Header:         res.Header,
  2222  			HTTPStatusCode: res.StatusCode,
  2223  		},
  2224  	}
  2225  	target := &ret
  2226  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2227  		return nil, err
  2228  	}
  2229  	return ret, nil
  2230  }
  2231  
  2232  // Pages invokes f for each page of results.
  2233  // A non-nil error returned from f will halt the iteration.
  2234  // The provided context supersedes any context provided to the Context method.
  2235  func (c *ProjectsLocationsOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error {
  2236  	c.ctx_ = ctx
  2237  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  2238  	for {
  2239  		x, err := c.Do()
  2240  		if err != nil {
  2241  			return err
  2242  		}
  2243  		if err := f(x); err != nil {
  2244  			return err
  2245  		}
  2246  		if x.NextPageToken == "" {
  2247  			return nil
  2248  		}
  2249  		c.PageToken(x.NextPageToken)
  2250  	}
  2251  }
  2252  
  2253  type ProjectsLocationsReusableConfigsGetIamPolicyCall struct {
  2254  	s            *Service
  2255  	resource     string
  2256  	urlParams_   gensupport.URLParams
  2257  	ifNoneMatch_ string
  2258  	ctx_         context.Context
  2259  	header_      http.Header
  2260  }
  2261  
  2262  // GetIamPolicy: Gets the access control policy for a resource. Returns an
  2263  // empty policy if the resource exists and does not have a policy set.
  2264  //
  2265  //   - resource: REQUIRED: The resource for which the policy is being requested.
  2266  //     See Resource names (https://cloud.google.com/apis/design/resource_names)
  2267  //     for the appropriate value for this field.
  2268  func (r *ProjectsLocationsReusableConfigsService) GetIamPolicy(resource string) *ProjectsLocationsReusableConfigsGetIamPolicyCall {
  2269  	c := &ProjectsLocationsReusableConfigsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2270  	c.resource = resource
  2271  	return c
  2272  }
  2273  
  2274  // OptionsRequestedPolicyVersion sets the optional parameter
  2275  // "options.requestedPolicyVersion": The maximum policy version that will be
  2276  // used to format the policy. Valid values are 0, 1, and 3. Requests specifying
  2277  // an invalid value will be rejected. Requests for policies with any
  2278  // conditional role bindings must specify version 3. Policies with no
  2279  // conditional role bindings may specify any valid value or leave the field
  2280  // unset. The policy in the response might use the policy version that you
  2281  // specified, or it might use a lower policy version. For example, if you
  2282  // specify version 3, but the policy has no conditional role bindings, the
  2283  // response uses version 1. To learn which resources support conditions in
  2284  // their IAM policies, see the IAM documentation
  2285  // (https://cloud.google.com/iam/help/conditions/resource-policies).
  2286  func (c *ProjectsLocationsReusableConfigsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsReusableConfigsGetIamPolicyCall {
  2287  	c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
  2288  	return c
  2289  }
  2290  
  2291  // Fields allows partial responses to be retrieved. See
  2292  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2293  // details.
  2294  func (c *ProjectsLocationsReusableConfigsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsReusableConfigsGetIamPolicyCall {
  2295  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2296  	return c
  2297  }
  2298  
  2299  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2300  // object's ETag matches the given value. This is useful for getting updates
  2301  // only after the object has changed since the last request.
  2302  func (c *ProjectsLocationsReusableConfigsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsReusableConfigsGetIamPolicyCall {
  2303  	c.ifNoneMatch_ = entityTag
  2304  	return c
  2305  }
  2306  
  2307  // Context sets the context to be used in this call's Do method.
  2308  func (c *ProjectsLocationsReusableConfigsGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsReusableConfigsGetIamPolicyCall {
  2309  	c.ctx_ = ctx
  2310  	return c
  2311  }
  2312  
  2313  // Header returns a http.Header that can be modified by the caller to add
  2314  // headers to the request.
  2315  func (c *ProjectsLocationsReusableConfigsGetIamPolicyCall) Header() http.Header {
  2316  	if c.header_ == nil {
  2317  		c.header_ = make(http.Header)
  2318  	}
  2319  	return c.header_
  2320  }
  2321  
  2322  func (c *ProjectsLocationsReusableConfigsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  2323  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2324  	if c.ifNoneMatch_ != "" {
  2325  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2326  	}
  2327  	var body io.Reader = nil
  2328  	c.urlParams_.Set("alt", alt)
  2329  	c.urlParams_.Set("prettyPrint", "false")
  2330  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:getIamPolicy")
  2331  	urls += "?" + c.urlParams_.Encode()
  2332  	req, err := http.NewRequest("GET", urls, body)
  2333  	if err != nil {
  2334  		return nil, err
  2335  	}
  2336  	req.Header = reqHeaders
  2337  	googleapi.Expand(req.URL, map[string]string{
  2338  		"resource": c.resource,
  2339  	})
  2340  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2341  }
  2342  
  2343  // Do executes the "privateca.projects.locations.reusableConfigs.getIamPolicy" call.
  2344  // Any non-2xx status code is an error. Response headers are in either
  2345  // *Policy.ServerResponse.Header or (if a response was returned at all) in
  2346  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2347  // whether the returned error was because http.StatusNotModified was returned.
  2348  func (c *ProjectsLocationsReusableConfigsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  2349  	gensupport.SetOptions(c.urlParams_, opts...)
  2350  	res, err := c.doRequest("json")
  2351  	if res != nil && res.StatusCode == http.StatusNotModified {
  2352  		if res.Body != nil {
  2353  			res.Body.Close()
  2354  		}
  2355  		return nil, gensupport.WrapError(&googleapi.Error{
  2356  			Code:   res.StatusCode,
  2357  			Header: res.Header,
  2358  		})
  2359  	}
  2360  	if err != nil {
  2361  		return nil, err
  2362  	}
  2363  	defer googleapi.CloseBody(res)
  2364  	if err := googleapi.CheckResponse(res); err != nil {
  2365  		return nil, gensupport.WrapError(err)
  2366  	}
  2367  	ret := &Policy{
  2368  		ServerResponse: googleapi.ServerResponse{
  2369  			Header:         res.Header,
  2370  			HTTPStatusCode: res.StatusCode,
  2371  		},
  2372  	}
  2373  	target := &ret
  2374  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2375  		return nil, err
  2376  	}
  2377  	return ret, nil
  2378  }
  2379  
  2380  type ProjectsLocationsReusableConfigsSetIamPolicyCall struct {
  2381  	s                   *Service
  2382  	resource            string
  2383  	setiampolicyrequest *SetIamPolicyRequest
  2384  	urlParams_          gensupport.URLParams
  2385  	ctx_                context.Context
  2386  	header_             http.Header
  2387  }
  2388  
  2389  // SetIamPolicy: Sets the access control policy on the specified resource.
  2390  // Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`,
  2391  // and `PERMISSION_DENIED` errors.
  2392  //
  2393  //   - resource: REQUIRED: The resource for which the policy is being specified.
  2394  //     See Resource names (https://cloud.google.com/apis/design/resource_names)
  2395  //     for the appropriate value for this field.
  2396  func (r *ProjectsLocationsReusableConfigsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsReusableConfigsSetIamPolicyCall {
  2397  	c := &ProjectsLocationsReusableConfigsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2398  	c.resource = resource
  2399  	c.setiampolicyrequest = setiampolicyrequest
  2400  	return c
  2401  }
  2402  
  2403  // Fields allows partial responses to be retrieved. See
  2404  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2405  // details.
  2406  func (c *ProjectsLocationsReusableConfigsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsReusableConfigsSetIamPolicyCall {
  2407  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2408  	return c
  2409  }
  2410  
  2411  // Context sets the context to be used in this call's Do method.
  2412  func (c *ProjectsLocationsReusableConfigsSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsReusableConfigsSetIamPolicyCall {
  2413  	c.ctx_ = ctx
  2414  	return c
  2415  }
  2416  
  2417  // Header returns a http.Header that can be modified by the caller to add
  2418  // headers to the request.
  2419  func (c *ProjectsLocationsReusableConfigsSetIamPolicyCall) Header() http.Header {
  2420  	if c.header_ == nil {
  2421  		c.header_ = make(http.Header)
  2422  	}
  2423  	return c.header_
  2424  }
  2425  
  2426  func (c *ProjectsLocationsReusableConfigsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  2427  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  2428  	var body io.Reader = nil
  2429  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
  2430  	if err != nil {
  2431  		return nil, err
  2432  	}
  2433  	c.urlParams_.Set("alt", alt)
  2434  	c.urlParams_.Set("prettyPrint", "false")
  2435  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:setIamPolicy")
  2436  	urls += "?" + c.urlParams_.Encode()
  2437  	req, err := http.NewRequest("POST", urls, body)
  2438  	if err != nil {
  2439  		return nil, err
  2440  	}
  2441  	req.Header = reqHeaders
  2442  	googleapi.Expand(req.URL, map[string]string{
  2443  		"resource": c.resource,
  2444  	})
  2445  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2446  }
  2447  
  2448  // Do executes the "privateca.projects.locations.reusableConfigs.setIamPolicy" call.
  2449  // Any non-2xx status code is an error. Response headers are in either
  2450  // *Policy.ServerResponse.Header or (if a response was returned at all) in
  2451  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2452  // whether the returned error was because http.StatusNotModified was returned.
  2453  func (c *ProjectsLocationsReusableConfigsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  2454  	gensupport.SetOptions(c.urlParams_, opts...)
  2455  	res, err := c.doRequest("json")
  2456  	if res != nil && res.StatusCode == http.StatusNotModified {
  2457  		if res.Body != nil {
  2458  			res.Body.Close()
  2459  		}
  2460  		return nil, gensupport.WrapError(&googleapi.Error{
  2461  			Code:   res.StatusCode,
  2462  			Header: res.Header,
  2463  		})
  2464  	}
  2465  	if err != nil {
  2466  		return nil, err
  2467  	}
  2468  	defer googleapi.CloseBody(res)
  2469  	if err := googleapi.CheckResponse(res); err != nil {
  2470  		return nil, gensupport.WrapError(err)
  2471  	}
  2472  	ret := &Policy{
  2473  		ServerResponse: googleapi.ServerResponse{
  2474  			Header:         res.Header,
  2475  			HTTPStatusCode: res.StatusCode,
  2476  		},
  2477  	}
  2478  	target := &ret
  2479  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2480  		return nil, err
  2481  	}
  2482  	return ret, nil
  2483  }
  2484  
  2485  type ProjectsLocationsReusableConfigsTestIamPermissionsCall struct {
  2486  	s                         *Service
  2487  	resource                  string
  2488  	testiampermissionsrequest *TestIamPermissionsRequest
  2489  	urlParams_                gensupport.URLParams
  2490  	ctx_                      context.Context
  2491  	header_                   http.Header
  2492  }
  2493  
  2494  // TestIamPermissions: Returns permissions that a caller has on the specified
  2495  // resource. If the resource does not exist, this will return an empty set of
  2496  // permissions, not a `NOT_FOUND` error. Note: This operation is designed to be
  2497  // used for building permission-aware UIs and command-line tools, not for
  2498  // authorization checking. This operation may "fail open" without warning.
  2499  //
  2500  //   - resource: REQUIRED: The resource for which the policy detail is being
  2501  //     requested. See Resource names
  2502  //     (https://cloud.google.com/apis/design/resource_names) for the appropriate
  2503  //     value for this field.
  2504  func (r *ProjectsLocationsReusableConfigsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsReusableConfigsTestIamPermissionsCall {
  2505  	c := &ProjectsLocationsReusableConfigsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2506  	c.resource = resource
  2507  	c.testiampermissionsrequest = testiampermissionsrequest
  2508  	return c
  2509  }
  2510  
  2511  // Fields allows partial responses to be retrieved. See
  2512  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2513  // details.
  2514  func (c *ProjectsLocationsReusableConfigsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsReusableConfigsTestIamPermissionsCall {
  2515  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2516  	return c
  2517  }
  2518  
  2519  // Context sets the context to be used in this call's Do method.
  2520  func (c *ProjectsLocationsReusableConfigsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsReusableConfigsTestIamPermissionsCall {
  2521  	c.ctx_ = ctx
  2522  	return c
  2523  }
  2524  
  2525  // Header returns a http.Header that can be modified by the caller to add
  2526  // headers to the request.
  2527  func (c *ProjectsLocationsReusableConfigsTestIamPermissionsCall) Header() http.Header {
  2528  	if c.header_ == nil {
  2529  		c.header_ = make(http.Header)
  2530  	}
  2531  	return c.header_
  2532  }
  2533  
  2534  func (c *ProjectsLocationsReusableConfigsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  2535  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  2536  	var body io.Reader = nil
  2537  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
  2538  	if err != nil {
  2539  		return nil, err
  2540  	}
  2541  	c.urlParams_.Set("alt", alt)
  2542  	c.urlParams_.Set("prettyPrint", "false")
  2543  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:testIamPermissions")
  2544  	urls += "?" + c.urlParams_.Encode()
  2545  	req, err := http.NewRequest("POST", urls, body)
  2546  	if err != nil {
  2547  		return nil, err
  2548  	}
  2549  	req.Header = reqHeaders
  2550  	googleapi.Expand(req.URL, map[string]string{
  2551  		"resource": c.resource,
  2552  	})
  2553  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2554  }
  2555  
  2556  // Do executes the "privateca.projects.locations.reusableConfigs.testIamPermissions" call.
  2557  // Any non-2xx status code is an error. Response headers are in either
  2558  // *TestIamPermissionsResponse.ServerResponse.Header or (if a response was
  2559  // returned at all) in error.(*googleapi.Error).Header. Use
  2560  // googleapi.IsNotModified to check whether the returned error was because
  2561  // http.StatusNotModified was returned.
  2562  func (c *ProjectsLocationsReusableConfigsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
  2563  	gensupport.SetOptions(c.urlParams_, opts...)
  2564  	res, err := c.doRequest("json")
  2565  	if res != nil && res.StatusCode == http.StatusNotModified {
  2566  		if res.Body != nil {
  2567  			res.Body.Close()
  2568  		}
  2569  		return nil, gensupport.WrapError(&googleapi.Error{
  2570  			Code:   res.StatusCode,
  2571  			Header: res.Header,
  2572  		})
  2573  	}
  2574  	if err != nil {
  2575  		return nil, err
  2576  	}
  2577  	defer googleapi.CloseBody(res)
  2578  	if err := googleapi.CheckResponse(res); err != nil {
  2579  		return nil, gensupport.WrapError(err)
  2580  	}
  2581  	ret := &TestIamPermissionsResponse{
  2582  		ServerResponse: googleapi.ServerResponse{
  2583  			Header:         res.Header,
  2584  			HTTPStatusCode: res.StatusCode,
  2585  		},
  2586  	}
  2587  	target := &ret
  2588  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2589  		return nil, err
  2590  	}
  2591  	return ret, nil
  2592  }
  2593  

View as plain text