...

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

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

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

View as plain text