...

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

Documentation: google.golang.org/api/secretmanager/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 secretmanager provides access to the Secret Manager API.
     8  //
     9  // For product documentation, see: https://cloud.google.com/secret-manager/
    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/secretmanager/v1beta1"
    27  //	...
    28  //	ctx := context.Background()
    29  //	secretmanagerService, err := secretmanager.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  //	secretmanagerService, err := secretmanager.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  //	secretmanagerService, err := secretmanager.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
    49  //
    50  // See [google.golang.org/api/option.ClientOption] for details on options.
    51  package secretmanager // import "google.golang.org/api/secretmanager/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 = "secretmanager:v1beta1"
    90  const apiName = "secretmanager"
    91  const apiVersion = "v1beta1"
    92  const basePath = "https://secretmanager.googleapis.com/"
    93  const basePathTemplate = "https://secretmanager.UNIVERSE_DOMAIN/"
    94  const mtlsBasePath = "https://secretmanager.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  	rs.Secrets = NewProjectsSecretsService(s)
   161  	return rs
   162  }
   163  
   164  type ProjectsService struct {
   165  	s *Service
   166  
   167  	Locations *ProjectsLocationsService
   168  
   169  	Secrets *ProjectsSecretsService
   170  }
   171  
   172  func NewProjectsLocationsService(s *Service) *ProjectsLocationsService {
   173  	rs := &ProjectsLocationsService{s: s}
   174  	return rs
   175  }
   176  
   177  type ProjectsLocationsService struct {
   178  	s *Service
   179  }
   180  
   181  func NewProjectsSecretsService(s *Service) *ProjectsSecretsService {
   182  	rs := &ProjectsSecretsService{s: s}
   183  	rs.Versions = NewProjectsSecretsVersionsService(s)
   184  	return rs
   185  }
   186  
   187  type ProjectsSecretsService struct {
   188  	s *Service
   189  
   190  	Versions *ProjectsSecretsVersionsService
   191  }
   192  
   193  func NewProjectsSecretsVersionsService(s *Service) *ProjectsSecretsVersionsService {
   194  	rs := &ProjectsSecretsVersionsService{s: s}
   195  	return rs
   196  }
   197  
   198  type ProjectsSecretsVersionsService struct {
   199  	s *Service
   200  }
   201  
   202  // AccessSecretVersionResponse: Response message for
   203  // SecretManagerService.AccessSecretVersion.
   204  type AccessSecretVersionResponse struct {
   205  	// Name: The resource name of the SecretVersion in the format
   206  	// `projects/*/secrets/*/versions/*`.
   207  	Name string `json:"name,omitempty"`
   208  	// Payload: Secret payload
   209  	Payload *SecretPayload `json:"payload,omitempty"`
   210  
   211  	// ServerResponse contains the HTTP response code and headers from the server.
   212  	googleapi.ServerResponse `json:"-"`
   213  	// ForceSendFields is a list of field names (e.g. "Name") to unconditionally
   214  	// include in API requests. By default, fields with empty or default values are
   215  	// omitted from API requests. See
   216  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   217  	// details.
   218  	ForceSendFields []string `json:"-"`
   219  	// NullFields is a list of field names (e.g. "Name") to include in API requests
   220  	// with the JSON null value. By default, fields with empty values are omitted
   221  	// from API requests. See
   222  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   223  	NullFields []string `json:"-"`
   224  }
   225  
   226  func (s *AccessSecretVersionResponse) MarshalJSON() ([]byte, error) {
   227  	type NoMethod AccessSecretVersionResponse
   228  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   229  }
   230  
   231  // AddSecretVersionRequest: Request message for
   232  // SecretManagerService.AddSecretVersion.
   233  type AddSecretVersionRequest struct {
   234  	// Payload: Required. The secret payload of the SecretVersion.
   235  	Payload *SecretPayload `json:"payload,omitempty"`
   236  	// ForceSendFields is a list of field names (e.g. "Payload") to unconditionally
   237  	// include in API requests. By default, fields with empty or default values are
   238  	// omitted from API requests. See
   239  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   240  	// details.
   241  	ForceSendFields []string `json:"-"`
   242  	// NullFields is a list of field names (e.g. "Payload") to include in API
   243  	// requests with the JSON null value. By default, fields with empty values are
   244  	// omitted from API requests. See
   245  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   246  	NullFields []string `json:"-"`
   247  }
   248  
   249  func (s *AddSecretVersionRequest) MarshalJSON() ([]byte, error) {
   250  	type NoMethod AddSecretVersionRequest
   251  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   252  }
   253  
   254  // AuditConfig: Specifies the audit configuration for a service. The
   255  // configuration determines which permission types are logged, and what
   256  // identities, if any, are exempted from logging. An AuditConfig must have one
   257  // or more AuditLogConfigs. If there are AuditConfigs for both `allServices`
   258  // and a specific service, the union of the two AuditConfigs is used for that
   259  // service: the log_types specified in each AuditConfig are enabled, and the
   260  // exempted_members in each AuditLogConfig are exempted. Example Policy with
   261  // multiple AuditConfigs: { "audit_configs": [ { "service": "allServices",
   262  // "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [
   263  // "user:jose@example.com" ] }, { "log_type": "DATA_WRITE" }, { "log_type":
   264  // "ADMIN_READ" } ] }, { "service": "sampleservice.googleapis.com",
   265  // "audit_log_configs": [ { "log_type": "DATA_READ" }, { "log_type":
   266  // "DATA_WRITE", "exempted_members": [ "user:aliya@example.com" ] } ] } ] } For
   267  // sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ
   268  // logging. It also exempts `jose@example.com` from DATA_READ logging, and
   269  // `aliya@example.com` from DATA_WRITE logging.
   270  type AuditConfig struct {
   271  	// AuditLogConfigs: The configuration for logging of each type of permission.
   272  	AuditLogConfigs []*AuditLogConfig `json:"auditLogConfigs,omitempty"`
   273  	// Service: Specifies a service that will be enabled for audit logging. For
   274  	// example, `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices`
   275  	// is a special value that covers all services.
   276  	Service string `json:"service,omitempty"`
   277  	// ForceSendFields is a list of field names (e.g. "AuditLogConfigs") to
   278  	// unconditionally include in API requests. By default, fields with empty or
   279  	// default values are omitted from API requests. See
   280  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   281  	// details.
   282  	ForceSendFields []string `json:"-"`
   283  	// NullFields is a list of field names (e.g. "AuditLogConfigs") to include in
   284  	// API requests with the JSON null value. By default, fields with empty values
   285  	// are omitted from API requests. See
   286  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   287  	NullFields []string `json:"-"`
   288  }
   289  
   290  func (s *AuditConfig) MarshalJSON() ([]byte, error) {
   291  	type NoMethod AuditConfig
   292  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   293  }
   294  
   295  // AuditLogConfig: Provides the configuration for logging a type of
   296  // permissions. Example: { "audit_log_configs": [ { "log_type": "DATA_READ",
   297  // "exempted_members": [ "user:jose@example.com" ] }, { "log_type":
   298  // "DATA_WRITE" } ] } This enables 'DATA_READ' and 'DATA_WRITE' logging, while
   299  // exempting jose@example.com from DATA_READ logging.
   300  type AuditLogConfig struct {
   301  	// ExemptedMembers: Specifies the identities that do not cause logging for this
   302  	// type of permission. Follows the same format of Binding.members.
   303  	ExemptedMembers []string `json:"exemptedMembers,omitempty"`
   304  	// LogType: The log type that this config enables.
   305  	//
   306  	// Possible values:
   307  	//   "LOG_TYPE_UNSPECIFIED" - Default case. Should never be this.
   308  	//   "ADMIN_READ" - Admin reads. Example: CloudIAM getIamPolicy
   309  	//   "DATA_WRITE" - Data writes. Example: CloudSQL Users create
   310  	//   "DATA_READ" - Data reads. Example: CloudSQL Users list
   311  	LogType string `json:"logType,omitempty"`
   312  	// ForceSendFields is a list of field names (e.g. "ExemptedMembers") to
   313  	// unconditionally include in API requests. By default, fields with empty or
   314  	// default values are omitted from API requests. See
   315  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   316  	// details.
   317  	ForceSendFields []string `json:"-"`
   318  	// NullFields is a list of field names (e.g. "ExemptedMembers") to include in
   319  	// API requests with the JSON null value. By default, fields with empty values
   320  	// are omitted from API requests. See
   321  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   322  	NullFields []string `json:"-"`
   323  }
   324  
   325  func (s *AuditLogConfig) MarshalJSON() ([]byte, error) {
   326  	type NoMethod AuditLogConfig
   327  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   328  }
   329  
   330  // Automatic: A replication policy that replicates the Secret payload without
   331  // any restrictions.
   332  type Automatic struct {
   333  }
   334  
   335  // Binding: Associates `members`, or principals, with a `role`.
   336  type Binding struct {
   337  	// Condition: The condition that is associated with this binding. If the
   338  	// condition evaluates to `true`, then this binding applies to the current
   339  	// request. If the condition evaluates to `false`, then this binding does not
   340  	// apply to the current request. However, a different role binding might grant
   341  	// the same role to one or more of the principals in this binding. To learn
   342  	// which resources support conditions in their IAM policies, see the IAM
   343  	// documentation
   344  	// (https://cloud.google.com/iam/help/conditions/resource-policies).
   345  	Condition *Expr `json:"condition,omitempty"`
   346  	// Members: Specifies the principals requesting access for a Google Cloud
   347  	// resource. `members` can have the following values: * `allUsers`: A special
   348  	// identifier that represents anyone who is on the internet; with or without a
   349  	// Google account. * `allAuthenticatedUsers`: A special identifier that
   350  	// represents anyone who is authenticated with a Google account or a service
   351  	// account. Does not include identities that come from external identity
   352  	// providers (IdPs) through identity federation. * `user:{emailid}`: An email
   353  	// address that represents a specific Google account. For example,
   354  	// `alice@example.com` . * `serviceAccount:{emailid}`: An email address that
   355  	// represents a Google service account. For example,
   356  	// `my-other-app@appspot.gserviceaccount.com`. *
   357  	// `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: An
   358  	// identifier for a Kubernetes service account
   359  	// (https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts).
   360  	// For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. *
   361  	// `group:{emailid}`: An email address that represents a Google group. For
   362  	// example, `admins@example.com`. * `domain:{domain}`: The G Suite domain
   363  	// (primary) that represents all the users of that domain. For example,
   364  	// `google.com` or `example.com`. *
   365  	// `principal://iam.googleapis.com/locations/global/workforcePools/{pool_id}/sub
   366  	// ject/{subject_attribute_value}`: A single identity in a workforce identity
   367  	// pool. *
   368  	// `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/
   369  	// group/{group_id}`: All workforce identities in a group. *
   370  	// `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/
   371  	// attribute.{attribute_name}/{attribute_value}`: All workforce identities with
   372  	// a specific attribute value. *
   373  	// `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/
   374  	// *`: All identities in a workforce identity pool. *
   375  	// `principal://iam.googleapis.com/projects/{project_number}/locations/global/wo
   376  	// rkloadIdentityPools/{pool_id}/subject/{subject_attribute_value}`: A single
   377  	// identity in a workload identity pool. *
   378  	// `principalSet://iam.googleapis.com/projects/{project_number}/locations/global
   379  	// /workloadIdentityPools/{pool_id}/group/{group_id}`: A workload identity pool
   380  	// group. *
   381  	// `principalSet://iam.googleapis.com/projects/{project_number}/locations/global
   382  	// /workloadIdentityPools/{pool_id}/attribute.{attribute_name}/{attribute_value}
   383  	// `: All identities in a workload identity pool with a certain attribute. *
   384  	// `principalSet://iam.googleapis.com/projects/{project_number}/locations/global
   385  	// /workloadIdentityPools/{pool_id}/*`: All identities in a workload identity
   386  	// pool. * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus
   387  	// unique identifier) representing a user that has been recently deleted. For
   388  	// example, `alice@example.com?uid=123456789012345678901`. If the user is
   389  	// recovered, this value reverts to `user:{emailid}` and the recovered user
   390  	// retains the role in the binding. *
   391  	// `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus
   392  	// unique identifier) representing a service account that has been recently
   393  	// deleted. For example,
   394  	// `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the
   395  	// service account is undeleted, this value reverts to
   396  	// `serviceAccount:{emailid}` and the undeleted service account retains the
   397  	// role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email
   398  	// address (plus unique identifier) representing a Google group that has been
   399  	// recently deleted. For example,
   400  	// `admins@example.com?uid=123456789012345678901`. If the group is recovered,
   401  	// this value reverts to `group:{emailid}` and the recovered group retains the
   402  	// role in the binding. *
   403  	// `deleted:principal://iam.googleapis.com/locations/global/workforcePools/{pool
   404  	// _id}/subject/{subject_attribute_value}`: Deleted single identity in a
   405  	// workforce identity pool. For example,
   406  	// `deleted:principal://iam.googleapis.com/locations/global/workforcePools/my-po
   407  	// ol-id/subject/my-subject-attribute-value`.
   408  	Members []string `json:"members,omitempty"`
   409  	// Role: Role that is assigned to the list of `members`, or principals. For
   410  	// example, `roles/viewer`, `roles/editor`, or `roles/owner`. For an overview
   411  	// of the IAM roles and permissions, see the IAM documentation
   412  	// (https://cloud.google.com/iam/docs/roles-overview). For a list of the
   413  	// available pre-defined roles, see here
   414  	// (https://cloud.google.com/iam/docs/understanding-roles).
   415  	Role string `json:"role,omitempty"`
   416  	// ForceSendFields is a list of field names (e.g. "Condition") to
   417  	// unconditionally include in API requests. By default, fields with empty or
   418  	// default values are omitted from API requests. See
   419  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   420  	// details.
   421  	ForceSendFields []string `json:"-"`
   422  	// NullFields is a list of field names (e.g. "Condition") to include in API
   423  	// requests with the JSON null value. By default, fields with empty values are
   424  	// omitted from API requests. See
   425  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   426  	NullFields []string `json:"-"`
   427  }
   428  
   429  func (s *Binding) MarshalJSON() ([]byte, error) {
   430  	type NoMethod Binding
   431  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   432  }
   433  
   434  // DestroySecretVersionRequest: Request message for
   435  // SecretManagerService.DestroySecretVersion.
   436  type DestroySecretVersionRequest struct {
   437  }
   438  
   439  // DisableSecretVersionRequest: Request message for
   440  // SecretManagerService.DisableSecretVersion.
   441  type DisableSecretVersionRequest struct {
   442  }
   443  
   444  // Empty: A generic empty message that you can re-use to avoid defining
   445  // duplicated empty messages in your APIs. A typical example is to use it as
   446  // the request or the response type of an API method. For instance: service Foo
   447  // { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }
   448  type Empty struct {
   449  	// ServerResponse contains the HTTP response code and headers from the server.
   450  	googleapi.ServerResponse `json:"-"`
   451  }
   452  
   453  // EnableSecretVersionRequest: Request message for
   454  // SecretManagerService.EnableSecretVersion.
   455  type EnableSecretVersionRequest struct {
   456  }
   457  
   458  // Expr: Represents a textual expression in the Common Expression Language
   459  // (CEL) syntax. CEL is a C-like expression language. The syntax and semantics
   460  // of CEL are documented at https://github.com/google/cel-spec. Example
   461  // (Comparison): title: "Summary size limit" description: "Determines if a
   462  // summary is less than 100 chars" expression: "document.summary.size() < 100"
   463  // Example (Equality): title: "Requestor is owner" description: "Determines if
   464  // requestor is the document owner" expression: "document.owner ==
   465  // request.auth.claims.email" Example (Logic): title: "Public documents"
   466  // description: "Determine whether the document should be publicly visible"
   467  // expression: "document.type != 'private' && document.type != 'internal'"
   468  // Example (Data Manipulation): title: "Notification string" description:
   469  // "Create a notification string with a timestamp." expression: "'New message
   470  // received at ' + string(document.create_time)" The exact variables and
   471  // functions that may be referenced within an expression are determined by the
   472  // service that evaluates it. See the service documentation for additional
   473  // information.
   474  type Expr struct {
   475  	// Description: Optional. Description of the expression. This is a longer text
   476  	// which describes the expression, e.g. when hovered over it in a UI.
   477  	Description string `json:"description,omitempty"`
   478  	// Expression: Textual representation of an expression in Common Expression
   479  	// Language syntax.
   480  	Expression string `json:"expression,omitempty"`
   481  	// Location: Optional. String indicating the location of the expression for
   482  	// error reporting, e.g. a file name and a position in the file.
   483  	Location string `json:"location,omitempty"`
   484  	// Title: Optional. Title for the expression, i.e. a short string describing
   485  	// its purpose. This can be used e.g. in UIs which allow to enter the
   486  	// expression.
   487  	Title string `json:"title,omitempty"`
   488  	// ForceSendFields is a list of field names (e.g. "Description") to
   489  	// unconditionally include in API requests. By default, fields with empty or
   490  	// default values are omitted from API requests. See
   491  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   492  	// details.
   493  	ForceSendFields []string `json:"-"`
   494  	// NullFields is a list of field names (e.g. "Description") to include in API
   495  	// requests with the JSON null value. By default, fields with empty values are
   496  	// omitted from API requests. See
   497  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   498  	NullFields []string `json:"-"`
   499  }
   500  
   501  func (s *Expr) MarshalJSON() ([]byte, error) {
   502  	type NoMethod Expr
   503  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   504  }
   505  
   506  // ListLocationsResponse: The response message for Locations.ListLocations.
   507  type ListLocationsResponse struct {
   508  	// Locations: A list of locations that matches the specified filter in the
   509  	// request.
   510  	Locations []*Location `json:"locations,omitempty"`
   511  	// NextPageToken: The standard List next-page token.
   512  	NextPageToken string `json:"nextPageToken,omitempty"`
   513  
   514  	// ServerResponse contains the HTTP response code and headers from the server.
   515  	googleapi.ServerResponse `json:"-"`
   516  	// ForceSendFields is a list of field names (e.g. "Locations") to
   517  	// unconditionally include in API requests. By default, fields with empty or
   518  	// default values are omitted from API requests. See
   519  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   520  	// details.
   521  	ForceSendFields []string `json:"-"`
   522  	// NullFields is a list of field names (e.g. "Locations") to include in API
   523  	// requests with the JSON null value. By default, fields with empty values are
   524  	// omitted from API requests. See
   525  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   526  	NullFields []string `json:"-"`
   527  }
   528  
   529  func (s *ListLocationsResponse) MarshalJSON() ([]byte, error) {
   530  	type NoMethod ListLocationsResponse
   531  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   532  }
   533  
   534  // ListSecretVersionsResponse: Response message for
   535  // SecretManagerService.ListSecretVersions.
   536  type ListSecretVersionsResponse struct {
   537  	// NextPageToken: A token to retrieve the next page of results. Pass this value
   538  	// in ListSecretVersionsRequest.page_token to retrieve the next page.
   539  	NextPageToken string `json:"nextPageToken,omitempty"`
   540  	// TotalSize: The total number of SecretVersions.
   541  	TotalSize int64 `json:"totalSize,omitempty"`
   542  	// Versions: The list of SecretVersions sorted in reverse by create_time
   543  	// (newest first).
   544  	Versions []*SecretVersion `json:"versions,omitempty"`
   545  
   546  	// ServerResponse contains the HTTP response code and headers from the server.
   547  	googleapi.ServerResponse `json:"-"`
   548  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
   549  	// unconditionally include in API requests. By default, fields with empty or
   550  	// default values are omitted from API requests. See
   551  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   552  	// details.
   553  	ForceSendFields []string `json:"-"`
   554  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
   555  	// requests with the JSON null value. By default, fields with empty values are
   556  	// omitted from API requests. See
   557  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   558  	NullFields []string `json:"-"`
   559  }
   560  
   561  func (s *ListSecretVersionsResponse) MarshalJSON() ([]byte, error) {
   562  	type NoMethod ListSecretVersionsResponse
   563  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   564  }
   565  
   566  // ListSecretsResponse: Response message for SecretManagerService.ListSecrets.
   567  type ListSecretsResponse struct {
   568  	// NextPageToken: A token to retrieve the next page of results. Pass this value
   569  	// in ListSecretsRequest.page_token to retrieve the next page.
   570  	NextPageToken string `json:"nextPageToken,omitempty"`
   571  	// Secrets: The list of Secrets sorted in reverse by create_time (newest
   572  	// first).
   573  	Secrets []*Secret `json:"secrets,omitempty"`
   574  	// TotalSize: The total number of Secrets.
   575  	TotalSize int64 `json:"totalSize,omitempty"`
   576  
   577  	// ServerResponse contains the HTTP response code and headers from the server.
   578  	googleapi.ServerResponse `json:"-"`
   579  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
   580  	// unconditionally include in API requests. By default, fields with empty or
   581  	// default values are omitted from API requests. See
   582  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   583  	// details.
   584  	ForceSendFields []string `json:"-"`
   585  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
   586  	// requests with the JSON null value. By default, fields with empty values are
   587  	// omitted from API requests. See
   588  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   589  	NullFields []string `json:"-"`
   590  }
   591  
   592  func (s *ListSecretsResponse) MarshalJSON() ([]byte, error) {
   593  	type NoMethod ListSecretsResponse
   594  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   595  }
   596  
   597  // Location: A resource that represents a Google Cloud location.
   598  type Location struct {
   599  	// DisplayName: The friendly name for this location, typically a nearby city
   600  	// name. For example, "Tokyo".
   601  	DisplayName string `json:"displayName,omitempty"`
   602  	// Labels: Cross-service attributes for the location. For example
   603  	// {"cloud.googleapis.com/region": "us-east1"}
   604  	Labels map[string]string `json:"labels,omitempty"`
   605  	// LocationId: The canonical id for this location. For example: "us-east1".
   606  	LocationId string `json:"locationId,omitempty"`
   607  	// Metadata: Service-specific metadata. For example the available capacity at
   608  	// the given location.
   609  	Metadata googleapi.RawMessage `json:"metadata,omitempty"`
   610  	// Name: Resource name for the location, which may vary between
   611  	// implementations. For example:
   612  	// "projects/example-project/locations/us-east1"
   613  	Name string `json:"name,omitempty"`
   614  
   615  	// ServerResponse contains the HTTP response code and headers from the server.
   616  	googleapi.ServerResponse `json:"-"`
   617  	// ForceSendFields is a list of field names (e.g. "DisplayName") to
   618  	// unconditionally include in API requests. By default, fields with empty or
   619  	// default values are omitted from API requests. See
   620  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   621  	// details.
   622  	ForceSendFields []string `json:"-"`
   623  	// NullFields is a list of field names (e.g. "DisplayName") to include in API
   624  	// requests with the JSON null value. By default, fields with empty values are
   625  	// omitted from API requests. See
   626  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   627  	NullFields []string `json:"-"`
   628  }
   629  
   630  func (s *Location) MarshalJSON() ([]byte, error) {
   631  	type NoMethod Location
   632  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   633  }
   634  
   635  // Policy: An Identity and Access Management (IAM) policy, which specifies
   636  // access controls for Google Cloud resources. A `Policy` is a collection of
   637  // `bindings`. A `binding` binds one or more `members`, or principals, to a
   638  // single `role`. Principals can be user accounts, service accounts, Google
   639  // groups, and domains (such as G Suite). A `role` is a named list of
   640  // permissions; each `role` can be an IAM predefined role or a user-created
   641  // custom role. For some types of Google Cloud resources, a `binding` can also
   642  // specify a `condition`, which is a logical expression that allows access to a
   643  // resource only if the expression evaluates to `true`. A condition can add
   644  // constraints based on attributes of the request, the resource, or both. To
   645  // learn which resources support conditions in their IAM policies, see the IAM
   646  // documentation
   647  // (https://cloud.google.com/iam/help/conditions/resource-policies). **JSON
   648  // example:** ``` { "bindings": [ { "role":
   649  // "roles/resourcemanager.organizationAdmin", "members": [
   650  // "user:mike@example.com", "group:admins@example.com", "domain:google.com",
   651  // "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role":
   652  // "roles/resourcemanager.organizationViewer", "members": [
   653  // "user:eve@example.com" ], "condition": { "title": "expirable access",
   654  // "description": "Does not grant access after Sep 2020", "expression":
   655  // "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag":
   656  // "BwWWja0YfJA=", "version": 3 } ``` **YAML example:** ``` bindings: -
   657  // members: - user:mike@example.com - group:admins@example.com -
   658  // domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com
   659  // role: roles/resourcemanager.organizationAdmin - members: -
   660  // user:eve@example.com role: roles/resourcemanager.organizationViewer
   661  // condition: title: expirable access description: Does not grant access after
   662  // Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z')
   663  // etag: BwWWja0YfJA= version: 3 ``` For a description of IAM and its features,
   664  // see the IAM documentation (https://cloud.google.com/iam/docs/).
   665  type Policy struct {
   666  	// AuditConfigs: Specifies cloud audit logging configuration for this policy.
   667  	AuditConfigs []*AuditConfig `json:"auditConfigs,omitempty"`
   668  	// Bindings: Associates a list of `members`, or principals, with a `role`.
   669  	// Optionally, may specify a `condition` that determines how and when the
   670  	// `bindings` are applied. Each of the `bindings` must contain at least one
   671  	// principal. The `bindings` in a `Policy` can refer to up to 1,500 principals;
   672  	// up to 250 of these principals can be Google groups. Each occurrence of a
   673  	// principal counts towards these limits. For example, if the `bindings` grant
   674  	// 50 different roles to `user:alice@example.com`, and not to any other
   675  	// principal, then you can add another 1,450 principals to the `bindings` in
   676  	// the `Policy`.
   677  	Bindings []*Binding `json:"bindings,omitempty"`
   678  	// Etag: `etag` is used for optimistic concurrency control as a way to help
   679  	// prevent simultaneous updates of a policy from overwriting each other. It is
   680  	// strongly suggested that systems make use of the `etag` in the
   681  	// read-modify-write cycle to perform policy updates in order to avoid race
   682  	// conditions: An `etag` is returned in the response to `getIamPolicy`, and
   683  	// systems are expected to put that etag in the request to `setIamPolicy` to
   684  	// ensure that their change will be applied to the same version of the policy.
   685  	// **Important:** If you use IAM Conditions, you must include the `etag` field
   686  	// whenever you call `setIamPolicy`. If you omit this field, then IAM allows
   687  	// you to overwrite a version `3` policy with a version `1` policy, and all of
   688  	// the conditions in the version `3` policy are lost.
   689  	Etag string `json:"etag,omitempty"`
   690  	// Version: Specifies the format of the policy. Valid values are `0`, `1`, and
   691  	// `3`. Requests that specify an invalid value are rejected. Any operation that
   692  	// affects conditional role bindings must specify version `3`. This requirement
   693  	// applies to the following operations: * Getting a policy that includes a
   694  	// conditional role binding * Adding a conditional role binding to a policy *
   695  	// Changing a conditional role binding in a policy * Removing any role binding,
   696  	// with or without a condition, from a policy that includes conditions
   697  	// **Important:** If you use IAM Conditions, you must include the `etag` field
   698  	// whenever you call `setIamPolicy`. If you omit this field, then IAM allows
   699  	// you to overwrite a version `3` policy with a version `1` policy, and all of
   700  	// the conditions in the version `3` policy are lost. If a policy does not
   701  	// include any conditions, operations on that policy may specify any valid
   702  	// version or leave the field unset. To learn which resources support
   703  	// conditions in their IAM policies, see the IAM documentation
   704  	// (https://cloud.google.com/iam/help/conditions/resource-policies).
   705  	Version int64 `json:"version,omitempty"`
   706  
   707  	// ServerResponse contains the HTTP response code and headers from the server.
   708  	googleapi.ServerResponse `json:"-"`
   709  	// ForceSendFields is a list of field names (e.g. "AuditConfigs") to
   710  	// unconditionally include in API requests. By default, fields with empty or
   711  	// default values are omitted from API requests. See
   712  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   713  	// details.
   714  	ForceSendFields []string `json:"-"`
   715  	// NullFields is a list of field names (e.g. "AuditConfigs") to include in API
   716  	// requests with the JSON null value. By default, fields with empty values are
   717  	// omitted from API requests. See
   718  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   719  	NullFields []string `json:"-"`
   720  }
   721  
   722  func (s *Policy) MarshalJSON() ([]byte, error) {
   723  	type NoMethod Policy
   724  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   725  }
   726  
   727  // Replica: Represents a Replica for this Secret.
   728  type Replica struct {
   729  	// Location: The canonical IDs of the location to replicate data. For example:
   730  	// "us-east1".
   731  	Location string `json:"location,omitempty"`
   732  	// ForceSendFields is a list of field names (e.g. "Location") to
   733  	// unconditionally include in API requests. By default, fields with empty or
   734  	// default values are omitted from API requests. See
   735  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   736  	// details.
   737  	ForceSendFields []string `json:"-"`
   738  	// NullFields is a list of field names (e.g. "Location") to include in API
   739  	// requests with the JSON null value. By default, fields with empty values are
   740  	// omitted from API requests. See
   741  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   742  	NullFields []string `json:"-"`
   743  }
   744  
   745  func (s *Replica) MarshalJSON() ([]byte, error) {
   746  	type NoMethod Replica
   747  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   748  }
   749  
   750  // Replication: A policy that defines the replication configuration of data.
   751  type Replication struct {
   752  	// Automatic: The Secret will automatically be replicated without any
   753  	// restrictions.
   754  	Automatic *Automatic `json:"automatic,omitempty"`
   755  	// UserManaged: The Secret will only be replicated into the locations
   756  	// specified.
   757  	UserManaged *UserManaged `json:"userManaged,omitempty"`
   758  	// ForceSendFields is a list of field names (e.g. "Automatic") to
   759  	// unconditionally include in API requests. By default, fields with empty or
   760  	// default values are omitted from API requests. See
   761  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   762  	// details.
   763  	ForceSendFields []string `json:"-"`
   764  	// NullFields is a list of field names (e.g. "Automatic") to include in API
   765  	// requests with the JSON null value. By default, fields with empty values are
   766  	// omitted from API requests. See
   767  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   768  	NullFields []string `json:"-"`
   769  }
   770  
   771  func (s *Replication) MarshalJSON() ([]byte, error) {
   772  	type NoMethod Replication
   773  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   774  }
   775  
   776  // Secret: A Secret is a logical secret whose value and versions can be
   777  // accessed. A Secret is made up of zero or more SecretVersions that represent
   778  // the secret data.
   779  type Secret struct {
   780  	// CreateTime: Output only. The time at which the Secret was created.
   781  	CreateTime string `json:"createTime,omitempty"`
   782  	// Labels: The labels assigned to this Secret. Label keys must be between 1 and
   783  	// 63 characters long, have a UTF-8 encoding of maximum 128 bytes, and must
   784  	// conform to the following PCRE regular expression: `\p{Ll}\p{Lo}{0,62}` Label
   785  	// values must be between 0 and 63 characters long, have a UTF-8 encoding of
   786  	// maximum 128 bytes, and must conform to the following PCRE regular
   787  	// expression: `[\p{Ll}\p{Lo}\p{N}_-]{0,63}` No more than 64 labels can be
   788  	// assigned to a given resource.
   789  	Labels map[string]string `json:"labels,omitempty"`
   790  	// Name: Output only. The resource name of the Secret in the format
   791  	// `projects/*/secrets/*`.
   792  	Name string `json:"name,omitempty"`
   793  	// Replication: Required. Immutable. The replication policy of the secret data
   794  	// attached to the Secret. The replication policy cannot be changed after the
   795  	// Secret has been created.
   796  	Replication *Replication `json:"replication,omitempty"`
   797  
   798  	// ServerResponse contains the HTTP response code and headers from the server.
   799  	googleapi.ServerResponse `json:"-"`
   800  	// ForceSendFields is a list of field names (e.g. "CreateTime") 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. "CreateTime") 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 *Secret) MarshalJSON() ([]byte, error) {
   814  	type NoMethod Secret
   815  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   816  }
   817  
   818  // SecretPayload: A secret payload resource in the Secret Manager API. This
   819  // contains the sensitive secret data that is associated with a SecretVersion.
   820  type SecretPayload struct {
   821  	// Data: The secret data. Must be no larger than 64KiB.
   822  	Data string `json:"data,omitempty"`
   823  	// ForceSendFields is a list of field names (e.g. "Data") to unconditionally
   824  	// include in API requests. By default, fields with empty or default values are
   825  	// omitted from API requests. See
   826  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   827  	// details.
   828  	ForceSendFields []string `json:"-"`
   829  	// NullFields is a list of field names (e.g. "Data") to include in API requests
   830  	// with the JSON null value. By default, fields with empty values are omitted
   831  	// from API requests. See
   832  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   833  	NullFields []string `json:"-"`
   834  }
   835  
   836  func (s *SecretPayload) MarshalJSON() ([]byte, error) {
   837  	type NoMethod SecretPayload
   838  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   839  }
   840  
   841  // SecretVersion: A secret version resource in the Secret Manager API.
   842  type SecretVersion struct {
   843  	// CreateTime: Output only. The time at which the SecretVersion was created.
   844  	CreateTime string `json:"createTime,omitempty"`
   845  	// DestroyTime: Output only. The time this SecretVersion was destroyed. Only
   846  	// present if state is DESTROYED.
   847  	DestroyTime string `json:"destroyTime,omitempty"`
   848  	// Name: Output only. The resource name of the SecretVersion in the format
   849  	// `projects/*/secrets/*/versions/*`. SecretVersion IDs in a Secret start at 1
   850  	// and are incremented for each subsequent version of the secret.
   851  	Name string `json:"name,omitempty"`
   852  	// State: Output only. The current state of the SecretVersion.
   853  	//
   854  	// Possible values:
   855  	//   "STATE_UNSPECIFIED" - Not specified. This value is unused and invalid.
   856  	//   "ENABLED" - The SecretVersion may be accessed.
   857  	//   "DISABLED" - The SecretVersion may not be accessed, but the secret data is
   858  	// still available and can be placed back into the ENABLED state.
   859  	//   "DESTROYED" - The SecretVersion is destroyed and the secret data is no
   860  	// longer stored. A version may not leave this state once entered.
   861  	State string `json:"state,omitempty"`
   862  
   863  	// ServerResponse contains the HTTP response code and headers from the server.
   864  	googleapi.ServerResponse `json:"-"`
   865  	// ForceSendFields is a list of field names (e.g. "CreateTime") to
   866  	// unconditionally include in API requests. By default, fields with empty or
   867  	// default values are omitted from API requests. See
   868  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   869  	// details.
   870  	ForceSendFields []string `json:"-"`
   871  	// NullFields is a list of field names (e.g. "CreateTime") to include in API
   872  	// requests with the JSON null value. By default, fields with empty values are
   873  	// omitted from API requests. See
   874  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   875  	NullFields []string `json:"-"`
   876  }
   877  
   878  func (s *SecretVersion) MarshalJSON() ([]byte, error) {
   879  	type NoMethod SecretVersion
   880  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   881  }
   882  
   883  // SetIamPolicyRequest: Request message for `SetIamPolicy` method.
   884  type SetIamPolicyRequest struct {
   885  	// Policy: REQUIRED: The complete policy to be applied to the `resource`. The
   886  	// size of the policy is limited to a few 10s of KB. An empty policy is a valid
   887  	// policy but certain Google Cloud services (such as Projects) might reject
   888  	// them.
   889  	Policy *Policy `json:"policy,omitempty"`
   890  	// UpdateMask: OPTIONAL: A FieldMask specifying which fields of the policy to
   891  	// modify. Only the fields in the mask will be modified. If no mask is
   892  	// provided, the following default mask is used: `paths: "bindings, etag"
   893  	UpdateMask string `json:"updateMask,omitempty"`
   894  	// ForceSendFields is a list of field names (e.g. "Policy") to unconditionally
   895  	// include in API requests. By default, fields with empty or default values are
   896  	// omitted from API requests. See
   897  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   898  	// details.
   899  	ForceSendFields []string `json:"-"`
   900  	// NullFields is a list of field names (e.g. "Policy") to include in API
   901  	// requests with the JSON null value. By default, fields with empty values are
   902  	// omitted from API requests. See
   903  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   904  	NullFields []string `json:"-"`
   905  }
   906  
   907  func (s *SetIamPolicyRequest) MarshalJSON() ([]byte, error) {
   908  	type NoMethod SetIamPolicyRequest
   909  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   910  }
   911  
   912  // TestIamPermissionsRequest: Request message for `TestIamPermissions` method.
   913  type TestIamPermissionsRequest struct {
   914  	// Permissions: The set of permissions to check for the `resource`. Permissions
   915  	// with wildcards (such as `*` or `storage.*`) are not allowed. For more
   916  	// information see IAM Overview
   917  	// (https://cloud.google.com/iam/docs/overview#permissions).
   918  	Permissions []string `json:"permissions,omitempty"`
   919  	// ForceSendFields is a list of field names (e.g. "Permissions") to
   920  	// unconditionally include in API requests. By default, fields with empty or
   921  	// default values are omitted from API requests. See
   922  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   923  	// details.
   924  	ForceSendFields []string `json:"-"`
   925  	// NullFields is a list of field names (e.g. "Permissions") to include in API
   926  	// requests with the JSON null value. By default, fields with empty values are
   927  	// omitted from API requests. See
   928  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   929  	NullFields []string `json:"-"`
   930  }
   931  
   932  func (s *TestIamPermissionsRequest) MarshalJSON() ([]byte, error) {
   933  	type NoMethod TestIamPermissionsRequest
   934  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   935  }
   936  
   937  // TestIamPermissionsResponse: Response message for `TestIamPermissions`
   938  // method.
   939  type TestIamPermissionsResponse struct {
   940  	// Permissions: A subset of `TestPermissionsRequest.permissions` that the
   941  	// caller is allowed.
   942  	Permissions []string `json:"permissions,omitempty"`
   943  
   944  	// ServerResponse contains the HTTP response code and headers from the server.
   945  	googleapi.ServerResponse `json:"-"`
   946  	// ForceSendFields is a list of field names (e.g. "Permissions") to
   947  	// unconditionally include in API requests. By default, fields with empty or
   948  	// default values are omitted from API requests. See
   949  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   950  	// details.
   951  	ForceSendFields []string `json:"-"`
   952  	// NullFields is a list of field names (e.g. "Permissions") to include in API
   953  	// requests with the JSON null value. By default, fields with empty values are
   954  	// omitted from API requests. See
   955  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   956  	NullFields []string `json:"-"`
   957  }
   958  
   959  func (s *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) {
   960  	type NoMethod TestIamPermissionsResponse
   961  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   962  }
   963  
   964  // UserManaged: A replication policy that replicates the Secret payload into
   965  // the locations specified in Secret.replication.user_managed.replicas
   966  type UserManaged struct {
   967  	// Replicas: Required. The list of Replicas for this Secret. Cannot be empty.
   968  	Replicas []*Replica `json:"replicas,omitempty"`
   969  	// ForceSendFields is a list of field names (e.g. "Replicas") to
   970  	// unconditionally include in API requests. By default, fields with empty or
   971  	// default values are omitted from API requests. See
   972  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   973  	// details.
   974  	ForceSendFields []string `json:"-"`
   975  	// NullFields is a list of field names (e.g. "Replicas") to include in API
   976  	// requests with the JSON null value. By default, fields with empty values are
   977  	// omitted from API requests. See
   978  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   979  	NullFields []string `json:"-"`
   980  }
   981  
   982  func (s *UserManaged) MarshalJSON() ([]byte, error) {
   983  	type NoMethod UserManaged
   984  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   985  }
   986  
   987  type ProjectsLocationsGetCall struct {
   988  	s            *Service
   989  	name         string
   990  	urlParams_   gensupport.URLParams
   991  	ifNoneMatch_ string
   992  	ctx_         context.Context
   993  	header_      http.Header
   994  }
   995  
   996  // Get: Gets information about a location.
   997  //
   998  // - name: Resource name for the location.
   999  func (r *ProjectsLocationsService) Get(name string) *ProjectsLocationsGetCall {
  1000  	c := &ProjectsLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1001  	c.name = name
  1002  	return c
  1003  }
  1004  
  1005  // Fields allows partial responses to be retrieved. See
  1006  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1007  // details.
  1008  func (c *ProjectsLocationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGetCall {
  1009  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1010  	return c
  1011  }
  1012  
  1013  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1014  // object's ETag matches the given value. This is useful for getting updates
  1015  // only after the object has changed since the last request.
  1016  func (c *ProjectsLocationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGetCall {
  1017  	c.ifNoneMatch_ = entityTag
  1018  	return c
  1019  }
  1020  
  1021  // Context sets the context to be used in this call's Do method.
  1022  func (c *ProjectsLocationsGetCall) Context(ctx context.Context) *ProjectsLocationsGetCall {
  1023  	c.ctx_ = ctx
  1024  	return c
  1025  }
  1026  
  1027  // Header returns a http.Header that can be modified by the caller to add
  1028  // headers to the request.
  1029  func (c *ProjectsLocationsGetCall) Header() http.Header {
  1030  	if c.header_ == nil {
  1031  		c.header_ = make(http.Header)
  1032  	}
  1033  	return c.header_
  1034  }
  1035  
  1036  func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) {
  1037  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1038  	if c.ifNoneMatch_ != "" {
  1039  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1040  	}
  1041  	var body io.Reader = nil
  1042  	c.urlParams_.Set("alt", alt)
  1043  	c.urlParams_.Set("prettyPrint", "false")
  1044  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  1045  	urls += "?" + c.urlParams_.Encode()
  1046  	req, err := http.NewRequest("GET", urls, body)
  1047  	if err != nil {
  1048  		return nil, err
  1049  	}
  1050  	req.Header = reqHeaders
  1051  	googleapi.Expand(req.URL, map[string]string{
  1052  		"name": c.name,
  1053  	})
  1054  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1055  }
  1056  
  1057  // Do executes the "secretmanager.projects.locations.get" call.
  1058  // Any non-2xx status code is an error. Response headers are in either
  1059  // *Location.ServerResponse.Header or (if a response was returned at all) in
  1060  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1061  // whether the returned error was because http.StatusNotModified was returned.
  1062  func (c *ProjectsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) {
  1063  	gensupport.SetOptions(c.urlParams_, opts...)
  1064  	res, err := c.doRequest("json")
  1065  	if res != nil && res.StatusCode == http.StatusNotModified {
  1066  		if res.Body != nil {
  1067  			res.Body.Close()
  1068  		}
  1069  		return nil, gensupport.WrapError(&googleapi.Error{
  1070  			Code:   res.StatusCode,
  1071  			Header: res.Header,
  1072  		})
  1073  	}
  1074  	if err != nil {
  1075  		return nil, err
  1076  	}
  1077  	defer googleapi.CloseBody(res)
  1078  	if err := googleapi.CheckResponse(res); err != nil {
  1079  		return nil, gensupport.WrapError(err)
  1080  	}
  1081  	ret := &Location{
  1082  		ServerResponse: googleapi.ServerResponse{
  1083  			Header:         res.Header,
  1084  			HTTPStatusCode: res.StatusCode,
  1085  		},
  1086  	}
  1087  	target := &ret
  1088  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1089  		return nil, err
  1090  	}
  1091  	return ret, nil
  1092  }
  1093  
  1094  type ProjectsLocationsListCall struct {
  1095  	s            *Service
  1096  	name         string
  1097  	urlParams_   gensupport.URLParams
  1098  	ifNoneMatch_ string
  1099  	ctx_         context.Context
  1100  	header_      http.Header
  1101  }
  1102  
  1103  // List: Lists information about the supported locations for this service.
  1104  //
  1105  // - name: The resource that owns the locations collection, if applicable.
  1106  func (r *ProjectsLocationsService) List(name string) *ProjectsLocationsListCall {
  1107  	c := &ProjectsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1108  	c.name = name
  1109  	return c
  1110  }
  1111  
  1112  // Filter sets the optional parameter "filter": A filter to narrow down results
  1113  // to a preferred subset. The filtering language accepts strings like
  1114  // "displayName=tokyo", and is documented in more detail in AIP-160
  1115  // (https://google.aip.dev/160).
  1116  func (c *ProjectsLocationsListCall) Filter(filter string) *ProjectsLocationsListCall {
  1117  	c.urlParams_.Set("filter", filter)
  1118  	return c
  1119  }
  1120  
  1121  // PageSize sets the optional parameter "pageSize": The maximum number of
  1122  // results to return. If not set, the service selects a default.
  1123  func (c *ProjectsLocationsListCall) PageSize(pageSize int64) *ProjectsLocationsListCall {
  1124  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  1125  	return c
  1126  }
  1127  
  1128  // PageToken sets the optional parameter "pageToken": A page token received
  1129  // from the `next_page_token` field in the response. Send that page token to
  1130  // receive the subsequent page.
  1131  func (c *ProjectsLocationsListCall) PageToken(pageToken string) *ProjectsLocationsListCall {
  1132  	c.urlParams_.Set("pageToken", pageToken)
  1133  	return c
  1134  }
  1135  
  1136  // Fields allows partial responses to be retrieved. See
  1137  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1138  // details.
  1139  func (c *ProjectsLocationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsListCall {
  1140  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1141  	return c
  1142  }
  1143  
  1144  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1145  // object's ETag matches the given value. This is useful for getting updates
  1146  // only after the object has changed since the last request.
  1147  func (c *ProjectsLocationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsListCall {
  1148  	c.ifNoneMatch_ = entityTag
  1149  	return c
  1150  }
  1151  
  1152  // Context sets the context to be used in this call's Do method.
  1153  func (c *ProjectsLocationsListCall) Context(ctx context.Context) *ProjectsLocationsListCall {
  1154  	c.ctx_ = ctx
  1155  	return c
  1156  }
  1157  
  1158  // Header returns a http.Header that can be modified by the caller to add
  1159  // headers to the request.
  1160  func (c *ProjectsLocationsListCall) Header() http.Header {
  1161  	if c.header_ == nil {
  1162  		c.header_ = make(http.Header)
  1163  	}
  1164  	return c.header_
  1165  }
  1166  
  1167  func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error) {
  1168  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1169  	if c.ifNoneMatch_ != "" {
  1170  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1171  	}
  1172  	var body io.Reader = nil
  1173  	c.urlParams_.Set("alt", alt)
  1174  	c.urlParams_.Set("prettyPrint", "false")
  1175  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/locations")
  1176  	urls += "?" + c.urlParams_.Encode()
  1177  	req, err := http.NewRequest("GET", urls, body)
  1178  	if err != nil {
  1179  		return nil, err
  1180  	}
  1181  	req.Header = reqHeaders
  1182  	googleapi.Expand(req.URL, map[string]string{
  1183  		"name": c.name,
  1184  	})
  1185  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1186  }
  1187  
  1188  // Do executes the "secretmanager.projects.locations.list" call.
  1189  // Any non-2xx status code is an error. Response headers are in either
  1190  // *ListLocationsResponse.ServerResponse.Header or (if a response was returned
  1191  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1192  // check whether the returned error was because http.StatusNotModified was
  1193  // returned.
  1194  func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) {
  1195  	gensupport.SetOptions(c.urlParams_, opts...)
  1196  	res, err := c.doRequest("json")
  1197  	if res != nil && res.StatusCode == http.StatusNotModified {
  1198  		if res.Body != nil {
  1199  			res.Body.Close()
  1200  		}
  1201  		return nil, gensupport.WrapError(&googleapi.Error{
  1202  			Code:   res.StatusCode,
  1203  			Header: res.Header,
  1204  		})
  1205  	}
  1206  	if err != nil {
  1207  		return nil, err
  1208  	}
  1209  	defer googleapi.CloseBody(res)
  1210  	if err := googleapi.CheckResponse(res); err != nil {
  1211  		return nil, gensupport.WrapError(err)
  1212  	}
  1213  	ret := &ListLocationsResponse{
  1214  		ServerResponse: googleapi.ServerResponse{
  1215  			Header:         res.Header,
  1216  			HTTPStatusCode: res.StatusCode,
  1217  		},
  1218  	}
  1219  	target := &ret
  1220  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1221  		return nil, err
  1222  	}
  1223  	return ret, nil
  1224  }
  1225  
  1226  // Pages invokes f for each page of results.
  1227  // A non-nil error returned from f will halt the iteration.
  1228  // The provided context supersedes any context provided to the Context method.
  1229  func (c *ProjectsLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error {
  1230  	c.ctx_ = ctx
  1231  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  1232  	for {
  1233  		x, err := c.Do()
  1234  		if err != nil {
  1235  			return err
  1236  		}
  1237  		if err := f(x); err != nil {
  1238  			return err
  1239  		}
  1240  		if x.NextPageToken == "" {
  1241  			return nil
  1242  		}
  1243  		c.PageToken(x.NextPageToken)
  1244  	}
  1245  }
  1246  
  1247  type ProjectsSecretsAddVersionCall struct {
  1248  	s                       *Service
  1249  	parent                  string
  1250  	addsecretversionrequest *AddSecretVersionRequest
  1251  	urlParams_              gensupport.URLParams
  1252  	ctx_                    context.Context
  1253  	header_                 http.Header
  1254  }
  1255  
  1256  // AddVersion: Creates a new SecretVersion containing secret data and attaches
  1257  // it to an existing Secret.
  1258  //
  1259  //   - parent: The resource name of the Secret to associate with the
  1260  //     SecretVersion in the format `projects/*/secrets/*`.
  1261  func (r *ProjectsSecretsService) AddVersion(parent string, addsecretversionrequest *AddSecretVersionRequest) *ProjectsSecretsAddVersionCall {
  1262  	c := &ProjectsSecretsAddVersionCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1263  	c.parent = parent
  1264  	c.addsecretversionrequest = addsecretversionrequest
  1265  	return c
  1266  }
  1267  
  1268  // Fields allows partial responses to be retrieved. See
  1269  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1270  // details.
  1271  func (c *ProjectsSecretsAddVersionCall) Fields(s ...googleapi.Field) *ProjectsSecretsAddVersionCall {
  1272  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1273  	return c
  1274  }
  1275  
  1276  // Context sets the context to be used in this call's Do method.
  1277  func (c *ProjectsSecretsAddVersionCall) Context(ctx context.Context) *ProjectsSecretsAddVersionCall {
  1278  	c.ctx_ = ctx
  1279  	return c
  1280  }
  1281  
  1282  // Header returns a http.Header that can be modified by the caller to add
  1283  // headers to the request.
  1284  func (c *ProjectsSecretsAddVersionCall) Header() http.Header {
  1285  	if c.header_ == nil {
  1286  		c.header_ = make(http.Header)
  1287  	}
  1288  	return c.header_
  1289  }
  1290  
  1291  func (c *ProjectsSecretsAddVersionCall) doRequest(alt string) (*http.Response, error) {
  1292  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1293  	var body io.Reader = nil
  1294  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.addsecretversionrequest)
  1295  	if err != nil {
  1296  		return nil, err
  1297  	}
  1298  	c.urlParams_.Set("alt", alt)
  1299  	c.urlParams_.Set("prettyPrint", "false")
  1300  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}:addVersion")
  1301  	urls += "?" + c.urlParams_.Encode()
  1302  	req, err := http.NewRequest("POST", urls, body)
  1303  	if err != nil {
  1304  		return nil, err
  1305  	}
  1306  	req.Header = reqHeaders
  1307  	googleapi.Expand(req.URL, map[string]string{
  1308  		"parent": c.parent,
  1309  	})
  1310  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1311  }
  1312  
  1313  // Do executes the "secretmanager.projects.secrets.addVersion" call.
  1314  // Any non-2xx status code is an error. Response headers are in either
  1315  // *SecretVersion.ServerResponse.Header or (if a response was returned at all)
  1316  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1317  // whether the returned error was because http.StatusNotModified was returned.
  1318  func (c *ProjectsSecretsAddVersionCall) Do(opts ...googleapi.CallOption) (*SecretVersion, error) {
  1319  	gensupport.SetOptions(c.urlParams_, opts...)
  1320  	res, err := c.doRequest("json")
  1321  	if res != nil && res.StatusCode == http.StatusNotModified {
  1322  		if res.Body != nil {
  1323  			res.Body.Close()
  1324  		}
  1325  		return nil, gensupport.WrapError(&googleapi.Error{
  1326  			Code:   res.StatusCode,
  1327  			Header: res.Header,
  1328  		})
  1329  	}
  1330  	if err != nil {
  1331  		return nil, err
  1332  	}
  1333  	defer googleapi.CloseBody(res)
  1334  	if err := googleapi.CheckResponse(res); err != nil {
  1335  		return nil, gensupport.WrapError(err)
  1336  	}
  1337  	ret := &SecretVersion{
  1338  		ServerResponse: googleapi.ServerResponse{
  1339  			Header:         res.Header,
  1340  			HTTPStatusCode: res.StatusCode,
  1341  		},
  1342  	}
  1343  	target := &ret
  1344  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1345  		return nil, err
  1346  	}
  1347  	return ret, nil
  1348  }
  1349  
  1350  type ProjectsSecretsCreateCall struct {
  1351  	s          *Service
  1352  	parent     string
  1353  	secret     *Secret
  1354  	urlParams_ gensupport.URLParams
  1355  	ctx_       context.Context
  1356  	header_    http.Header
  1357  }
  1358  
  1359  // Create: Creates a new Secret containing no SecretVersions.
  1360  //
  1361  //   - parent: The resource name of the project to associate with the Secret, in
  1362  //     the format `projects/*`.
  1363  func (r *ProjectsSecretsService) Create(parent string, secret *Secret) *ProjectsSecretsCreateCall {
  1364  	c := &ProjectsSecretsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1365  	c.parent = parent
  1366  	c.secret = secret
  1367  	return c
  1368  }
  1369  
  1370  // SecretId sets the optional parameter "secretId": Required. This must be
  1371  // unique within the project. A secret ID is a string with a maximum length of
  1372  // 255 characters and can contain uppercase and lowercase letters, numerals,
  1373  // and the hyphen (`-`) and underscore (`_`) characters.
  1374  func (c *ProjectsSecretsCreateCall) SecretId(secretId string) *ProjectsSecretsCreateCall {
  1375  	c.urlParams_.Set("secretId", secretId)
  1376  	return c
  1377  }
  1378  
  1379  // Fields allows partial responses to be retrieved. See
  1380  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1381  // details.
  1382  func (c *ProjectsSecretsCreateCall) Fields(s ...googleapi.Field) *ProjectsSecretsCreateCall {
  1383  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1384  	return c
  1385  }
  1386  
  1387  // Context sets the context to be used in this call's Do method.
  1388  func (c *ProjectsSecretsCreateCall) Context(ctx context.Context) *ProjectsSecretsCreateCall {
  1389  	c.ctx_ = ctx
  1390  	return c
  1391  }
  1392  
  1393  // Header returns a http.Header that can be modified by the caller to add
  1394  // headers to the request.
  1395  func (c *ProjectsSecretsCreateCall) Header() http.Header {
  1396  	if c.header_ == nil {
  1397  		c.header_ = make(http.Header)
  1398  	}
  1399  	return c.header_
  1400  }
  1401  
  1402  func (c *ProjectsSecretsCreateCall) doRequest(alt string) (*http.Response, error) {
  1403  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1404  	var body io.Reader = nil
  1405  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.secret)
  1406  	if err != nil {
  1407  		return nil, err
  1408  	}
  1409  	c.urlParams_.Set("alt", alt)
  1410  	c.urlParams_.Set("prettyPrint", "false")
  1411  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/secrets")
  1412  	urls += "?" + c.urlParams_.Encode()
  1413  	req, err := http.NewRequest("POST", urls, body)
  1414  	if err != nil {
  1415  		return nil, err
  1416  	}
  1417  	req.Header = reqHeaders
  1418  	googleapi.Expand(req.URL, map[string]string{
  1419  		"parent": c.parent,
  1420  	})
  1421  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1422  }
  1423  
  1424  // Do executes the "secretmanager.projects.secrets.create" call.
  1425  // Any non-2xx status code is an error. Response headers are in either
  1426  // *Secret.ServerResponse.Header or (if a response was returned at all) in
  1427  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1428  // whether the returned error was because http.StatusNotModified was returned.
  1429  func (c *ProjectsSecretsCreateCall) Do(opts ...googleapi.CallOption) (*Secret, error) {
  1430  	gensupport.SetOptions(c.urlParams_, opts...)
  1431  	res, err := c.doRequest("json")
  1432  	if res != nil && res.StatusCode == http.StatusNotModified {
  1433  		if res.Body != nil {
  1434  			res.Body.Close()
  1435  		}
  1436  		return nil, gensupport.WrapError(&googleapi.Error{
  1437  			Code:   res.StatusCode,
  1438  			Header: res.Header,
  1439  		})
  1440  	}
  1441  	if err != nil {
  1442  		return nil, err
  1443  	}
  1444  	defer googleapi.CloseBody(res)
  1445  	if err := googleapi.CheckResponse(res); err != nil {
  1446  		return nil, gensupport.WrapError(err)
  1447  	}
  1448  	ret := &Secret{
  1449  		ServerResponse: googleapi.ServerResponse{
  1450  			Header:         res.Header,
  1451  			HTTPStatusCode: res.StatusCode,
  1452  		},
  1453  	}
  1454  	target := &ret
  1455  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1456  		return nil, err
  1457  	}
  1458  	return ret, nil
  1459  }
  1460  
  1461  type ProjectsSecretsDeleteCall struct {
  1462  	s          *Service
  1463  	name       string
  1464  	urlParams_ gensupport.URLParams
  1465  	ctx_       context.Context
  1466  	header_    http.Header
  1467  }
  1468  
  1469  // Delete: Deletes a Secret.
  1470  //
  1471  //   - name: The resource name of the Secret to delete in the format
  1472  //     `projects/*/secrets/*`.
  1473  func (r *ProjectsSecretsService) Delete(name string) *ProjectsSecretsDeleteCall {
  1474  	c := &ProjectsSecretsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1475  	c.name = name
  1476  	return c
  1477  }
  1478  
  1479  // Fields allows partial responses to be retrieved. See
  1480  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1481  // details.
  1482  func (c *ProjectsSecretsDeleteCall) Fields(s ...googleapi.Field) *ProjectsSecretsDeleteCall {
  1483  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1484  	return c
  1485  }
  1486  
  1487  // Context sets the context to be used in this call's Do method.
  1488  func (c *ProjectsSecretsDeleteCall) Context(ctx context.Context) *ProjectsSecretsDeleteCall {
  1489  	c.ctx_ = ctx
  1490  	return c
  1491  }
  1492  
  1493  // Header returns a http.Header that can be modified by the caller to add
  1494  // headers to the request.
  1495  func (c *ProjectsSecretsDeleteCall) Header() http.Header {
  1496  	if c.header_ == nil {
  1497  		c.header_ = make(http.Header)
  1498  	}
  1499  	return c.header_
  1500  }
  1501  
  1502  func (c *ProjectsSecretsDeleteCall) doRequest(alt string) (*http.Response, error) {
  1503  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1504  	var body io.Reader = nil
  1505  	c.urlParams_.Set("alt", alt)
  1506  	c.urlParams_.Set("prettyPrint", "false")
  1507  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  1508  	urls += "?" + c.urlParams_.Encode()
  1509  	req, err := http.NewRequest("DELETE", urls, body)
  1510  	if err != nil {
  1511  		return nil, err
  1512  	}
  1513  	req.Header = reqHeaders
  1514  	googleapi.Expand(req.URL, map[string]string{
  1515  		"name": c.name,
  1516  	})
  1517  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1518  }
  1519  
  1520  // Do executes the "secretmanager.projects.secrets.delete" call.
  1521  // Any non-2xx status code is an error. Response headers are in either
  1522  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  1523  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1524  // whether the returned error was because http.StatusNotModified was returned.
  1525  func (c *ProjectsSecretsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  1526  	gensupport.SetOptions(c.urlParams_, opts...)
  1527  	res, err := c.doRequest("json")
  1528  	if res != nil && res.StatusCode == http.StatusNotModified {
  1529  		if res.Body != nil {
  1530  			res.Body.Close()
  1531  		}
  1532  		return nil, gensupport.WrapError(&googleapi.Error{
  1533  			Code:   res.StatusCode,
  1534  			Header: res.Header,
  1535  		})
  1536  	}
  1537  	if err != nil {
  1538  		return nil, err
  1539  	}
  1540  	defer googleapi.CloseBody(res)
  1541  	if err := googleapi.CheckResponse(res); err != nil {
  1542  		return nil, gensupport.WrapError(err)
  1543  	}
  1544  	ret := &Empty{
  1545  		ServerResponse: googleapi.ServerResponse{
  1546  			Header:         res.Header,
  1547  			HTTPStatusCode: res.StatusCode,
  1548  		},
  1549  	}
  1550  	target := &ret
  1551  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1552  		return nil, err
  1553  	}
  1554  	return ret, nil
  1555  }
  1556  
  1557  type ProjectsSecretsGetCall struct {
  1558  	s            *Service
  1559  	name         string
  1560  	urlParams_   gensupport.URLParams
  1561  	ifNoneMatch_ string
  1562  	ctx_         context.Context
  1563  	header_      http.Header
  1564  }
  1565  
  1566  // Get: Gets metadata for a given Secret.
  1567  //
  1568  //   - name: The resource name of the Secret, in the format
  1569  //     `projects/*/secrets/*`.
  1570  func (r *ProjectsSecretsService) Get(name string) *ProjectsSecretsGetCall {
  1571  	c := &ProjectsSecretsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1572  	c.name = name
  1573  	return c
  1574  }
  1575  
  1576  // Fields allows partial responses to be retrieved. See
  1577  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1578  // details.
  1579  func (c *ProjectsSecretsGetCall) Fields(s ...googleapi.Field) *ProjectsSecretsGetCall {
  1580  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1581  	return c
  1582  }
  1583  
  1584  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1585  // object's ETag matches the given value. This is useful for getting updates
  1586  // only after the object has changed since the last request.
  1587  func (c *ProjectsSecretsGetCall) IfNoneMatch(entityTag string) *ProjectsSecretsGetCall {
  1588  	c.ifNoneMatch_ = entityTag
  1589  	return c
  1590  }
  1591  
  1592  // Context sets the context to be used in this call's Do method.
  1593  func (c *ProjectsSecretsGetCall) Context(ctx context.Context) *ProjectsSecretsGetCall {
  1594  	c.ctx_ = ctx
  1595  	return c
  1596  }
  1597  
  1598  // Header returns a http.Header that can be modified by the caller to add
  1599  // headers to the request.
  1600  func (c *ProjectsSecretsGetCall) Header() http.Header {
  1601  	if c.header_ == nil {
  1602  		c.header_ = make(http.Header)
  1603  	}
  1604  	return c.header_
  1605  }
  1606  
  1607  func (c *ProjectsSecretsGetCall) doRequest(alt string) (*http.Response, error) {
  1608  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1609  	if c.ifNoneMatch_ != "" {
  1610  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1611  	}
  1612  	var body io.Reader = nil
  1613  	c.urlParams_.Set("alt", alt)
  1614  	c.urlParams_.Set("prettyPrint", "false")
  1615  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  1616  	urls += "?" + c.urlParams_.Encode()
  1617  	req, err := http.NewRequest("GET", urls, body)
  1618  	if err != nil {
  1619  		return nil, err
  1620  	}
  1621  	req.Header = reqHeaders
  1622  	googleapi.Expand(req.URL, map[string]string{
  1623  		"name": c.name,
  1624  	})
  1625  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1626  }
  1627  
  1628  // Do executes the "secretmanager.projects.secrets.get" call.
  1629  // Any non-2xx status code is an error. Response headers are in either
  1630  // *Secret.ServerResponse.Header or (if a response was returned at all) in
  1631  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1632  // whether the returned error was because http.StatusNotModified was returned.
  1633  func (c *ProjectsSecretsGetCall) Do(opts ...googleapi.CallOption) (*Secret, error) {
  1634  	gensupport.SetOptions(c.urlParams_, opts...)
  1635  	res, err := c.doRequest("json")
  1636  	if res != nil && res.StatusCode == http.StatusNotModified {
  1637  		if res.Body != nil {
  1638  			res.Body.Close()
  1639  		}
  1640  		return nil, gensupport.WrapError(&googleapi.Error{
  1641  			Code:   res.StatusCode,
  1642  			Header: res.Header,
  1643  		})
  1644  	}
  1645  	if err != nil {
  1646  		return nil, err
  1647  	}
  1648  	defer googleapi.CloseBody(res)
  1649  	if err := googleapi.CheckResponse(res); err != nil {
  1650  		return nil, gensupport.WrapError(err)
  1651  	}
  1652  	ret := &Secret{
  1653  		ServerResponse: googleapi.ServerResponse{
  1654  			Header:         res.Header,
  1655  			HTTPStatusCode: res.StatusCode,
  1656  		},
  1657  	}
  1658  	target := &ret
  1659  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1660  		return nil, err
  1661  	}
  1662  	return ret, nil
  1663  }
  1664  
  1665  type ProjectsSecretsGetIamPolicyCall struct {
  1666  	s            *Service
  1667  	resource     string
  1668  	urlParams_   gensupport.URLParams
  1669  	ifNoneMatch_ string
  1670  	ctx_         context.Context
  1671  	header_      http.Header
  1672  }
  1673  
  1674  // GetIamPolicy: Gets the access control policy for a secret. Returns empty
  1675  // policy if the secret exists and does not have a policy set.
  1676  //
  1677  //   - resource: REQUIRED: The resource for which the policy is being requested.
  1678  //     See Resource names (https://cloud.google.com/apis/design/resource_names)
  1679  //     for the appropriate value for this field.
  1680  func (r *ProjectsSecretsService) GetIamPolicy(resource string) *ProjectsSecretsGetIamPolicyCall {
  1681  	c := &ProjectsSecretsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1682  	c.resource = resource
  1683  	return c
  1684  }
  1685  
  1686  // OptionsRequestedPolicyVersion sets the optional parameter
  1687  // "options.requestedPolicyVersion": The maximum policy version that will be
  1688  // used to format the policy. Valid values are 0, 1, and 3. Requests specifying
  1689  // an invalid value will be rejected. Requests for policies with any
  1690  // conditional role bindings must specify version 3. Policies with no
  1691  // conditional role bindings may specify any valid value or leave the field
  1692  // unset. The policy in the response might use the policy version that you
  1693  // specified, or it might use a lower policy version. For example, if you
  1694  // specify version 3, but the policy has no conditional role bindings, the
  1695  // response uses version 1. To learn which resources support conditions in
  1696  // their IAM policies, see the IAM documentation
  1697  // (https://cloud.google.com/iam/help/conditions/resource-policies).
  1698  func (c *ProjectsSecretsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsSecretsGetIamPolicyCall {
  1699  	c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
  1700  	return c
  1701  }
  1702  
  1703  // Fields allows partial responses to be retrieved. See
  1704  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1705  // details.
  1706  func (c *ProjectsSecretsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsSecretsGetIamPolicyCall {
  1707  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1708  	return c
  1709  }
  1710  
  1711  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1712  // object's ETag matches the given value. This is useful for getting updates
  1713  // only after the object has changed since the last request.
  1714  func (c *ProjectsSecretsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsSecretsGetIamPolicyCall {
  1715  	c.ifNoneMatch_ = entityTag
  1716  	return c
  1717  }
  1718  
  1719  // Context sets the context to be used in this call's Do method.
  1720  func (c *ProjectsSecretsGetIamPolicyCall) Context(ctx context.Context) *ProjectsSecretsGetIamPolicyCall {
  1721  	c.ctx_ = ctx
  1722  	return c
  1723  }
  1724  
  1725  // Header returns a http.Header that can be modified by the caller to add
  1726  // headers to the request.
  1727  func (c *ProjectsSecretsGetIamPolicyCall) Header() http.Header {
  1728  	if c.header_ == nil {
  1729  		c.header_ = make(http.Header)
  1730  	}
  1731  	return c.header_
  1732  }
  1733  
  1734  func (c *ProjectsSecretsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  1735  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1736  	if c.ifNoneMatch_ != "" {
  1737  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1738  	}
  1739  	var body io.Reader = nil
  1740  	c.urlParams_.Set("alt", alt)
  1741  	c.urlParams_.Set("prettyPrint", "false")
  1742  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:getIamPolicy")
  1743  	urls += "?" + c.urlParams_.Encode()
  1744  	req, err := http.NewRequest("GET", urls, body)
  1745  	if err != nil {
  1746  		return nil, err
  1747  	}
  1748  	req.Header = reqHeaders
  1749  	googleapi.Expand(req.URL, map[string]string{
  1750  		"resource": c.resource,
  1751  	})
  1752  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1753  }
  1754  
  1755  // Do executes the "secretmanager.projects.secrets.getIamPolicy" call.
  1756  // Any non-2xx status code is an error. Response headers are in either
  1757  // *Policy.ServerResponse.Header or (if a response was returned at all) in
  1758  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1759  // whether the returned error was because http.StatusNotModified was returned.
  1760  func (c *ProjectsSecretsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  1761  	gensupport.SetOptions(c.urlParams_, opts...)
  1762  	res, err := c.doRequest("json")
  1763  	if res != nil && res.StatusCode == http.StatusNotModified {
  1764  		if res.Body != nil {
  1765  			res.Body.Close()
  1766  		}
  1767  		return nil, gensupport.WrapError(&googleapi.Error{
  1768  			Code:   res.StatusCode,
  1769  			Header: res.Header,
  1770  		})
  1771  	}
  1772  	if err != nil {
  1773  		return nil, err
  1774  	}
  1775  	defer googleapi.CloseBody(res)
  1776  	if err := googleapi.CheckResponse(res); err != nil {
  1777  		return nil, gensupport.WrapError(err)
  1778  	}
  1779  	ret := &Policy{
  1780  		ServerResponse: googleapi.ServerResponse{
  1781  			Header:         res.Header,
  1782  			HTTPStatusCode: res.StatusCode,
  1783  		},
  1784  	}
  1785  	target := &ret
  1786  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1787  		return nil, err
  1788  	}
  1789  	return ret, nil
  1790  }
  1791  
  1792  type ProjectsSecretsListCall struct {
  1793  	s            *Service
  1794  	parent       string
  1795  	urlParams_   gensupport.URLParams
  1796  	ifNoneMatch_ string
  1797  	ctx_         context.Context
  1798  	header_      http.Header
  1799  }
  1800  
  1801  // List: Lists Secrets.
  1802  //
  1803  //   - parent: The resource name of the project associated with the Secrets, in
  1804  //     the format `projects/*`.
  1805  func (r *ProjectsSecretsService) List(parent string) *ProjectsSecretsListCall {
  1806  	c := &ProjectsSecretsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1807  	c.parent = parent
  1808  	return c
  1809  }
  1810  
  1811  // PageSize sets the optional parameter "pageSize": The maximum number of
  1812  // results to be returned in a single page. If set to 0, the server decides the
  1813  // number of results to return. If the number is greater than 25000, it is
  1814  // capped at 25000.
  1815  func (c *ProjectsSecretsListCall) PageSize(pageSize int64) *ProjectsSecretsListCall {
  1816  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  1817  	return c
  1818  }
  1819  
  1820  // PageToken sets the optional parameter "pageToken": Pagination token,
  1821  // returned earlier via ListSecretsResponse.next_page_token.
  1822  func (c *ProjectsSecretsListCall) PageToken(pageToken string) *ProjectsSecretsListCall {
  1823  	c.urlParams_.Set("pageToken", pageToken)
  1824  	return c
  1825  }
  1826  
  1827  // Fields allows partial responses to be retrieved. See
  1828  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1829  // details.
  1830  func (c *ProjectsSecretsListCall) Fields(s ...googleapi.Field) *ProjectsSecretsListCall {
  1831  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1832  	return c
  1833  }
  1834  
  1835  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1836  // object's ETag matches the given value. This is useful for getting updates
  1837  // only after the object has changed since the last request.
  1838  func (c *ProjectsSecretsListCall) IfNoneMatch(entityTag string) *ProjectsSecretsListCall {
  1839  	c.ifNoneMatch_ = entityTag
  1840  	return c
  1841  }
  1842  
  1843  // Context sets the context to be used in this call's Do method.
  1844  func (c *ProjectsSecretsListCall) Context(ctx context.Context) *ProjectsSecretsListCall {
  1845  	c.ctx_ = ctx
  1846  	return c
  1847  }
  1848  
  1849  // Header returns a http.Header that can be modified by the caller to add
  1850  // headers to the request.
  1851  func (c *ProjectsSecretsListCall) Header() http.Header {
  1852  	if c.header_ == nil {
  1853  		c.header_ = make(http.Header)
  1854  	}
  1855  	return c.header_
  1856  }
  1857  
  1858  func (c *ProjectsSecretsListCall) doRequest(alt string) (*http.Response, error) {
  1859  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1860  	if c.ifNoneMatch_ != "" {
  1861  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1862  	}
  1863  	var body io.Reader = nil
  1864  	c.urlParams_.Set("alt", alt)
  1865  	c.urlParams_.Set("prettyPrint", "false")
  1866  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/secrets")
  1867  	urls += "?" + c.urlParams_.Encode()
  1868  	req, err := http.NewRequest("GET", urls, body)
  1869  	if err != nil {
  1870  		return nil, err
  1871  	}
  1872  	req.Header = reqHeaders
  1873  	googleapi.Expand(req.URL, map[string]string{
  1874  		"parent": c.parent,
  1875  	})
  1876  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1877  }
  1878  
  1879  // Do executes the "secretmanager.projects.secrets.list" call.
  1880  // Any non-2xx status code is an error. Response headers are in either
  1881  // *ListSecretsResponse.ServerResponse.Header or (if a response was returned at
  1882  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1883  // check whether the returned error was because http.StatusNotModified was
  1884  // returned.
  1885  func (c *ProjectsSecretsListCall) Do(opts ...googleapi.CallOption) (*ListSecretsResponse, error) {
  1886  	gensupport.SetOptions(c.urlParams_, opts...)
  1887  	res, err := c.doRequest("json")
  1888  	if res != nil && res.StatusCode == http.StatusNotModified {
  1889  		if res.Body != nil {
  1890  			res.Body.Close()
  1891  		}
  1892  		return nil, gensupport.WrapError(&googleapi.Error{
  1893  			Code:   res.StatusCode,
  1894  			Header: res.Header,
  1895  		})
  1896  	}
  1897  	if err != nil {
  1898  		return nil, err
  1899  	}
  1900  	defer googleapi.CloseBody(res)
  1901  	if err := googleapi.CheckResponse(res); err != nil {
  1902  		return nil, gensupport.WrapError(err)
  1903  	}
  1904  	ret := &ListSecretsResponse{
  1905  		ServerResponse: googleapi.ServerResponse{
  1906  			Header:         res.Header,
  1907  			HTTPStatusCode: res.StatusCode,
  1908  		},
  1909  	}
  1910  	target := &ret
  1911  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1912  		return nil, err
  1913  	}
  1914  	return ret, nil
  1915  }
  1916  
  1917  // Pages invokes f for each page of results.
  1918  // A non-nil error returned from f will halt the iteration.
  1919  // The provided context supersedes any context provided to the Context method.
  1920  func (c *ProjectsSecretsListCall) Pages(ctx context.Context, f func(*ListSecretsResponse) error) error {
  1921  	c.ctx_ = ctx
  1922  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  1923  	for {
  1924  		x, err := c.Do()
  1925  		if err != nil {
  1926  			return err
  1927  		}
  1928  		if err := f(x); err != nil {
  1929  			return err
  1930  		}
  1931  		if x.NextPageToken == "" {
  1932  			return nil
  1933  		}
  1934  		c.PageToken(x.NextPageToken)
  1935  	}
  1936  }
  1937  
  1938  type ProjectsSecretsPatchCall struct {
  1939  	s          *Service
  1940  	name       string
  1941  	secret     *Secret
  1942  	urlParams_ gensupport.URLParams
  1943  	ctx_       context.Context
  1944  	header_    http.Header
  1945  }
  1946  
  1947  // Patch: Updates metadata of an existing Secret.
  1948  //
  1949  //   - name: Output only. The resource name of the Secret in the format
  1950  //     `projects/*/secrets/*`.
  1951  func (r *ProjectsSecretsService) Patch(name string, secret *Secret) *ProjectsSecretsPatchCall {
  1952  	c := &ProjectsSecretsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1953  	c.name = name
  1954  	c.secret = secret
  1955  	return c
  1956  }
  1957  
  1958  // UpdateMask sets the optional parameter "updateMask": Required. Specifies the
  1959  // fields to be updated.
  1960  func (c *ProjectsSecretsPatchCall) UpdateMask(updateMask string) *ProjectsSecretsPatchCall {
  1961  	c.urlParams_.Set("updateMask", updateMask)
  1962  	return c
  1963  }
  1964  
  1965  // Fields allows partial responses to be retrieved. See
  1966  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1967  // details.
  1968  func (c *ProjectsSecretsPatchCall) Fields(s ...googleapi.Field) *ProjectsSecretsPatchCall {
  1969  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1970  	return c
  1971  }
  1972  
  1973  // Context sets the context to be used in this call's Do method.
  1974  func (c *ProjectsSecretsPatchCall) Context(ctx context.Context) *ProjectsSecretsPatchCall {
  1975  	c.ctx_ = ctx
  1976  	return c
  1977  }
  1978  
  1979  // Header returns a http.Header that can be modified by the caller to add
  1980  // headers to the request.
  1981  func (c *ProjectsSecretsPatchCall) Header() http.Header {
  1982  	if c.header_ == nil {
  1983  		c.header_ = make(http.Header)
  1984  	}
  1985  	return c.header_
  1986  }
  1987  
  1988  func (c *ProjectsSecretsPatchCall) doRequest(alt string) (*http.Response, error) {
  1989  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1990  	var body io.Reader = nil
  1991  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.secret)
  1992  	if err != nil {
  1993  		return nil, err
  1994  	}
  1995  	c.urlParams_.Set("alt", alt)
  1996  	c.urlParams_.Set("prettyPrint", "false")
  1997  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  1998  	urls += "?" + c.urlParams_.Encode()
  1999  	req, err := http.NewRequest("PATCH", urls, body)
  2000  	if err != nil {
  2001  		return nil, err
  2002  	}
  2003  	req.Header = reqHeaders
  2004  	googleapi.Expand(req.URL, map[string]string{
  2005  		"name": c.name,
  2006  	})
  2007  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2008  }
  2009  
  2010  // Do executes the "secretmanager.projects.secrets.patch" call.
  2011  // Any non-2xx status code is an error. Response headers are in either
  2012  // *Secret.ServerResponse.Header or (if a response was returned at all) in
  2013  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2014  // whether the returned error was because http.StatusNotModified was returned.
  2015  func (c *ProjectsSecretsPatchCall) Do(opts ...googleapi.CallOption) (*Secret, error) {
  2016  	gensupport.SetOptions(c.urlParams_, opts...)
  2017  	res, err := c.doRequest("json")
  2018  	if res != nil && res.StatusCode == http.StatusNotModified {
  2019  		if res.Body != nil {
  2020  			res.Body.Close()
  2021  		}
  2022  		return nil, gensupport.WrapError(&googleapi.Error{
  2023  			Code:   res.StatusCode,
  2024  			Header: res.Header,
  2025  		})
  2026  	}
  2027  	if err != nil {
  2028  		return nil, err
  2029  	}
  2030  	defer googleapi.CloseBody(res)
  2031  	if err := googleapi.CheckResponse(res); err != nil {
  2032  		return nil, gensupport.WrapError(err)
  2033  	}
  2034  	ret := &Secret{
  2035  		ServerResponse: googleapi.ServerResponse{
  2036  			Header:         res.Header,
  2037  			HTTPStatusCode: res.StatusCode,
  2038  		},
  2039  	}
  2040  	target := &ret
  2041  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2042  		return nil, err
  2043  	}
  2044  	return ret, nil
  2045  }
  2046  
  2047  type ProjectsSecretsSetIamPolicyCall struct {
  2048  	s                   *Service
  2049  	resource            string
  2050  	setiampolicyrequest *SetIamPolicyRequest
  2051  	urlParams_          gensupport.URLParams
  2052  	ctx_                context.Context
  2053  	header_             http.Header
  2054  }
  2055  
  2056  // SetIamPolicy: Sets the access control policy on the specified secret.
  2057  // Replaces any existing policy. Permissions on SecretVersions are enforced
  2058  // according to the policy set on the associated Secret.
  2059  //
  2060  //   - resource: REQUIRED: The resource for which the policy is being specified.
  2061  //     See Resource names (https://cloud.google.com/apis/design/resource_names)
  2062  //     for the appropriate value for this field.
  2063  func (r *ProjectsSecretsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsSecretsSetIamPolicyCall {
  2064  	c := &ProjectsSecretsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2065  	c.resource = resource
  2066  	c.setiampolicyrequest = setiampolicyrequest
  2067  	return c
  2068  }
  2069  
  2070  // Fields allows partial responses to be retrieved. See
  2071  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2072  // details.
  2073  func (c *ProjectsSecretsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsSecretsSetIamPolicyCall {
  2074  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2075  	return c
  2076  }
  2077  
  2078  // Context sets the context to be used in this call's Do method.
  2079  func (c *ProjectsSecretsSetIamPolicyCall) Context(ctx context.Context) *ProjectsSecretsSetIamPolicyCall {
  2080  	c.ctx_ = ctx
  2081  	return c
  2082  }
  2083  
  2084  // Header returns a http.Header that can be modified by the caller to add
  2085  // headers to the request.
  2086  func (c *ProjectsSecretsSetIamPolicyCall) Header() http.Header {
  2087  	if c.header_ == nil {
  2088  		c.header_ = make(http.Header)
  2089  	}
  2090  	return c.header_
  2091  }
  2092  
  2093  func (c *ProjectsSecretsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  2094  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  2095  	var body io.Reader = nil
  2096  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
  2097  	if err != nil {
  2098  		return nil, err
  2099  	}
  2100  	c.urlParams_.Set("alt", alt)
  2101  	c.urlParams_.Set("prettyPrint", "false")
  2102  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:setIamPolicy")
  2103  	urls += "?" + c.urlParams_.Encode()
  2104  	req, err := http.NewRequest("POST", urls, body)
  2105  	if err != nil {
  2106  		return nil, err
  2107  	}
  2108  	req.Header = reqHeaders
  2109  	googleapi.Expand(req.URL, map[string]string{
  2110  		"resource": c.resource,
  2111  	})
  2112  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2113  }
  2114  
  2115  // Do executes the "secretmanager.projects.secrets.setIamPolicy" call.
  2116  // Any non-2xx status code is an error. Response headers are in either
  2117  // *Policy.ServerResponse.Header or (if a response was returned at all) in
  2118  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2119  // whether the returned error was because http.StatusNotModified was returned.
  2120  func (c *ProjectsSecretsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  2121  	gensupport.SetOptions(c.urlParams_, opts...)
  2122  	res, err := c.doRequest("json")
  2123  	if res != nil && res.StatusCode == http.StatusNotModified {
  2124  		if res.Body != nil {
  2125  			res.Body.Close()
  2126  		}
  2127  		return nil, gensupport.WrapError(&googleapi.Error{
  2128  			Code:   res.StatusCode,
  2129  			Header: res.Header,
  2130  		})
  2131  	}
  2132  	if err != nil {
  2133  		return nil, err
  2134  	}
  2135  	defer googleapi.CloseBody(res)
  2136  	if err := googleapi.CheckResponse(res); err != nil {
  2137  		return nil, gensupport.WrapError(err)
  2138  	}
  2139  	ret := &Policy{
  2140  		ServerResponse: googleapi.ServerResponse{
  2141  			Header:         res.Header,
  2142  			HTTPStatusCode: res.StatusCode,
  2143  		},
  2144  	}
  2145  	target := &ret
  2146  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2147  		return nil, err
  2148  	}
  2149  	return ret, nil
  2150  }
  2151  
  2152  type ProjectsSecretsTestIamPermissionsCall struct {
  2153  	s                         *Service
  2154  	resource                  string
  2155  	testiampermissionsrequest *TestIamPermissionsRequest
  2156  	urlParams_                gensupport.URLParams
  2157  	ctx_                      context.Context
  2158  	header_                   http.Header
  2159  }
  2160  
  2161  // TestIamPermissions: Returns permissions that a caller has for the specified
  2162  // secret. If the secret does not exist, this call returns an empty set of
  2163  // permissions, not a NOT_FOUND error. Note: This operation is designed to be
  2164  // used for building permission-aware UIs and command-line tools, not for
  2165  // authorization checking. This operation may "fail open" without warning.
  2166  //
  2167  //   - resource: REQUIRED: The resource for which the policy detail is being
  2168  //     requested. See Resource names
  2169  //     (https://cloud.google.com/apis/design/resource_names) for the appropriate
  2170  //     value for this field.
  2171  func (r *ProjectsSecretsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsSecretsTestIamPermissionsCall {
  2172  	c := &ProjectsSecretsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2173  	c.resource = resource
  2174  	c.testiampermissionsrequest = testiampermissionsrequest
  2175  	return c
  2176  }
  2177  
  2178  // Fields allows partial responses to be retrieved. See
  2179  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2180  // details.
  2181  func (c *ProjectsSecretsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsSecretsTestIamPermissionsCall {
  2182  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2183  	return c
  2184  }
  2185  
  2186  // Context sets the context to be used in this call's Do method.
  2187  func (c *ProjectsSecretsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsSecretsTestIamPermissionsCall {
  2188  	c.ctx_ = ctx
  2189  	return c
  2190  }
  2191  
  2192  // Header returns a http.Header that can be modified by the caller to add
  2193  // headers to the request.
  2194  func (c *ProjectsSecretsTestIamPermissionsCall) Header() http.Header {
  2195  	if c.header_ == nil {
  2196  		c.header_ = make(http.Header)
  2197  	}
  2198  	return c.header_
  2199  }
  2200  
  2201  func (c *ProjectsSecretsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  2202  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  2203  	var body io.Reader = nil
  2204  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
  2205  	if err != nil {
  2206  		return nil, err
  2207  	}
  2208  	c.urlParams_.Set("alt", alt)
  2209  	c.urlParams_.Set("prettyPrint", "false")
  2210  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:testIamPermissions")
  2211  	urls += "?" + c.urlParams_.Encode()
  2212  	req, err := http.NewRequest("POST", urls, body)
  2213  	if err != nil {
  2214  		return nil, err
  2215  	}
  2216  	req.Header = reqHeaders
  2217  	googleapi.Expand(req.URL, map[string]string{
  2218  		"resource": c.resource,
  2219  	})
  2220  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2221  }
  2222  
  2223  // Do executes the "secretmanager.projects.secrets.testIamPermissions" call.
  2224  // Any non-2xx status code is an error. Response headers are in either
  2225  // *TestIamPermissionsResponse.ServerResponse.Header or (if a response was
  2226  // returned at all) in error.(*googleapi.Error).Header. Use
  2227  // googleapi.IsNotModified to check whether the returned error was because
  2228  // http.StatusNotModified was returned.
  2229  func (c *ProjectsSecretsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
  2230  	gensupport.SetOptions(c.urlParams_, opts...)
  2231  	res, err := c.doRequest("json")
  2232  	if res != nil && res.StatusCode == http.StatusNotModified {
  2233  		if res.Body != nil {
  2234  			res.Body.Close()
  2235  		}
  2236  		return nil, gensupport.WrapError(&googleapi.Error{
  2237  			Code:   res.StatusCode,
  2238  			Header: res.Header,
  2239  		})
  2240  	}
  2241  	if err != nil {
  2242  		return nil, err
  2243  	}
  2244  	defer googleapi.CloseBody(res)
  2245  	if err := googleapi.CheckResponse(res); err != nil {
  2246  		return nil, gensupport.WrapError(err)
  2247  	}
  2248  	ret := &TestIamPermissionsResponse{
  2249  		ServerResponse: googleapi.ServerResponse{
  2250  			Header:         res.Header,
  2251  			HTTPStatusCode: res.StatusCode,
  2252  		},
  2253  	}
  2254  	target := &ret
  2255  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2256  		return nil, err
  2257  	}
  2258  	return ret, nil
  2259  }
  2260  
  2261  type ProjectsSecretsVersionsAccessCall struct {
  2262  	s            *Service
  2263  	name         string
  2264  	urlParams_   gensupport.URLParams
  2265  	ifNoneMatch_ string
  2266  	ctx_         context.Context
  2267  	header_      http.Header
  2268  }
  2269  
  2270  // Access: Accesses a SecretVersion. This call returns the secret data.
  2271  // `projects/*/secrets/*/versions/latest` is an alias to the `latest`
  2272  // SecretVersion.
  2273  //
  2274  //   - name: The resource name of the SecretVersion in the format
  2275  //     `projects/*/secrets/*/versions/*`.
  2276  func (r *ProjectsSecretsVersionsService) Access(name string) *ProjectsSecretsVersionsAccessCall {
  2277  	c := &ProjectsSecretsVersionsAccessCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2278  	c.name = name
  2279  	return c
  2280  }
  2281  
  2282  // Fields allows partial responses to be retrieved. See
  2283  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2284  // details.
  2285  func (c *ProjectsSecretsVersionsAccessCall) Fields(s ...googleapi.Field) *ProjectsSecretsVersionsAccessCall {
  2286  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2287  	return c
  2288  }
  2289  
  2290  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2291  // object's ETag matches the given value. This is useful for getting updates
  2292  // only after the object has changed since the last request.
  2293  func (c *ProjectsSecretsVersionsAccessCall) IfNoneMatch(entityTag string) *ProjectsSecretsVersionsAccessCall {
  2294  	c.ifNoneMatch_ = entityTag
  2295  	return c
  2296  }
  2297  
  2298  // Context sets the context to be used in this call's Do method.
  2299  func (c *ProjectsSecretsVersionsAccessCall) Context(ctx context.Context) *ProjectsSecretsVersionsAccessCall {
  2300  	c.ctx_ = ctx
  2301  	return c
  2302  }
  2303  
  2304  // Header returns a http.Header that can be modified by the caller to add
  2305  // headers to the request.
  2306  func (c *ProjectsSecretsVersionsAccessCall) Header() http.Header {
  2307  	if c.header_ == nil {
  2308  		c.header_ = make(http.Header)
  2309  	}
  2310  	return c.header_
  2311  }
  2312  
  2313  func (c *ProjectsSecretsVersionsAccessCall) doRequest(alt string) (*http.Response, error) {
  2314  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2315  	if c.ifNoneMatch_ != "" {
  2316  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2317  	}
  2318  	var body io.Reader = nil
  2319  	c.urlParams_.Set("alt", alt)
  2320  	c.urlParams_.Set("prettyPrint", "false")
  2321  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:access")
  2322  	urls += "?" + c.urlParams_.Encode()
  2323  	req, err := http.NewRequest("GET", urls, body)
  2324  	if err != nil {
  2325  		return nil, err
  2326  	}
  2327  	req.Header = reqHeaders
  2328  	googleapi.Expand(req.URL, map[string]string{
  2329  		"name": c.name,
  2330  	})
  2331  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2332  }
  2333  
  2334  // Do executes the "secretmanager.projects.secrets.versions.access" call.
  2335  // Any non-2xx status code is an error. Response headers are in either
  2336  // *AccessSecretVersionResponse.ServerResponse.Header or (if a response was
  2337  // returned at all) in error.(*googleapi.Error).Header. Use
  2338  // googleapi.IsNotModified to check whether the returned error was because
  2339  // http.StatusNotModified was returned.
  2340  func (c *ProjectsSecretsVersionsAccessCall) Do(opts ...googleapi.CallOption) (*AccessSecretVersionResponse, error) {
  2341  	gensupport.SetOptions(c.urlParams_, opts...)
  2342  	res, err := c.doRequest("json")
  2343  	if res != nil && res.StatusCode == http.StatusNotModified {
  2344  		if res.Body != nil {
  2345  			res.Body.Close()
  2346  		}
  2347  		return nil, gensupport.WrapError(&googleapi.Error{
  2348  			Code:   res.StatusCode,
  2349  			Header: res.Header,
  2350  		})
  2351  	}
  2352  	if err != nil {
  2353  		return nil, err
  2354  	}
  2355  	defer googleapi.CloseBody(res)
  2356  	if err := googleapi.CheckResponse(res); err != nil {
  2357  		return nil, gensupport.WrapError(err)
  2358  	}
  2359  	ret := &AccessSecretVersionResponse{
  2360  		ServerResponse: googleapi.ServerResponse{
  2361  			Header:         res.Header,
  2362  			HTTPStatusCode: res.StatusCode,
  2363  		},
  2364  	}
  2365  	target := &ret
  2366  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2367  		return nil, err
  2368  	}
  2369  	return ret, nil
  2370  }
  2371  
  2372  type ProjectsSecretsVersionsDestroyCall struct {
  2373  	s                           *Service
  2374  	name                        string
  2375  	destroysecretversionrequest *DestroySecretVersionRequest
  2376  	urlParams_                  gensupport.URLParams
  2377  	ctx_                        context.Context
  2378  	header_                     http.Header
  2379  }
  2380  
  2381  // Destroy: Destroys a SecretVersion. Sets the state of the SecretVersion to
  2382  // DESTROYED and irrevocably destroys the secret data.
  2383  //
  2384  //   - name: The resource name of the SecretVersion to destroy in the format
  2385  //     `projects/*/secrets/*/versions/*`.
  2386  func (r *ProjectsSecretsVersionsService) Destroy(name string, destroysecretversionrequest *DestroySecretVersionRequest) *ProjectsSecretsVersionsDestroyCall {
  2387  	c := &ProjectsSecretsVersionsDestroyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2388  	c.name = name
  2389  	c.destroysecretversionrequest = destroysecretversionrequest
  2390  	return c
  2391  }
  2392  
  2393  // Fields allows partial responses to be retrieved. See
  2394  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2395  // details.
  2396  func (c *ProjectsSecretsVersionsDestroyCall) Fields(s ...googleapi.Field) *ProjectsSecretsVersionsDestroyCall {
  2397  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2398  	return c
  2399  }
  2400  
  2401  // Context sets the context to be used in this call's Do method.
  2402  func (c *ProjectsSecretsVersionsDestroyCall) Context(ctx context.Context) *ProjectsSecretsVersionsDestroyCall {
  2403  	c.ctx_ = ctx
  2404  	return c
  2405  }
  2406  
  2407  // Header returns a http.Header that can be modified by the caller to add
  2408  // headers to the request.
  2409  func (c *ProjectsSecretsVersionsDestroyCall) Header() http.Header {
  2410  	if c.header_ == nil {
  2411  		c.header_ = make(http.Header)
  2412  	}
  2413  	return c.header_
  2414  }
  2415  
  2416  func (c *ProjectsSecretsVersionsDestroyCall) doRequest(alt string) (*http.Response, error) {
  2417  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  2418  	var body io.Reader = nil
  2419  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.destroysecretversionrequest)
  2420  	if err != nil {
  2421  		return nil, err
  2422  	}
  2423  	c.urlParams_.Set("alt", alt)
  2424  	c.urlParams_.Set("prettyPrint", "false")
  2425  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:destroy")
  2426  	urls += "?" + c.urlParams_.Encode()
  2427  	req, err := http.NewRequest("POST", urls, body)
  2428  	if err != nil {
  2429  		return nil, err
  2430  	}
  2431  	req.Header = reqHeaders
  2432  	googleapi.Expand(req.URL, map[string]string{
  2433  		"name": c.name,
  2434  	})
  2435  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2436  }
  2437  
  2438  // Do executes the "secretmanager.projects.secrets.versions.destroy" call.
  2439  // Any non-2xx status code is an error. Response headers are in either
  2440  // *SecretVersion.ServerResponse.Header or (if a response was returned at all)
  2441  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2442  // whether the returned error was because http.StatusNotModified was returned.
  2443  func (c *ProjectsSecretsVersionsDestroyCall) Do(opts ...googleapi.CallOption) (*SecretVersion, error) {
  2444  	gensupport.SetOptions(c.urlParams_, opts...)
  2445  	res, err := c.doRequest("json")
  2446  	if res != nil && res.StatusCode == http.StatusNotModified {
  2447  		if res.Body != nil {
  2448  			res.Body.Close()
  2449  		}
  2450  		return nil, gensupport.WrapError(&googleapi.Error{
  2451  			Code:   res.StatusCode,
  2452  			Header: res.Header,
  2453  		})
  2454  	}
  2455  	if err != nil {
  2456  		return nil, err
  2457  	}
  2458  	defer googleapi.CloseBody(res)
  2459  	if err := googleapi.CheckResponse(res); err != nil {
  2460  		return nil, gensupport.WrapError(err)
  2461  	}
  2462  	ret := &SecretVersion{
  2463  		ServerResponse: googleapi.ServerResponse{
  2464  			Header:         res.Header,
  2465  			HTTPStatusCode: res.StatusCode,
  2466  		},
  2467  	}
  2468  	target := &ret
  2469  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2470  		return nil, err
  2471  	}
  2472  	return ret, nil
  2473  }
  2474  
  2475  type ProjectsSecretsVersionsDisableCall struct {
  2476  	s                           *Service
  2477  	name                        string
  2478  	disablesecretversionrequest *DisableSecretVersionRequest
  2479  	urlParams_                  gensupport.URLParams
  2480  	ctx_                        context.Context
  2481  	header_                     http.Header
  2482  }
  2483  
  2484  // Disable: Disables a SecretVersion. Sets the state of the SecretVersion to
  2485  // DISABLED.
  2486  //
  2487  //   - name: The resource name of the SecretVersion to disable in the format
  2488  //     `projects/*/secrets/*/versions/*`.
  2489  func (r *ProjectsSecretsVersionsService) Disable(name string, disablesecretversionrequest *DisableSecretVersionRequest) *ProjectsSecretsVersionsDisableCall {
  2490  	c := &ProjectsSecretsVersionsDisableCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2491  	c.name = name
  2492  	c.disablesecretversionrequest = disablesecretversionrequest
  2493  	return c
  2494  }
  2495  
  2496  // Fields allows partial responses to be retrieved. See
  2497  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2498  // details.
  2499  func (c *ProjectsSecretsVersionsDisableCall) Fields(s ...googleapi.Field) *ProjectsSecretsVersionsDisableCall {
  2500  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2501  	return c
  2502  }
  2503  
  2504  // Context sets the context to be used in this call's Do method.
  2505  func (c *ProjectsSecretsVersionsDisableCall) Context(ctx context.Context) *ProjectsSecretsVersionsDisableCall {
  2506  	c.ctx_ = ctx
  2507  	return c
  2508  }
  2509  
  2510  // Header returns a http.Header that can be modified by the caller to add
  2511  // headers to the request.
  2512  func (c *ProjectsSecretsVersionsDisableCall) Header() http.Header {
  2513  	if c.header_ == nil {
  2514  		c.header_ = make(http.Header)
  2515  	}
  2516  	return c.header_
  2517  }
  2518  
  2519  func (c *ProjectsSecretsVersionsDisableCall) doRequest(alt string) (*http.Response, error) {
  2520  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  2521  	var body io.Reader = nil
  2522  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.disablesecretversionrequest)
  2523  	if err != nil {
  2524  		return nil, err
  2525  	}
  2526  	c.urlParams_.Set("alt", alt)
  2527  	c.urlParams_.Set("prettyPrint", "false")
  2528  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:disable")
  2529  	urls += "?" + c.urlParams_.Encode()
  2530  	req, err := http.NewRequest("POST", urls, body)
  2531  	if err != nil {
  2532  		return nil, err
  2533  	}
  2534  	req.Header = reqHeaders
  2535  	googleapi.Expand(req.URL, map[string]string{
  2536  		"name": c.name,
  2537  	})
  2538  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2539  }
  2540  
  2541  // Do executes the "secretmanager.projects.secrets.versions.disable" call.
  2542  // Any non-2xx status code is an error. Response headers are in either
  2543  // *SecretVersion.ServerResponse.Header or (if a response was returned at all)
  2544  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2545  // whether the returned error was because http.StatusNotModified was returned.
  2546  func (c *ProjectsSecretsVersionsDisableCall) Do(opts ...googleapi.CallOption) (*SecretVersion, error) {
  2547  	gensupport.SetOptions(c.urlParams_, opts...)
  2548  	res, err := c.doRequest("json")
  2549  	if res != nil && res.StatusCode == http.StatusNotModified {
  2550  		if res.Body != nil {
  2551  			res.Body.Close()
  2552  		}
  2553  		return nil, gensupport.WrapError(&googleapi.Error{
  2554  			Code:   res.StatusCode,
  2555  			Header: res.Header,
  2556  		})
  2557  	}
  2558  	if err != nil {
  2559  		return nil, err
  2560  	}
  2561  	defer googleapi.CloseBody(res)
  2562  	if err := googleapi.CheckResponse(res); err != nil {
  2563  		return nil, gensupport.WrapError(err)
  2564  	}
  2565  	ret := &SecretVersion{
  2566  		ServerResponse: googleapi.ServerResponse{
  2567  			Header:         res.Header,
  2568  			HTTPStatusCode: res.StatusCode,
  2569  		},
  2570  	}
  2571  	target := &ret
  2572  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2573  		return nil, err
  2574  	}
  2575  	return ret, nil
  2576  }
  2577  
  2578  type ProjectsSecretsVersionsEnableCall struct {
  2579  	s                          *Service
  2580  	name                       string
  2581  	enablesecretversionrequest *EnableSecretVersionRequest
  2582  	urlParams_                 gensupport.URLParams
  2583  	ctx_                       context.Context
  2584  	header_                    http.Header
  2585  }
  2586  
  2587  // Enable: Enables a SecretVersion. Sets the state of the SecretVersion to
  2588  // ENABLED.
  2589  //
  2590  //   - name: The resource name of the SecretVersion to enable in the format
  2591  //     `projects/*/secrets/*/versions/*`.
  2592  func (r *ProjectsSecretsVersionsService) Enable(name string, enablesecretversionrequest *EnableSecretVersionRequest) *ProjectsSecretsVersionsEnableCall {
  2593  	c := &ProjectsSecretsVersionsEnableCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2594  	c.name = name
  2595  	c.enablesecretversionrequest = enablesecretversionrequest
  2596  	return c
  2597  }
  2598  
  2599  // Fields allows partial responses to be retrieved. See
  2600  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2601  // details.
  2602  func (c *ProjectsSecretsVersionsEnableCall) Fields(s ...googleapi.Field) *ProjectsSecretsVersionsEnableCall {
  2603  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2604  	return c
  2605  }
  2606  
  2607  // Context sets the context to be used in this call's Do method.
  2608  func (c *ProjectsSecretsVersionsEnableCall) Context(ctx context.Context) *ProjectsSecretsVersionsEnableCall {
  2609  	c.ctx_ = ctx
  2610  	return c
  2611  }
  2612  
  2613  // Header returns a http.Header that can be modified by the caller to add
  2614  // headers to the request.
  2615  func (c *ProjectsSecretsVersionsEnableCall) Header() http.Header {
  2616  	if c.header_ == nil {
  2617  		c.header_ = make(http.Header)
  2618  	}
  2619  	return c.header_
  2620  }
  2621  
  2622  func (c *ProjectsSecretsVersionsEnableCall) doRequest(alt string) (*http.Response, error) {
  2623  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  2624  	var body io.Reader = nil
  2625  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.enablesecretversionrequest)
  2626  	if err != nil {
  2627  		return nil, err
  2628  	}
  2629  	c.urlParams_.Set("alt", alt)
  2630  	c.urlParams_.Set("prettyPrint", "false")
  2631  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:enable")
  2632  	urls += "?" + c.urlParams_.Encode()
  2633  	req, err := http.NewRequest("POST", urls, body)
  2634  	if err != nil {
  2635  		return nil, err
  2636  	}
  2637  	req.Header = reqHeaders
  2638  	googleapi.Expand(req.URL, map[string]string{
  2639  		"name": c.name,
  2640  	})
  2641  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2642  }
  2643  
  2644  // Do executes the "secretmanager.projects.secrets.versions.enable" call.
  2645  // Any non-2xx status code is an error. Response headers are in either
  2646  // *SecretVersion.ServerResponse.Header or (if a response was returned at all)
  2647  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2648  // whether the returned error was because http.StatusNotModified was returned.
  2649  func (c *ProjectsSecretsVersionsEnableCall) Do(opts ...googleapi.CallOption) (*SecretVersion, error) {
  2650  	gensupport.SetOptions(c.urlParams_, opts...)
  2651  	res, err := c.doRequest("json")
  2652  	if res != nil && res.StatusCode == http.StatusNotModified {
  2653  		if res.Body != nil {
  2654  			res.Body.Close()
  2655  		}
  2656  		return nil, gensupport.WrapError(&googleapi.Error{
  2657  			Code:   res.StatusCode,
  2658  			Header: res.Header,
  2659  		})
  2660  	}
  2661  	if err != nil {
  2662  		return nil, err
  2663  	}
  2664  	defer googleapi.CloseBody(res)
  2665  	if err := googleapi.CheckResponse(res); err != nil {
  2666  		return nil, gensupport.WrapError(err)
  2667  	}
  2668  	ret := &SecretVersion{
  2669  		ServerResponse: googleapi.ServerResponse{
  2670  			Header:         res.Header,
  2671  			HTTPStatusCode: res.StatusCode,
  2672  		},
  2673  	}
  2674  	target := &ret
  2675  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2676  		return nil, err
  2677  	}
  2678  	return ret, nil
  2679  }
  2680  
  2681  type ProjectsSecretsVersionsGetCall struct {
  2682  	s            *Service
  2683  	name         string
  2684  	urlParams_   gensupport.URLParams
  2685  	ifNoneMatch_ string
  2686  	ctx_         context.Context
  2687  	header_      http.Header
  2688  }
  2689  
  2690  // Get: Gets metadata for a SecretVersion.
  2691  // `projects/*/secrets/*/versions/latest` is an alias to the `latest`
  2692  // SecretVersion.
  2693  //
  2694  //   - name: The resource name of the SecretVersion in the format
  2695  //     `projects/*/secrets/*/versions/*`. `projects/*/secrets/*/versions/latest`
  2696  //     is an alias to the `latest` SecretVersion.
  2697  func (r *ProjectsSecretsVersionsService) Get(name string) *ProjectsSecretsVersionsGetCall {
  2698  	c := &ProjectsSecretsVersionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2699  	c.name = name
  2700  	return c
  2701  }
  2702  
  2703  // Fields allows partial responses to be retrieved. See
  2704  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2705  // details.
  2706  func (c *ProjectsSecretsVersionsGetCall) Fields(s ...googleapi.Field) *ProjectsSecretsVersionsGetCall {
  2707  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2708  	return c
  2709  }
  2710  
  2711  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2712  // object's ETag matches the given value. This is useful for getting updates
  2713  // only after the object has changed since the last request.
  2714  func (c *ProjectsSecretsVersionsGetCall) IfNoneMatch(entityTag string) *ProjectsSecretsVersionsGetCall {
  2715  	c.ifNoneMatch_ = entityTag
  2716  	return c
  2717  }
  2718  
  2719  // Context sets the context to be used in this call's Do method.
  2720  func (c *ProjectsSecretsVersionsGetCall) Context(ctx context.Context) *ProjectsSecretsVersionsGetCall {
  2721  	c.ctx_ = ctx
  2722  	return c
  2723  }
  2724  
  2725  // Header returns a http.Header that can be modified by the caller to add
  2726  // headers to the request.
  2727  func (c *ProjectsSecretsVersionsGetCall) Header() http.Header {
  2728  	if c.header_ == nil {
  2729  		c.header_ = make(http.Header)
  2730  	}
  2731  	return c.header_
  2732  }
  2733  
  2734  func (c *ProjectsSecretsVersionsGetCall) doRequest(alt string) (*http.Response, error) {
  2735  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2736  	if c.ifNoneMatch_ != "" {
  2737  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2738  	}
  2739  	var body io.Reader = nil
  2740  	c.urlParams_.Set("alt", alt)
  2741  	c.urlParams_.Set("prettyPrint", "false")
  2742  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  2743  	urls += "?" + c.urlParams_.Encode()
  2744  	req, err := http.NewRequest("GET", urls, body)
  2745  	if err != nil {
  2746  		return nil, err
  2747  	}
  2748  	req.Header = reqHeaders
  2749  	googleapi.Expand(req.URL, map[string]string{
  2750  		"name": c.name,
  2751  	})
  2752  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2753  }
  2754  
  2755  // Do executes the "secretmanager.projects.secrets.versions.get" call.
  2756  // Any non-2xx status code is an error. Response headers are in either
  2757  // *SecretVersion.ServerResponse.Header or (if a response was returned at all)
  2758  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2759  // whether the returned error was because http.StatusNotModified was returned.
  2760  func (c *ProjectsSecretsVersionsGetCall) Do(opts ...googleapi.CallOption) (*SecretVersion, error) {
  2761  	gensupport.SetOptions(c.urlParams_, opts...)
  2762  	res, err := c.doRequest("json")
  2763  	if res != nil && res.StatusCode == http.StatusNotModified {
  2764  		if res.Body != nil {
  2765  			res.Body.Close()
  2766  		}
  2767  		return nil, gensupport.WrapError(&googleapi.Error{
  2768  			Code:   res.StatusCode,
  2769  			Header: res.Header,
  2770  		})
  2771  	}
  2772  	if err != nil {
  2773  		return nil, err
  2774  	}
  2775  	defer googleapi.CloseBody(res)
  2776  	if err := googleapi.CheckResponse(res); err != nil {
  2777  		return nil, gensupport.WrapError(err)
  2778  	}
  2779  	ret := &SecretVersion{
  2780  		ServerResponse: googleapi.ServerResponse{
  2781  			Header:         res.Header,
  2782  			HTTPStatusCode: res.StatusCode,
  2783  		},
  2784  	}
  2785  	target := &ret
  2786  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2787  		return nil, err
  2788  	}
  2789  	return ret, nil
  2790  }
  2791  
  2792  type ProjectsSecretsVersionsListCall struct {
  2793  	s            *Service
  2794  	parent       string
  2795  	urlParams_   gensupport.URLParams
  2796  	ifNoneMatch_ string
  2797  	ctx_         context.Context
  2798  	header_      http.Header
  2799  }
  2800  
  2801  // List: Lists SecretVersions. This call does not return secret data.
  2802  //
  2803  //   - parent: The resource name of the Secret associated with the SecretVersions
  2804  //     to list, in the format `projects/*/secrets/*`.
  2805  func (r *ProjectsSecretsVersionsService) List(parent string) *ProjectsSecretsVersionsListCall {
  2806  	c := &ProjectsSecretsVersionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2807  	c.parent = parent
  2808  	return c
  2809  }
  2810  
  2811  // PageSize sets the optional parameter "pageSize": The maximum number of
  2812  // results to be returned in a single page. If set to 0, the server decides the
  2813  // number of results to return. If the number is greater than 25000, it is
  2814  // capped at 25000.
  2815  func (c *ProjectsSecretsVersionsListCall) PageSize(pageSize int64) *ProjectsSecretsVersionsListCall {
  2816  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  2817  	return c
  2818  }
  2819  
  2820  // PageToken sets the optional parameter "pageToken": Pagination token,
  2821  // returned earlier via ListSecretVersionsResponse.next_page_token][].
  2822  func (c *ProjectsSecretsVersionsListCall) PageToken(pageToken string) *ProjectsSecretsVersionsListCall {
  2823  	c.urlParams_.Set("pageToken", pageToken)
  2824  	return c
  2825  }
  2826  
  2827  // Fields allows partial responses to be retrieved. See
  2828  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2829  // details.
  2830  func (c *ProjectsSecretsVersionsListCall) Fields(s ...googleapi.Field) *ProjectsSecretsVersionsListCall {
  2831  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2832  	return c
  2833  }
  2834  
  2835  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2836  // object's ETag matches the given value. This is useful for getting updates
  2837  // only after the object has changed since the last request.
  2838  func (c *ProjectsSecretsVersionsListCall) IfNoneMatch(entityTag string) *ProjectsSecretsVersionsListCall {
  2839  	c.ifNoneMatch_ = entityTag
  2840  	return c
  2841  }
  2842  
  2843  // Context sets the context to be used in this call's Do method.
  2844  func (c *ProjectsSecretsVersionsListCall) Context(ctx context.Context) *ProjectsSecretsVersionsListCall {
  2845  	c.ctx_ = ctx
  2846  	return c
  2847  }
  2848  
  2849  // Header returns a http.Header that can be modified by the caller to add
  2850  // headers to the request.
  2851  func (c *ProjectsSecretsVersionsListCall) Header() http.Header {
  2852  	if c.header_ == nil {
  2853  		c.header_ = make(http.Header)
  2854  	}
  2855  	return c.header_
  2856  }
  2857  
  2858  func (c *ProjectsSecretsVersionsListCall) doRequest(alt string) (*http.Response, error) {
  2859  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2860  	if c.ifNoneMatch_ != "" {
  2861  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2862  	}
  2863  	var body io.Reader = nil
  2864  	c.urlParams_.Set("alt", alt)
  2865  	c.urlParams_.Set("prettyPrint", "false")
  2866  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/versions")
  2867  	urls += "?" + c.urlParams_.Encode()
  2868  	req, err := http.NewRequest("GET", urls, body)
  2869  	if err != nil {
  2870  		return nil, err
  2871  	}
  2872  	req.Header = reqHeaders
  2873  	googleapi.Expand(req.URL, map[string]string{
  2874  		"parent": c.parent,
  2875  	})
  2876  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2877  }
  2878  
  2879  // Do executes the "secretmanager.projects.secrets.versions.list" call.
  2880  // Any non-2xx status code is an error. Response headers are in either
  2881  // *ListSecretVersionsResponse.ServerResponse.Header or (if a response was
  2882  // returned at all) in error.(*googleapi.Error).Header. Use
  2883  // googleapi.IsNotModified to check whether the returned error was because
  2884  // http.StatusNotModified was returned.
  2885  func (c *ProjectsSecretsVersionsListCall) Do(opts ...googleapi.CallOption) (*ListSecretVersionsResponse, error) {
  2886  	gensupport.SetOptions(c.urlParams_, opts...)
  2887  	res, err := c.doRequest("json")
  2888  	if res != nil && res.StatusCode == http.StatusNotModified {
  2889  		if res.Body != nil {
  2890  			res.Body.Close()
  2891  		}
  2892  		return nil, gensupport.WrapError(&googleapi.Error{
  2893  			Code:   res.StatusCode,
  2894  			Header: res.Header,
  2895  		})
  2896  	}
  2897  	if err != nil {
  2898  		return nil, err
  2899  	}
  2900  	defer googleapi.CloseBody(res)
  2901  	if err := googleapi.CheckResponse(res); err != nil {
  2902  		return nil, gensupport.WrapError(err)
  2903  	}
  2904  	ret := &ListSecretVersionsResponse{
  2905  		ServerResponse: googleapi.ServerResponse{
  2906  			Header:         res.Header,
  2907  			HTTPStatusCode: res.StatusCode,
  2908  		},
  2909  	}
  2910  	target := &ret
  2911  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2912  		return nil, err
  2913  	}
  2914  	return ret, nil
  2915  }
  2916  
  2917  // Pages invokes f for each page of results.
  2918  // A non-nil error returned from f will halt the iteration.
  2919  // The provided context supersedes any context provided to the Context method.
  2920  func (c *ProjectsSecretsVersionsListCall) Pages(ctx context.Context, f func(*ListSecretVersionsResponse) error) error {
  2921  	c.ctx_ = ctx
  2922  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  2923  	for {
  2924  		x, err := c.Do()
  2925  		if err != nil {
  2926  			return err
  2927  		}
  2928  		if err := f(x); err != nil {
  2929  			return err
  2930  		}
  2931  		if x.NextPageToken == "" {
  2932  			return nil
  2933  		}
  2934  		c.PageToken(x.NextPageToken)
  2935  	}
  2936  }
  2937  

View as plain text