...

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

Documentation: google.golang.org/api/secretmanager/v1beta2

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

View as plain text