...

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

Documentation: google.golang.org/api/rapidmigrationassessment/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 rapidmigrationassessment provides access to the Rapid Migration Assessment API.
     8  //
     9  // For product documentation, see: https://cloud.google.com/migration-center
    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/rapidmigrationassessment/v1"
    27  //	...
    28  //	ctx := context.Background()
    29  //	rapidmigrationassessmentService, err := rapidmigrationassessment.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  //	rapidmigrationassessmentService, err := rapidmigrationassessment.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  //	rapidmigrationassessmentService, err := rapidmigrationassessment.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
    49  //
    50  // See [google.golang.org/api/option.ClientOption] for details on options.
    51  package rapidmigrationassessment // import "google.golang.org/api/rapidmigrationassessment/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 = "rapidmigrationassessment:v1"
    90  const apiName = "rapidmigrationassessment"
    91  const apiVersion = "v1"
    92  const basePath = "https://rapidmigrationassessment.googleapis.com/"
    93  const basePathTemplate = "https://rapidmigrationassessment.UNIVERSE_DOMAIN/"
    94  const mtlsBasePath = "https://rapidmigrationassessment.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.Annotations = NewProjectsLocationsAnnotationsService(s)
   172  	rs.Collectors = NewProjectsLocationsCollectorsService(s)
   173  	rs.Operations = NewProjectsLocationsOperationsService(s)
   174  	return rs
   175  }
   176  
   177  type ProjectsLocationsService struct {
   178  	s *Service
   179  
   180  	Annotations *ProjectsLocationsAnnotationsService
   181  
   182  	Collectors *ProjectsLocationsCollectorsService
   183  
   184  	Operations *ProjectsLocationsOperationsService
   185  }
   186  
   187  func NewProjectsLocationsAnnotationsService(s *Service) *ProjectsLocationsAnnotationsService {
   188  	rs := &ProjectsLocationsAnnotationsService{s: s}
   189  	return rs
   190  }
   191  
   192  type ProjectsLocationsAnnotationsService struct {
   193  	s *Service
   194  }
   195  
   196  func NewProjectsLocationsCollectorsService(s *Service) *ProjectsLocationsCollectorsService {
   197  	rs := &ProjectsLocationsCollectorsService{s: s}
   198  	return rs
   199  }
   200  
   201  type ProjectsLocationsCollectorsService 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  // Annotation: Message describing an Annotation
   215  type Annotation struct {
   216  	// CreateTime: Output only. Create time stamp.
   217  	CreateTime string `json:"createTime,omitempty"`
   218  	// Labels: Labels as key value pairs.
   219  	Labels map[string]string `json:"labels,omitempty"`
   220  	// Name: name of resource.
   221  	Name string `json:"name,omitempty"`
   222  	// Type: Type of an annotation.
   223  	//
   224  	// Possible values:
   225  	//   "TYPE_UNSPECIFIED" - Unknown type
   226  	//   "TYPE_LEGACY_EXPORT_CONSENT" - Indicates that this project has opted into
   227  	// StratoZone export.
   228  	//   "TYPE_QWIKLAB" - Indicates that this project is created by Qwiklab.
   229  	Type string `json:"type,omitempty"`
   230  	// UpdateTime: Output only. Update time stamp.
   231  	UpdateTime string `json:"updateTime,omitempty"`
   232  
   233  	// ServerResponse contains the HTTP response code and headers from the server.
   234  	googleapi.ServerResponse `json:"-"`
   235  	// ForceSendFields is a list of field names (e.g. "CreateTime") to
   236  	// unconditionally include in API requests. By default, fields with empty or
   237  	// default values are omitted from API requests. See
   238  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   239  	// details.
   240  	ForceSendFields []string `json:"-"`
   241  	// NullFields is a list of field names (e.g. "CreateTime") to include in API
   242  	// requests with the JSON null value. By default, fields with empty values are
   243  	// omitted from API requests. See
   244  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   245  	NullFields []string `json:"-"`
   246  }
   247  
   248  func (s *Annotation) MarshalJSON() ([]byte, error) {
   249  	type NoMethod Annotation
   250  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   251  }
   252  
   253  // CancelOperationRequest: The request message for Operations.CancelOperation.
   254  type CancelOperationRequest struct {
   255  }
   256  
   257  // Collector: Message describing Collector object.
   258  type Collector struct {
   259  	// Bucket: Output only. Store cloud storage bucket name (which is a guid)
   260  	// created with this Collector.
   261  	Bucket string `json:"bucket,omitempty"`
   262  	// ClientVersion: Output only. Client version.
   263  	ClientVersion string `json:"clientVersion,omitempty"`
   264  	// CollectionDays: How many days to collect data.
   265  	CollectionDays int64 `json:"collectionDays,omitempty"`
   266  	// CreateTime: Output only. Create time stamp.
   267  	CreateTime string `json:"createTime,omitempty"`
   268  	// Description: User specified description of the Collector.
   269  	Description string `json:"description,omitempty"`
   270  	// DisplayName: User specified name of the Collector.
   271  	DisplayName string `json:"displayName,omitempty"`
   272  	// EulaUri: Uri for EULA (End User License Agreement) from customer.
   273  	EulaUri string `json:"eulaUri,omitempty"`
   274  	// ExpectedAssetCount: User specified expected asset count.
   275  	ExpectedAssetCount int64 `json:"expectedAssetCount,omitempty,string"`
   276  	// GuestOsScan: Output only. Reference to MC Source Guest Os Scan.
   277  	GuestOsScan *GuestOsScan `json:"guestOsScan,omitempty"`
   278  	// Labels: Labels as key value pairs.
   279  	Labels map[string]string `json:"labels,omitempty"`
   280  	// Name: name of resource.
   281  	Name string `json:"name,omitempty"`
   282  	// ServiceAccount: Service Account email used to ingest data to this Collector.
   283  	ServiceAccount string `json:"serviceAccount,omitempty"`
   284  	// State: Output only. State of the Collector.
   285  	//
   286  	// Possible values:
   287  	//   "STATE_UNSPECIFIED" - Collector state is not recognized.
   288  	//   "STATE_INITIALIZING" - Collector started to create, but hasn't been
   289  	// completed MC source creation and db object creation.
   290  	//   "STATE_READY_TO_USE" - Collector has been created, MC source creation and
   291  	// db object creation completed.
   292  	//   "STATE_REGISTERED" - Collector client has been registered with client.
   293  	//   "STATE_ACTIVE" - Collector client is actively scanning.
   294  	//   "STATE_PAUSED" - Collector is not actively scanning.
   295  	//   "STATE_DELETING" - Collector is starting background job for deletion.
   296  	//   "STATE_DECOMMISSIONED" - Collector completed all tasks for deletion.
   297  	//   "STATE_ERROR" - Collector is in error state.
   298  	State string `json:"state,omitempty"`
   299  	// UpdateTime: Output only. Update time stamp.
   300  	UpdateTime string `json:"updateTime,omitempty"`
   301  	// VsphereScan: Output only. Reference to MC Source vsphere_scan.
   302  	VsphereScan *VSphereScan `json:"vsphereScan,omitempty"`
   303  
   304  	// ServerResponse contains the HTTP response code and headers from the server.
   305  	googleapi.ServerResponse `json:"-"`
   306  	// ForceSendFields is a list of field names (e.g. "Bucket") to unconditionally
   307  	// include in API requests. By default, fields with empty or default values are
   308  	// omitted from API requests. See
   309  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   310  	// details.
   311  	ForceSendFields []string `json:"-"`
   312  	// NullFields is a list of field names (e.g. "Bucket") to include in API
   313  	// requests with the JSON null value. By default, fields with empty values are
   314  	// omitted from API requests. See
   315  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   316  	NullFields []string `json:"-"`
   317  }
   318  
   319  func (s *Collector) MarshalJSON() ([]byte, error) {
   320  	type NoMethod Collector
   321  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   322  }
   323  
   324  // Empty: A generic empty message that you can re-use to avoid defining
   325  // duplicated empty messages in your APIs. A typical example is to use it as
   326  // the request or the response type of an API method. For instance: service Foo
   327  // { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }
   328  type Empty struct {
   329  	// ServerResponse contains the HTTP response code and headers from the server.
   330  	googleapi.ServerResponse `json:"-"`
   331  }
   332  
   333  // GuestOsScan: Message describing a MC Source of type Guest OS Scan.
   334  type GuestOsScan struct {
   335  	// CoreSource: reference to the corresponding Guest OS Scan in MC Source.
   336  	CoreSource string `json:"coreSource,omitempty"`
   337  	// ForceSendFields is a list of field names (e.g. "CoreSource") to
   338  	// unconditionally include in API requests. By default, fields with empty or
   339  	// default values are omitted from API requests. See
   340  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   341  	// details.
   342  	ForceSendFields []string `json:"-"`
   343  	// NullFields is a list of field names (e.g. "CoreSource") to include in API
   344  	// requests with the JSON null value. By default, fields with empty values are
   345  	// omitted from API requests. See
   346  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   347  	NullFields []string `json:"-"`
   348  }
   349  
   350  func (s *GuestOsScan) MarshalJSON() ([]byte, error) {
   351  	type NoMethod GuestOsScan
   352  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   353  }
   354  
   355  // ListCollectorsResponse: Message for response to listing Collectors.
   356  type ListCollectorsResponse struct {
   357  	// Collectors: The list of Collectors.
   358  	Collectors []*Collector `json:"collectors,omitempty"`
   359  	// NextPageToken: A token identifying a page of results the server should
   360  	// return.
   361  	NextPageToken string `json:"nextPageToken,omitempty"`
   362  	// Unreachable: Locations that could not be reached.
   363  	Unreachable []string `json:"unreachable,omitempty"`
   364  
   365  	// ServerResponse contains the HTTP response code and headers from the server.
   366  	googleapi.ServerResponse `json:"-"`
   367  	// ForceSendFields is a list of field names (e.g. "Collectors") to
   368  	// unconditionally include in API requests. By default, fields with empty or
   369  	// default values are omitted from API requests. See
   370  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   371  	// details.
   372  	ForceSendFields []string `json:"-"`
   373  	// NullFields is a list of field names (e.g. "Collectors") to include in API
   374  	// requests with the JSON null value. By default, fields with empty values are
   375  	// omitted from API requests. See
   376  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   377  	NullFields []string `json:"-"`
   378  }
   379  
   380  func (s *ListCollectorsResponse) MarshalJSON() ([]byte, error) {
   381  	type NoMethod ListCollectorsResponse
   382  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   383  }
   384  
   385  // ListLocationsResponse: The response message for Locations.ListLocations.
   386  type ListLocationsResponse struct {
   387  	// Locations: A list of locations that matches the specified filter in the
   388  	// request.
   389  	Locations []*Location `json:"locations,omitempty"`
   390  	// NextPageToken: The standard List next-page token.
   391  	NextPageToken string `json:"nextPageToken,omitempty"`
   392  
   393  	// ServerResponse contains the HTTP response code and headers from the server.
   394  	googleapi.ServerResponse `json:"-"`
   395  	// ForceSendFields is a list of field names (e.g. "Locations") to
   396  	// unconditionally include in API requests. By default, fields with empty or
   397  	// default values are omitted from API requests. See
   398  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   399  	// details.
   400  	ForceSendFields []string `json:"-"`
   401  	// NullFields is a list of field names (e.g. "Locations") to include in API
   402  	// requests with the JSON null value. By default, fields with empty values are
   403  	// omitted from API requests. See
   404  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   405  	NullFields []string `json:"-"`
   406  }
   407  
   408  func (s *ListLocationsResponse) MarshalJSON() ([]byte, error) {
   409  	type NoMethod ListLocationsResponse
   410  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   411  }
   412  
   413  // ListOperationsResponse: The response message for Operations.ListOperations.
   414  type ListOperationsResponse struct {
   415  	// NextPageToken: The standard List next-page token.
   416  	NextPageToken string `json:"nextPageToken,omitempty"`
   417  	// Operations: A list of operations that matches the specified filter in the
   418  	// request.
   419  	Operations []*Operation `json:"operations,omitempty"`
   420  
   421  	// ServerResponse contains the HTTP response code and headers from the server.
   422  	googleapi.ServerResponse `json:"-"`
   423  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
   424  	// unconditionally include in API requests. By default, fields with empty or
   425  	// default values are omitted from API requests. See
   426  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   427  	// details.
   428  	ForceSendFields []string `json:"-"`
   429  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
   430  	// requests with the JSON null value. By default, fields with empty values are
   431  	// omitted from API requests. See
   432  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   433  	NullFields []string `json:"-"`
   434  }
   435  
   436  func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) {
   437  	type NoMethod ListOperationsResponse
   438  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   439  }
   440  
   441  // Location: A resource that represents a Google Cloud location.
   442  type Location struct {
   443  	// DisplayName: The friendly name for this location, typically a nearby city
   444  	// name. For example, "Tokyo".
   445  	DisplayName string `json:"displayName,omitempty"`
   446  	// Labels: Cross-service attributes for the location. For example
   447  	// {"cloud.googleapis.com/region": "us-east1"}
   448  	Labels map[string]string `json:"labels,omitempty"`
   449  	// LocationId: The canonical id for this location. For example: "us-east1".
   450  	LocationId string `json:"locationId,omitempty"`
   451  	// Metadata: Service-specific metadata. For example the available capacity at
   452  	// the given location.
   453  	Metadata googleapi.RawMessage `json:"metadata,omitempty"`
   454  	// Name: Resource name for the location, which may vary between
   455  	// implementations. For example:
   456  	// "projects/example-project/locations/us-east1"
   457  	Name string `json:"name,omitempty"`
   458  
   459  	// ServerResponse contains the HTTP response code and headers from the server.
   460  	googleapi.ServerResponse `json:"-"`
   461  	// ForceSendFields is a list of field names (e.g. "DisplayName") to
   462  	// unconditionally include in API requests. By default, fields with empty or
   463  	// default values are omitted from API requests. See
   464  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   465  	// details.
   466  	ForceSendFields []string `json:"-"`
   467  	// NullFields is a list of field names (e.g. "DisplayName") to include in API
   468  	// requests with the JSON null value. By default, fields with empty values are
   469  	// omitted from API requests. See
   470  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   471  	NullFields []string `json:"-"`
   472  }
   473  
   474  func (s *Location) MarshalJSON() ([]byte, error) {
   475  	type NoMethod Location
   476  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   477  }
   478  
   479  // Operation: This resource represents a long-running operation that is the
   480  // result of a network API call.
   481  type Operation struct {
   482  	// Done: If the value is `false`, it means the operation is still in progress.
   483  	// If `true`, the operation is completed, and either `error` or `response` is
   484  	// available.
   485  	Done bool `json:"done,omitempty"`
   486  	// Error: The error result of the operation in case of failure or cancellation.
   487  	Error *Status `json:"error,omitempty"`
   488  	// Metadata: Service-specific metadata associated with the operation. It
   489  	// typically contains progress information and common metadata such as create
   490  	// time. Some services might not provide such metadata. Any method that returns
   491  	// a long-running operation should document the metadata type, if any.
   492  	Metadata googleapi.RawMessage `json:"metadata,omitempty"`
   493  	// Name: The server-assigned name, which is only unique within the same service
   494  	// that originally returns it. If you use the default HTTP mapping, the `name`
   495  	// should be a resource name ending with `operations/{unique_id}`.
   496  	Name string `json:"name,omitempty"`
   497  	// Response: The normal, successful response of the operation. If the original
   498  	// method returns no data on success, such as `Delete`, the response is
   499  	// `google.protobuf.Empty`. If the original method is standard
   500  	// `Get`/`Create`/`Update`, the response should be the resource. For other
   501  	// methods, the response should have the type `XxxResponse`, where `Xxx` is the
   502  	// original method name. For example, if the original method name is
   503  	// `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
   504  	Response googleapi.RawMessage `json:"response,omitempty"`
   505  
   506  	// ServerResponse contains the HTTP response code and headers from the server.
   507  	googleapi.ServerResponse `json:"-"`
   508  	// ForceSendFields is a list of field names (e.g. "Done") to unconditionally
   509  	// include in API requests. By default, fields with empty or default values are
   510  	// omitted from API requests. See
   511  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   512  	// details.
   513  	ForceSendFields []string `json:"-"`
   514  	// NullFields is a list of field names (e.g. "Done") to include in API requests
   515  	// with the JSON null value. By default, fields with empty values are omitted
   516  	// from API requests. See
   517  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   518  	NullFields []string `json:"-"`
   519  }
   520  
   521  func (s *Operation) MarshalJSON() ([]byte, error) {
   522  	type NoMethod Operation
   523  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   524  }
   525  
   526  // OperationMetadata: Represents the metadata of the long-running operation.
   527  type OperationMetadata struct {
   528  	// ApiVersion: Output only. API version used to start the operation.
   529  	ApiVersion string `json:"apiVersion,omitempty"`
   530  	// CreateTime: Output only. The time the operation was created.
   531  	CreateTime string `json:"createTime,omitempty"`
   532  	// EndTime: Output only. The time the operation finished running.
   533  	EndTime string `json:"endTime,omitempty"`
   534  	// RequestedCancellation: Output only. Identifies whether the user has
   535  	// requested cancellation of the operation. Operations that have successfully
   536  	// been cancelled have Operation.error value with a google.rpc.Status.code of
   537  	// 1, corresponding to `Code.CANCELLED`.
   538  	RequestedCancellation bool `json:"requestedCancellation,omitempty"`
   539  	// StatusMessage: Output only. Human-readable status of the operation, if any.
   540  	StatusMessage string `json:"statusMessage,omitempty"`
   541  	// Target: Output only. Server-defined resource path for the target of the
   542  	// operation.
   543  	Target string `json:"target,omitempty"`
   544  	// Verb: Output only. Name of the verb executed by the operation.
   545  	Verb string `json:"verb,omitempty"`
   546  	// ForceSendFields is a list of field names (e.g. "ApiVersion") to
   547  	// unconditionally include in API requests. By default, fields with empty or
   548  	// default values are omitted from API requests. See
   549  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   550  	// details.
   551  	ForceSendFields []string `json:"-"`
   552  	// NullFields is a list of field names (e.g. "ApiVersion") to include in API
   553  	// requests with the JSON null value. By default, fields with empty values are
   554  	// omitted from API requests. See
   555  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   556  	NullFields []string `json:"-"`
   557  }
   558  
   559  func (s *OperationMetadata) MarshalJSON() ([]byte, error) {
   560  	type NoMethod OperationMetadata
   561  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   562  }
   563  
   564  // PauseCollectorRequest: Message for pausing a Collector.
   565  type PauseCollectorRequest struct {
   566  	// RequestId: Optional. An optional request ID to identify requests. Specify a
   567  	// unique request ID so that if you must retry your request, the server will
   568  	// know to ignore the request if it has already been completed. The server will
   569  	// guarantee that for at least 60 minutes after the first request. For example,
   570  	// consider a situation where you make an initial request and the request times
   571  	// out. If you make the request again with the same request ID, the server can
   572  	// check if original operation with the same request ID was received, and if
   573  	// so, will ignore the second request. This prevents clients from accidentally
   574  	// creating duplicate commitments. The request ID must be a valid UUID with the
   575  	// exception that zero UUID is not supported
   576  	// (00000000-0000-0000-0000-000000000000).
   577  	RequestId string `json:"requestId,omitempty"`
   578  	// ForceSendFields is a list of field names (e.g. "RequestId") to
   579  	// unconditionally include in API requests. By default, fields with empty or
   580  	// default values are omitted from API requests. See
   581  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   582  	// details.
   583  	ForceSendFields []string `json:"-"`
   584  	// NullFields is a list of field names (e.g. "RequestId") to include in API
   585  	// requests with the JSON null value. By default, fields with empty values are
   586  	// omitted from API requests. See
   587  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   588  	NullFields []string `json:"-"`
   589  }
   590  
   591  func (s *PauseCollectorRequest) MarshalJSON() ([]byte, error) {
   592  	type NoMethod PauseCollectorRequest
   593  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   594  }
   595  
   596  // RegisterCollectorRequest: Message for registering a Collector.
   597  type RegisterCollectorRequest struct {
   598  	// RequestId: Optional. An optional request ID to identify requests. Specify a
   599  	// unique request ID so that if you must retry your request, the server will
   600  	// know to ignore the request if it has already been completed. The server will
   601  	// guarantee that for at least 60 minutes after the first request. For example,
   602  	// consider a situation where you make an initial request and the request times
   603  	// out. If you make the request again with the same request ID, the server can
   604  	// check if original operation with the same request ID was received, and if
   605  	// so, will ignore the second request. This prevents clients from accidentally
   606  	// creating duplicate commitments. The request ID must be a valid UUID with the
   607  	// exception that zero UUID is not supported
   608  	// (00000000-0000-0000-0000-000000000000).
   609  	RequestId string `json:"requestId,omitempty"`
   610  	// ForceSendFields is a list of field names (e.g. "RequestId") to
   611  	// unconditionally include in API requests. By default, fields with empty or
   612  	// default values are omitted from API requests. See
   613  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   614  	// details.
   615  	ForceSendFields []string `json:"-"`
   616  	// NullFields is a list of field names (e.g. "RequestId") to include in API
   617  	// requests with the JSON null value. By default, fields with empty values are
   618  	// omitted from API requests. See
   619  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   620  	NullFields []string `json:"-"`
   621  }
   622  
   623  func (s *RegisterCollectorRequest) MarshalJSON() ([]byte, error) {
   624  	type NoMethod RegisterCollectorRequest
   625  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   626  }
   627  
   628  // ResumeCollectorRequest: Message for resuming a Collector.
   629  type ResumeCollectorRequest struct {
   630  	// RequestId: Optional. An optional request ID to identify requests. Specify a
   631  	// unique request ID so that if you must retry your request, the server will
   632  	// know to ignore the request if it has already been completed. The server will
   633  	// guarantee that for at least 60 minutes after the first request. For example,
   634  	// consider a situation where you make an initial request and the request times
   635  	// out. If you make the request again with the same request ID, the server can
   636  	// check if original operation with the same request ID was received, and if
   637  	// so, will ignore the second request. This prevents clients from accidentally
   638  	// creating duplicate commitments. The request ID must be a valid UUID with the
   639  	// exception that zero UUID is not supported
   640  	// (00000000-0000-0000-0000-000000000000).
   641  	RequestId string `json:"requestId,omitempty"`
   642  	// ForceSendFields is a list of field names (e.g. "RequestId") to
   643  	// unconditionally include in API requests. By default, fields with empty or
   644  	// default values are omitted from API requests. See
   645  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   646  	// details.
   647  	ForceSendFields []string `json:"-"`
   648  	// NullFields is a list of field names (e.g. "RequestId") to include in API
   649  	// requests with the JSON null value. By default, fields with empty values are
   650  	// omitted from API requests. See
   651  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   652  	NullFields []string `json:"-"`
   653  }
   654  
   655  func (s *ResumeCollectorRequest) MarshalJSON() ([]byte, error) {
   656  	type NoMethod ResumeCollectorRequest
   657  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   658  }
   659  
   660  // Status: The `Status` type defines a logical error model that is suitable for
   661  // different programming environments, including REST APIs and RPC APIs. It is
   662  // used by gRPC (https://github.com/grpc). Each `Status` message contains three
   663  // pieces of data: error code, error message, and error details. You can find
   664  // out more about this error model and how to work with it in the API Design
   665  // Guide (https://cloud.google.com/apis/design/errors).
   666  type Status struct {
   667  	// Code: The status code, which should be an enum value of google.rpc.Code.
   668  	Code int64 `json:"code,omitempty"`
   669  	// Details: A list of messages that carry the error details. There is a common
   670  	// set of message types for APIs to use.
   671  	Details []googleapi.RawMessage `json:"details,omitempty"`
   672  	// Message: A developer-facing error message, which should be in English. Any
   673  	// user-facing error message should be localized and sent in the
   674  	// google.rpc.Status.details field, or localized by the client.
   675  	Message string `json:"message,omitempty"`
   676  	// ForceSendFields is a list of field names (e.g. "Code") to unconditionally
   677  	// include in API requests. By default, fields with empty or default values are
   678  	// omitted from API requests. See
   679  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   680  	// details.
   681  	ForceSendFields []string `json:"-"`
   682  	// NullFields is a list of field names (e.g. "Code") to include in API requests
   683  	// with the JSON null value. By default, fields with empty values are omitted
   684  	// from API requests. See
   685  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   686  	NullFields []string `json:"-"`
   687  }
   688  
   689  func (s *Status) MarshalJSON() ([]byte, error) {
   690  	type NoMethod Status
   691  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   692  }
   693  
   694  // VSphereScan: Message describing a MC Source of type VSphere Scan.
   695  type VSphereScan struct {
   696  	// CoreSource: reference to the corresponding VSphere Scan in MC Source.
   697  	CoreSource string `json:"coreSource,omitempty"`
   698  	// ForceSendFields is a list of field names (e.g. "CoreSource") to
   699  	// unconditionally include in API requests. By default, fields with empty or
   700  	// default values are omitted from API requests. See
   701  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   702  	// details.
   703  	ForceSendFields []string `json:"-"`
   704  	// NullFields is a list of field names (e.g. "CoreSource") to include in API
   705  	// requests with the JSON null value. By default, fields with empty values are
   706  	// omitted from API requests. See
   707  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   708  	NullFields []string `json:"-"`
   709  }
   710  
   711  func (s *VSphereScan) MarshalJSON() ([]byte, error) {
   712  	type NoMethod VSphereScan
   713  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   714  }
   715  
   716  type ProjectsLocationsGetCall struct {
   717  	s            *Service
   718  	name         string
   719  	urlParams_   gensupport.URLParams
   720  	ifNoneMatch_ string
   721  	ctx_         context.Context
   722  	header_      http.Header
   723  }
   724  
   725  // Get: Gets information about a location.
   726  //
   727  // - name: Resource name for the location.
   728  func (r *ProjectsLocationsService) Get(name string) *ProjectsLocationsGetCall {
   729  	c := &ProjectsLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
   730  	c.name = name
   731  	return c
   732  }
   733  
   734  // Fields allows partial responses to be retrieved. See
   735  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
   736  // details.
   737  func (c *ProjectsLocationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGetCall {
   738  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
   739  	return c
   740  }
   741  
   742  // IfNoneMatch sets an optional parameter which makes the operation fail if the
   743  // object's ETag matches the given value. This is useful for getting updates
   744  // only after the object has changed since the last request.
   745  func (c *ProjectsLocationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGetCall {
   746  	c.ifNoneMatch_ = entityTag
   747  	return c
   748  }
   749  
   750  // Context sets the context to be used in this call's Do method.
   751  func (c *ProjectsLocationsGetCall) Context(ctx context.Context) *ProjectsLocationsGetCall {
   752  	c.ctx_ = ctx
   753  	return c
   754  }
   755  
   756  // Header returns a http.Header that can be modified by the caller to add
   757  // headers to the request.
   758  func (c *ProjectsLocationsGetCall) Header() http.Header {
   759  	if c.header_ == nil {
   760  		c.header_ = make(http.Header)
   761  	}
   762  	return c.header_
   763  }
   764  
   765  func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) {
   766  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
   767  	if c.ifNoneMatch_ != "" {
   768  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
   769  	}
   770  	var body io.Reader = nil
   771  	c.urlParams_.Set("alt", alt)
   772  	c.urlParams_.Set("prettyPrint", "false")
   773  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
   774  	urls += "?" + c.urlParams_.Encode()
   775  	req, err := http.NewRequest("GET", urls, body)
   776  	if err != nil {
   777  		return nil, err
   778  	}
   779  	req.Header = reqHeaders
   780  	googleapi.Expand(req.URL, map[string]string{
   781  		"name": c.name,
   782  	})
   783  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
   784  }
   785  
   786  // Do executes the "rapidmigrationassessment.projects.locations.get" call.
   787  // Any non-2xx status code is an error. Response headers are in either
   788  // *Location.ServerResponse.Header or (if a response was returned at all) in
   789  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
   790  // whether the returned error was because http.StatusNotModified was returned.
   791  func (c *ProjectsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) {
   792  	gensupport.SetOptions(c.urlParams_, opts...)
   793  	res, err := c.doRequest("json")
   794  	if res != nil && res.StatusCode == http.StatusNotModified {
   795  		if res.Body != nil {
   796  			res.Body.Close()
   797  		}
   798  		return nil, gensupport.WrapError(&googleapi.Error{
   799  			Code:   res.StatusCode,
   800  			Header: res.Header,
   801  		})
   802  	}
   803  	if err != nil {
   804  		return nil, err
   805  	}
   806  	defer googleapi.CloseBody(res)
   807  	if err := googleapi.CheckResponse(res); err != nil {
   808  		return nil, gensupport.WrapError(err)
   809  	}
   810  	ret := &Location{
   811  		ServerResponse: googleapi.ServerResponse{
   812  			Header:         res.Header,
   813  			HTTPStatusCode: res.StatusCode,
   814  		},
   815  	}
   816  	target := &ret
   817  	if err := gensupport.DecodeResponse(target, res); err != nil {
   818  		return nil, err
   819  	}
   820  	return ret, nil
   821  }
   822  
   823  type ProjectsLocationsListCall struct {
   824  	s            *Service
   825  	name         string
   826  	urlParams_   gensupport.URLParams
   827  	ifNoneMatch_ string
   828  	ctx_         context.Context
   829  	header_      http.Header
   830  }
   831  
   832  // List: Lists information about the supported locations for this service.
   833  //
   834  // - name: The resource that owns the locations collection, if applicable.
   835  func (r *ProjectsLocationsService) List(name string) *ProjectsLocationsListCall {
   836  	c := &ProjectsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
   837  	c.name = name
   838  	return c
   839  }
   840  
   841  // Filter sets the optional parameter "filter": A filter to narrow down results
   842  // to a preferred subset. The filtering language accepts strings like
   843  // "displayName=tokyo", and is documented in more detail in AIP-160
   844  // (https://google.aip.dev/160).
   845  func (c *ProjectsLocationsListCall) Filter(filter string) *ProjectsLocationsListCall {
   846  	c.urlParams_.Set("filter", filter)
   847  	return c
   848  }
   849  
   850  // PageSize sets the optional parameter "pageSize": The maximum number of
   851  // results to return. If not set, the service selects a default.
   852  func (c *ProjectsLocationsListCall) PageSize(pageSize int64) *ProjectsLocationsListCall {
   853  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
   854  	return c
   855  }
   856  
   857  // PageToken sets the optional parameter "pageToken": A page token received
   858  // from the `next_page_token` field in the response. Send that page token to
   859  // receive the subsequent page.
   860  func (c *ProjectsLocationsListCall) PageToken(pageToken string) *ProjectsLocationsListCall {
   861  	c.urlParams_.Set("pageToken", pageToken)
   862  	return c
   863  }
   864  
   865  // Fields allows partial responses to be retrieved. See
   866  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
   867  // details.
   868  func (c *ProjectsLocationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsListCall {
   869  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
   870  	return c
   871  }
   872  
   873  // IfNoneMatch sets an optional parameter which makes the operation fail if the
   874  // object's ETag matches the given value. This is useful for getting updates
   875  // only after the object has changed since the last request.
   876  func (c *ProjectsLocationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsListCall {
   877  	c.ifNoneMatch_ = entityTag
   878  	return c
   879  }
   880  
   881  // Context sets the context to be used in this call's Do method.
   882  func (c *ProjectsLocationsListCall) Context(ctx context.Context) *ProjectsLocationsListCall {
   883  	c.ctx_ = ctx
   884  	return c
   885  }
   886  
   887  // Header returns a http.Header that can be modified by the caller to add
   888  // headers to the request.
   889  func (c *ProjectsLocationsListCall) Header() http.Header {
   890  	if c.header_ == nil {
   891  		c.header_ = make(http.Header)
   892  	}
   893  	return c.header_
   894  }
   895  
   896  func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error) {
   897  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
   898  	if c.ifNoneMatch_ != "" {
   899  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
   900  	}
   901  	var body io.Reader = nil
   902  	c.urlParams_.Set("alt", alt)
   903  	c.urlParams_.Set("prettyPrint", "false")
   904  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations")
   905  	urls += "?" + c.urlParams_.Encode()
   906  	req, err := http.NewRequest("GET", urls, body)
   907  	if err != nil {
   908  		return nil, err
   909  	}
   910  	req.Header = reqHeaders
   911  	googleapi.Expand(req.URL, map[string]string{
   912  		"name": c.name,
   913  	})
   914  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
   915  }
   916  
   917  // Do executes the "rapidmigrationassessment.projects.locations.list" call.
   918  // Any non-2xx status code is an error. Response headers are in either
   919  // *ListLocationsResponse.ServerResponse.Header or (if a response was returned
   920  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
   921  // check whether the returned error was because http.StatusNotModified was
   922  // returned.
   923  func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) {
   924  	gensupport.SetOptions(c.urlParams_, opts...)
   925  	res, err := c.doRequest("json")
   926  	if res != nil && res.StatusCode == http.StatusNotModified {
   927  		if res.Body != nil {
   928  			res.Body.Close()
   929  		}
   930  		return nil, gensupport.WrapError(&googleapi.Error{
   931  			Code:   res.StatusCode,
   932  			Header: res.Header,
   933  		})
   934  	}
   935  	if err != nil {
   936  		return nil, err
   937  	}
   938  	defer googleapi.CloseBody(res)
   939  	if err := googleapi.CheckResponse(res); err != nil {
   940  		return nil, gensupport.WrapError(err)
   941  	}
   942  	ret := &ListLocationsResponse{
   943  		ServerResponse: googleapi.ServerResponse{
   944  			Header:         res.Header,
   945  			HTTPStatusCode: res.StatusCode,
   946  		},
   947  	}
   948  	target := &ret
   949  	if err := gensupport.DecodeResponse(target, res); err != nil {
   950  		return nil, err
   951  	}
   952  	return ret, nil
   953  }
   954  
   955  // Pages invokes f for each page of results.
   956  // A non-nil error returned from f will halt the iteration.
   957  // The provided context supersedes any context provided to the Context method.
   958  func (c *ProjectsLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error {
   959  	c.ctx_ = ctx
   960  	defer c.PageToken(c.urlParams_.Get("pageToken"))
   961  	for {
   962  		x, err := c.Do()
   963  		if err != nil {
   964  			return err
   965  		}
   966  		if err := f(x); err != nil {
   967  			return err
   968  		}
   969  		if x.NextPageToken == "" {
   970  			return nil
   971  		}
   972  		c.PageToken(x.NextPageToken)
   973  	}
   974  }
   975  
   976  type ProjectsLocationsAnnotationsCreateCall struct {
   977  	s          *Service
   978  	parent     string
   979  	annotation *Annotation
   980  	urlParams_ gensupport.URLParams
   981  	ctx_       context.Context
   982  	header_    http.Header
   983  }
   984  
   985  // Create: Creates an Annotation
   986  //
   987  // - parent: Name of the parent (project+location).
   988  func (r *ProjectsLocationsAnnotationsService) Create(parent string, annotation *Annotation) *ProjectsLocationsAnnotationsCreateCall {
   989  	c := &ProjectsLocationsAnnotationsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
   990  	c.parent = parent
   991  	c.annotation = annotation
   992  	return c
   993  }
   994  
   995  // RequestId sets the optional parameter "requestId": An optional request ID to
   996  // identify requests.
   997  func (c *ProjectsLocationsAnnotationsCreateCall) RequestId(requestId string) *ProjectsLocationsAnnotationsCreateCall {
   998  	c.urlParams_.Set("requestId", requestId)
   999  	return c
  1000  }
  1001  
  1002  // Fields allows partial responses to be retrieved. See
  1003  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1004  // details.
  1005  func (c *ProjectsLocationsAnnotationsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsAnnotationsCreateCall {
  1006  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1007  	return c
  1008  }
  1009  
  1010  // Context sets the context to be used in this call's Do method.
  1011  func (c *ProjectsLocationsAnnotationsCreateCall) Context(ctx context.Context) *ProjectsLocationsAnnotationsCreateCall {
  1012  	c.ctx_ = ctx
  1013  	return c
  1014  }
  1015  
  1016  // Header returns a http.Header that can be modified by the caller to add
  1017  // headers to the request.
  1018  func (c *ProjectsLocationsAnnotationsCreateCall) Header() http.Header {
  1019  	if c.header_ == nil {
  1020  		c.header_ = make(http.Header)
  1021  	}
  1022  	return c.header_
  1023  }
  1024  
  1025  func (c *ProjectsLocationsAnnotationsCreateCall) doRequest(alt string) (*http.Response, error) {
  1026  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1027  	var body io.Reader = nil
  1028  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.annotation)
  1029  	if err != nil {
  1030  		return nil, err
  1031  	}
  1032  	c.urlParams_.Set("alt", alt)
  1033  	c.urlParams_.Set("prettyPrint", "false")
  1034  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/annotations")
  1035  	urls += "?" + c.urlParams_.Encode()
  1036  	req, err := http.NewRequest("POST", urls, body)
  1037  	if err != nil {
  1038  		return nil, err
  1039  	}
  1040  	req.Header = reqHeaders
  1041  	googleapi.Expand(req.URL, map[string]string{
  1042  		"parent": c.parent,
  1043  	})
  1044  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1045  }
  1046  
  1047  // Do executes the "rapidmigrationassessment.projects.locations.annotations.create" call.
  1048  // Any non-2xx status code is an error. Response headers are in either
  1049  // *Operation.ServerResponse.Header or (if a response was returned at all) in
  1050  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1051  // whether the returned error was because http.StatusNotModified was returned.
  1052  func (c *ProjectsLocationsAnnotationsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  1053  	gensupport.SetOptions(c.urlParams_, opts...)
  1054  	res, err := c.doRequest("json")
  1055  	if res != nil && res.StatusCode == http.StatusNotModified {
  1056  		if res.Body != nil {
  1057  			res.Body.Close()
  1058  		}
  1059  		return nil, gensupport.WrapError(&googleapi.Error{
  1060  			Code:   res.StatusCode,
  1061  			Header: res.Header,
  1062  		})
  1063  	}
  1064  	if err != nil {
  1065  		return nil, err
  1066  	}
  1067  	defer googleapi.CloseBody(res)
  1068  	if err := googleapi.CheckResponse(res); err != nil {
  1069  		return nil, gensupport.WrapError(err)
  1070  	}
  1071  	ret := &Operation{
  1072  		ServerResponse: googleapi.ServerResponse{
  1073  			Header:         res.Header,
  1074  			HTTPStatusCode: res.StatusCode,
  1075  		},
  1076  	}
  1077  	target := &ret
  1078  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1079  		return nil, err
  1080  	}
  1081  	return ret, nil
  1082  }
  1083  
  1084  type ProjectsLocationsAnnotationsGetCall struct {
  1085  	s            *Service
  1086  	name         string
  1087  	urlParams_   gensupport.URLParams
  1088  	ifNoneMatch_ string
  1089  	ctx_         context.Context
  1090  	header_      http.Header
  1091  }
  1092  
  1093  // Get: Gets details of a single Annotation.
  1094  //
  1095  // - name: Name of the resource.
  1096  func (r *ProjectsLocationsAnnotationsService) Get(name string) *ProjectsLocationsAnnotationsGetCall {
  1097  	c := &ProjectsLocationsAnnotationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1098  	c.name = name
  1099  	return c
  1100  }
  1101  
  1102  // Fields allows partial responses to be retrieved. See
  1103  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1104  // details.
  1105  func (c *ProjectsLocationsAnnotationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsAnnotationsGetCall {
  1106  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1107  	return c
  1108  }
  1109  
  1110  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1111  // object's ETag matches the given value. This is useful for getting updates
  1112  // only after the object has changed since the last request.
  1113  func (c *ProjectsLocationsAnnotationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsAnnotationsGetCall {
  1114  	c.ifNoneMatch_ = entityTag
  1115  	return c
  1116  }
  1117  
  1118  // Context sets the context to be used in this call's Do method.
  1119  func (c *ProjectsLocationsAnnotationsGetCall) Context(ctx context.Context) *ProjectsLocationsAnnotationsGetCall {
  1120  	c.ctx_ = ctx
  1121  	return c
  1122  }
  1123  
  1124  // Header returns a http.Header that can be modified by the caller to add
  1125  // headers to the request.
  1126  func (c *ProjectsLocationsAnnotationsGetCall) Header() http.Header {
  1127  	if c.header_ == nil {
  1128  		c.header_ = make(http.Header)
  1129  	}
  1130  	return c.header_
  1131  }
  1132  
  1133  func (c *ProjectsLocationsAnnotationsGetCall) doRequest(alt string) (*http.Response, error) {
  1134  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1135  	if c.ifNoneMatch_ != "" {
  1136  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1137  	}
  1138  	var body io.Reader = nil
  1139  	c.urlParams_.Set("alt", alt)
  1140  	c.urlParams_.Set("prettyPrint", "false")
  1141  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  1142  	urls += "?" + c.urlParams_.Encode()
  1143  	req, err := http.NewRequest("GET", urls, body)
  1144  	if err != nil {
  1145  		return nil, err
  1146  	}
  1147  	req.Header = reqHeaders
  1148  	googleapi.Expand(req.URL, map[string]string{
  1149  		"name": c.name,
  1150  	})
  1151  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1152  }
  1153  
  1154  // Do executes the "rapidmigrationassessment.projects.locations.annotations.get" call.
  1155  // Any non-2xx status code is an error. Response headers are in either
  1156  // *Annotation.ServerResponse.Header or (if a response was returned at all) in
  1157  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1158  // whether the returned error was because http.StatusNotModified was returned.
  1159  func (c *ProjectsLocationsAnnotationsGetCall) Do(opts ...googleapi.CallOption) (*Annotation, error) {
  1160  	gensupport.SetOptions(c.urlParams_, opts...)
  1161  	res, err := c.doRequest("json")
  1162  	if res != nil && res.StatusCode == http.StatusNotModified {
  1163  		if res.Body != nil {
  1164  			res.Body.Close()
  1165  		}
  1166  		return nil, gensupport.WrapError(&googleapi.Error{
  1167  			Code:   res.StatusCode,
  1168  			Header: res.Header,
  1169  		})
  1170  	}
  1171  	if err != nil {
  1172  		return nil, err
  1173  	}
  1174  	defer googleapi.CloseBody(res)
  1175  	if err := googleapi.CheckResponse(res); err != nil {
  1176  		return nil, gensupport.WrapError(err)
  1177  	}
  1178  	ret := &Annotation{
  1179  		ServerResponse: googleapi.ServerResponse{
  1180  			Header:         res.Header,
  1181  			HTTPStatusCode: res.StatusCode,
  1182  		},
  1183  	}
  1184  	target := &ret
  1185  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1186  		return nil, err
  1187  	}
  1188  	return ret, nil
  1189  }
  1190  
  1191  type ProjectsLocationsCollectorsCreateCall struct {
  1192  	s          *Service
  1193  	parent     string
  1194  	collector  *Collector
  1195  	urlParams_ gensupport.URLParams
  1196  	ctx_       context.Context
  1197  	header_    http.Header
  1198  }
  1199  
  1200  // Create: Create a Collector to manage the on-prem appliance which collects
  1201  // information about Customer assets.
  1202  //
  1203  // - parent: Name of the parent (project+location).
  1204  func (r *ProjectsLocationsCollectorsService) Create(parent string, collector *Collector) *ProjectsLocationsCollectorsCreateCall {
  1205  	c := &ProjectsLocationsCollectorsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1206  	c.parent = parent
  1207  	c.collector = collector
  1208  	return c
  1209  }
  1210  
  1211  // CollectorId sets the optional parameter "collectorId": Required. Id of the
  1212  // requesting object.
  1213  func (c *ProjectsLocationsCollectorsCreateCall) CollectorId(collectorId string) *ProjectsLocationsCollectorsCreateCall {
  1214  	c.urlParams_.Set("collectorId", collectorId)
  1215  	return c
  1216  }
  1217  
  1218  // RequestId sets the optional parameter "requestId": An optional request ID to
  1219  // identify requests.
  1220  func (c *ProjectsLocationsCollectorsCreateCall) RequestId(requestId string) *ProjectsLocationsCollectorsCreateCall {
  1221  	c.urlParams_.Set("requestId", requestId)
  1222  	return c
  1223  }
  1224  
  1225  // Fields allows partial responses to be retrieved. See
  1226  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1227  // details.
  1228  func (c *ProjectsLocationsCollectorsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectorsCreateCall {
  1229  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1230  	return c
  1231  }
  1232  
  1233  // Context sets the context to be used in this call's Do method.
  1234  func (c *ProjectsLocationsCollectorsCreateCall) Context(ctx context.Context) *ProjectsLocationsCollectorsCreateCall {
  1235  	c.ctx_ = ctx
  1236  	return c
  1237  }
  1238  
  1239  // Header returns a http.Header that can be modified by the caller to add
  1240  // headers to the request.
  1241  func (c *ProjectsLocationsCollectorsCreateCall) Header() http.Header {
  1242  	if c.header_ == nil {
  1243  		c.header_ = make(http.Header)
  1244  	}
  1245  	return c.header_
  1246  }
  1247  
  1248  func (c *ProjectsLocationsCollectorsCreateCall) doRequest(alt string) (*http.Response, error) {
  1249  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1250  	var body io.Reader = nil
  1251  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.collector)
  1252  	if err != nil {
  1253  		return nil, err
  1254  	}
  1255  	c.urlParams_.Set("alt", alt)
  1256  	c.urlParams_.Set("prettyPrint", "false")
  1257  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/collectors")
  1258  	urls += "?" + c.urlParams_.Encode()
  1259  	req, err := http.NewRequest("POST", urls, body)
  1260  	if err != nil {
  1261  		return nil, err
  1262  	}
  1263  	req.Header = reqHeaders
  1264  	googleapi.Expand(req.URL, map[string]string{
  1265  		"parent": c.parent,
  1266  	})
  1267  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1268  }
  1269  
  1270  // Do executes the "rapidmigrationassessment.projects.locations.collectors.create" call.
  1271  // Any non-2xx status code is an error. Response headers are in either
  1272  // *Operation.ServerResponse.Header or (if a response was returned at all) in
  1273  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1274  // whether the returned error was because http.StatusNotModified was returned.
  1275  func (c *ProjectsLocationsCollectorsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  1276  	gensupport.SetOptions(c.urlParams_, opts...)
  1277  	res, err := c.doRequest("json")
  1278  	if res != nil && res.StatusCode == http.StatusNotModified {
  1279  		if res.Body != nil {
  1280  			res.Body.Close()
  1281  		}
  1282  		return nil, gensupport.WrapError(&googleapi.Error{
  1283  			Code:   res.StatusCode,
  1284  			Header: res.Header,
  1285  		})
  1286  	}
  1287  	if err != nil {
  1288  		return nil, err
  1289  	}
  1290  	defer googleapi.CloseBody(res)
  1291  	if err := googleapi.CheckResponse(res); err != nil {
  1292  		return nil, gensupport.WrapError(err)
  1293  	}
  1294  	ret := &Operation{
  1295  		ServerResponse: googleapi.ServerResponse{
  1296  			Header:         res.Header,
  1297  			HTTPStatusCode: res.StatusCode,
  1298  		},
  1299  	}
  1300  	target := &ret
  1301  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1302  		return nil, err
  1303  	}
  1304  	return ret, nil
  1305  }
  1306  
  1307  type ProjectsLocationsCollectorsDeleteCall struct {
  1308  	s          *Service
  1309  	name       string
  1310  	urlParams_ gensupport.URLParams
  1311  	ctx_       context.Context
  1312  	header_    http.Header
  1313  }
  1314  
  1315  // Delete: Deletes a single Collector - changes state of collector to
  1316  // "Deleting". Background jobs does final deletion thorugh producer api.
  1317  //
  1318  // - name: Name of the resource.
  1319  func (r *ProjectsLocationsCollectorsService) Delete(name string) *ProjectsLocationsCollectorsDeleteCall {
  1320  	c := &ProjectsLocationsCollectorsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1321  	c.name = name
  1322  	return c
  1323  }
  1324  
  1325  // RequestId sets the optional parameter "requestId": An optional request ID to
  1326  // identify requests. Specify a unique request ID so that if you must retry
  1327  // your request, the server will know to ignore the request if it has already
  1328  // been completed. The server will guarantee that for at least 60 minutes after
  1329  // the first request. For example, consider a situation where you make an
  1330  // initial request and the request times out. If you make the request again
  1331  // with the same request ID, the server can check if original operation with
  1332  // the same request ID was received, and if so, will ignore the second request.
  1333  // This prevents clients from accidentally creating duplicate commitments. The
  1334  // request ID must be a valid UUID with the exception that zero UUID is not
  1335  // supported (00000000-0000-0000-0000-000000000000).
  1336  func (c *ProjectsLocationsCollectorsDeleteCall) RequestId(requestId string) *ProjectsLocationsCollectorsDeleteCall {
  1337  	c.urlParams_.Set("requestId", requestId)
  1338  	return c
  1339  }
  1340  
  1341  // Fields allows partial responses to be retrieved. See
  1342  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1343  // details.
  1344  func (c *ProjectsLocationsCollectorsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectorsDeleteCall {
  1345  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1346  	return c
  1347  }
  1348  
  1349  // Context sets the context to be used in this call's Do method.
  1350  func (c *ProjectsLocationsCollectorsDeleteCall) Context(ctx context.Context) *ProjectsLocationsCollectorsDeleteCall {
  1351  	c.ctx_ = ctx
  1352  	return c
  1353  }
  1354  
  1355  // Header returns a http.Header that can be modified by the caller to add
  1356  // headers to the request.
  1357  func (c *ProjectsLocationsCollectorsDeleteCall) Header() http.Header {
  1358  	if c.header_ == nil {
  1359  		c.header_ = make(http.Header)
  1360  	}
  1361  	return c.header_
  1362  }
  1363  
  1364  func (c *ProjectsLocationsCollectorsDeleteCall) doRequest(alt string) (*http.Response, error) {
  1365  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1366  	var body io.Reader = nil
  1367  	c.urlParams_.Set("alt", alt)
  1368  	c.urlParams_.Set("prettyPrint", "false")
  1369  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  1370  	urls += "?" + c.urlParams_.Encode()
  1371  	req, err := http.NewRequest("DELETE", urls, body)
  1372  	if err != nil {
  1373  		return nil, err
  1374  	}
  1375  	req.Header = reqHeaders
  1376  	googleapi.Expand(req.URL, map[string]string{
  1377  		"name": c.name,
  1378  	})
  1379  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1380  }
  1381  
  1382  // Do executes the "rapidmigrationassessment.projects.locations.collectors.delete" call.
  1383  // Any non-2xx status code is an error. Response headers are in either
  1384  // *Operation.ServerResponse.Header or (if a response was returned at all) in
  1385  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1386  // whether the returned error was because http.StatusNotModified was returned.
  1387  func (c *ProjectsLocationsCollectorsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  1388  	gensupport.SetOptions(c.urlParams_, opts...)
  1389  	res, err := c.doRequest("json")
  1390  	if res != nil && res.StatusCode == http.StatusNotModified {
  1391  		if res.Body != nil {
  1392  			res.Body.Close()
  1393  		}
  1394  		return nil, gensupport.WrapError(&googleapi.Error{
  1395  			Code:   res.StatusCode,
  1396  			Header: res.Header,
  1397  		})
  1398  	}
  1399  	if err != nil {
  1400  		return nil, err
  1401  	}
  1402  	defer googleapi.CloseBody(res)
  1403  	if err := googleapi.CheckResponse(res); err != nil {
  1404  		return nil, gensupport.WrapError(err)
  1405  	}
  1406  	ret := &Operation{
  1407  		ServerResponse: googleapi.ServerResponse{
  1408  			Header:         res.Header,
  1409  			HTTPStatusCode: res.StatusCode,
  1410  		},
  1411  	}
  1412  	target := &ret
  1413  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1414  		return nil, err
  1415  	}
  1416  	return ret, nil
  1417  }
  1418  
  1419  type ProjectsLocationsCollectorsGetCall struct {
  1420  	s            *Service
  1421  	name         string
  1422  	urlParams_   gensupport.URLParams
  1423  	ifNoneMatch_ string
  1424  	ctx_         context.Context
  1425  	header_      http.Header
  1426  }
  1427  
  1428  // Get: Gets details of a single Collector.
  1429  //
  1430  // - name: Name of the resource.
  1431  func (r *ProjectsLocationsCollectorsService) Get(name string) *ProjectsLocationsCollectorsGetCall {
  1432  	c := &ProjectsLocationsCollectorsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1433  	c.name = name
  1434  	return c
  1435  }
  1436  
  1437  // Fields allows partial responses to be retrieved. See
  1438  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1439  // details.
  1440  func (c *ProjectsLocationsCollectorsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectorsGetCall {
  1441  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1442  	return c
  1443  }
  1444  
  1445  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1446  // object's ETag matches the given value. This is useful for getting updates
  1447  // only after the object has changed since the last request.
  1448  func (c *ProjectsLocationsCollectorsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectorsGetCall {
  1449  	c.ifNoneMatch_ = entityTag
  1450  	return c
  1451  }
  1452  
  1453  // Context sets the context to be used in this call's Do method.
  1454  func (c *ProjectsLocationsCollectorsGetCall) Context(ctx context.Context) *ProjectsLocationsCollectorsGetCall {
  1455  	c.ctx_ = ctx
  1456  	return c
  1457  }
  1458  
  1459  // Header returns a http.Header that can be modified by the caller to add
  1460  // headers to the request.
  1461  func (c *ProjectsLocationsCollectorsGetCall) Header() http.Header {
  1462  	if c.header_ == nil {
  1463  		c.header_ = make(http.Header)
  1464  	}
  1465  	return c.header_
  1466  }
  1467  
  1468  func (c *ProjectsLocationsCollectorsGetCall) doRequest(alt string) (*http.Response, error) {
  1469  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1470  	if c.ifNoneMatch_ != "" {
  1471  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1472  	}
  1473  	var body io.Reader = nil
  1474  	c.urlParams_.Set("alt", alt)
  1475  	c.urlParams_.Set("prettyPrint", "false")
  1476  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  1477  	urls += "?" + c.urlParams_.Encode()
  1478  	req, err := http.NewRequest("GET", urls, body)
  1479  	if err != nil {
  1480  		return nil, err
  1481  	}
  1482  	req.Header = reqHeaders
  1483  	googleapi.Expand(req.URL, map[string]string{
  1484  		"name": c.name,
  1485  	})
  1486  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1487  }
  1488  
  1489  // Do executes the "rapidmigrationassessment.projects.locations.collectors.get" call.
  1490  // Any non-2xx status code is an error. Response headers are in either
  1491  // *Collector.ServerResponse.Header or (if a response was returned at all) in
  1492  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1493  // whether the returned error was because http.StatusNotModified was returned.
  1494  func (c *ProjectsLocationsCollectorsGetCall) Do(opts ...googleapi.CallOption) (*Collector, error) {
  1495  	gensupport.SetOptions(c.urlParams_, opts...)
  1496  	res, err := c.doRequest("json")
  1497  	if res != nil && res.StatusCode == http.StatusNotModified {
  1498  		if res.Body != nil {
  1499  			res.Body.Close()
  1500  		}
  1501  		return nil, gensupport.WrapError(&googleapi.Error{
  1502  			Code:   res.StatusCode,
  1503  			Header: res.Header,
  1504  		})
  1505  	}
  1506  	if err != nil {
  1507  		return nil, err
  1508  	}
  1509  	defer googleapi.CloseBody(res)
  1510  	if err := googleapi.CheckResponse(res); err != nil {
  1511  		return nil, gensupport.WrapError(err)
  1512  	}
  1513  	ret := &Collector{
  1514  		ServerResponse: googleapi.ServerResponse{
  1515  			Header:         res.Header,
  1516  			HTTPStatusCode: res.StatusCode,
  1517  		},
  1518  	}
  1519  	target := &ret
  1520  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1521  		return nil, err
  1522  	}
  1523  	return ret, nil
  1524  }
  1525  
  1526  type ProjectsLocationsCollectorsListCall struct {
  1527  	s            *Service
  1528  	parent       string
  1529  	urlParams_   gensupport.URLParams
  1530  	ifNoneMatch_ string
  1531  	ctx_         context.Context
  1532  	header_      http.Header
  1533  }
  1534  
  1535  // List: Lists Collectors in a given project and location.
  1536  //
  1537  // - parent: Parent value for ListCollectorsRequest.
  1538  func (r *ProjectsLocationsCollectorsService) List(parent string) *ProjectsLocationsCollectorsListCall {
  1539  	c := &ProjectsLocationsCollectorsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1540  	c.parent = parent
  1541  	return c
  1542  }
  1543  
  1544  // Filter sets the optional parameter "filter": Filtering results.
  1545  func (c *ProjectsLocationsCollectorsListCall) Filter(filter string) *ProjectsLocationsCollectorsListCall {
  1546  	c.urlParams_.Set("filter", filter)
  1547  	return c
  1548  }
  1549  
  1550  // OrderBy sets the optional parameter "orderBy": Hint for how to order the
  1551  // results.
  1552  func (c *ProjectsLocationsCollectorsListCall) OrderBy(orderBy string) *ProjectsLocationsCollectorsListCall {
  1553  	c.urlParams_.Set("orderBy", orderBy)
  1554  	return c
  1555  }
  1556  
  1557  // PageSize sets the optional parameter "pageSize": Requested page size. Server
  1558  // may return fewer items than requested. If unspecified, server will pick an
  1559  // appropriate default.
  1560  func (c *ProjectsLocationsCollectorsListCall) PageSize(pageSize int64) *ProjectsLocationsCollectorsListCall {
  1561  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  1562  	return c
  1563  }
  1564  
  1565  // PageToken sets the optional parameter "pageToken": A token identifying a
  1566  // page of results the server should return.
  1567  func (c *ProjectsLocationsCollectorsListCall) PageToken(pageToken string) *ProjectsLocationsCollectorsListCall {
  1568  	c.urlParams_.Set("pageToken", pageToken)
  1569  	return c
  1570  }
  1571  
  1572  // Fields allows partial responses to be retrieved. See
  1573  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1574  // details.
  1575  func (c *ProjectsLocationsCollectorsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectorsListCall {
  1576  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1577  	return c
  1578  }
  1579  
  1580  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1581  // object's ETag matches the given value. This is useful for getting updates
  1582  // only after the object has changed since the last request.
  1583  func (c *ProjectsLocationsCollectorsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectorsListCall {
  1584  	c.ifNoneMatch_ = entityTag
  1585  	return c
  1586  }
  1587  
  1588  // Context sets the context to be used in this call's Do method.
  1589  func (c *ProjectsLocationsCollectorsListCall) Context(ctx context.Context) *ProjectsLocationsCollectorsListCall {
  1590  	c.ctx_ = ctx
  1591  	return c
  1592  }
  1593  
  1594  // Header returns a http.Header that can be modified by the caller to add
  1595  // headers to the request.
  1596  func (c *ProjectsLocationsCollectorsListCall) Header() http.Header {
  1597  	if c.header_ == nil {
  1598  		c.header_ = make(http.Header)
  1599  	}
  1600  	return c.header_
  1601  }
  1602  
  1603  func (c *ProjectsLocationsCollectorsListCall) doRequest(alt string) (*http.Response, error) {
  1604  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1605  	if c.ifNoneMatch_ != "" {
  1606  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1607  	}
  1608  	var body io.Reader = nil
  1609  	c.urlParams_.Set("alt", alt)
  1610  	c.urlParams_.Set("prettyPrint", "false")
  1611  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/collectors")
  1612  	urls += "?" + c.urlParams_.Encode()
  1613  	req, err := http.NewRequest("GET", urls, body)
  1614  	if err != nil {
  1615  		return nil, err
  1616  	}
  1617  	req.Header = reqHeaders
  1618  	googleapi.Expand(req.URL, map[string]string{
  1619  		"parent": c.parent,
  1620  	})
  1621  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1622  }
  1623  
  1624  // Do executes the "rapidmigrationassessment.projects.locations.collectors.list" call.
  1625  // Any non-2xx status code is an error. Response headers are in either
  1626  // *ListCollectorsResponse.ServerResponse.Header or (if a response was returned
  1627  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1628  // check whether the returned error was because http.StatusNotModified was
  1629  // returned.
  1630  func (c *ProjectsLocationsCollectorsListCall) Do(opts ...googleapi.CallOption) (*ListCollectorsResponse, error) {
  1631  	gensupport.SetOptions(c.urlParams_, opts...)
  1632  	res, err := c.doRequest("json")
  1633  	if res != nil && res.StatusCode == http.StatusNotModified {
  1634  		if res.Body != nil {
  1635  			res.Body.Close()
  1636  		}
  1637  		return nil, gensupport.WrapError(&googleapi.Error{
  1638  			Code:   res.StatusCode,
  1639  			Header: res.Header,
  1640  		})
  1641  	}
  1642  	if err != nil {
  1643  		return nil, err
  1644  	}
  1645  	defer googleapi.CloseBody(res)
  1646  	if err := googleapi.CheckResponse(res); err != nil {
  1647  		return nil, gensupport.WrapError(err)
  1648  	}
  1649  	ret := &ListCollectorsResponse{
  1650  		ServerResponse: googleapi.ServerResponse{
  1651  			Header:         res.Header,
  1652  			HTTPStatusCode: res.StatusCode,
  1653  		},
  1654  	}
  1655  	target := &ret
  1656  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1657  		return nil, err
  1658  	}
  1659  	return ret, nil
  1660  }
  1661  
  1662  // Pages invokes f for each page of results.
  1663  // A non-nil error returned from f will halt the iteration.
  1664  // The provided context supersedes any context provided to the Context method.
  1665  func (c *ProjectsLocationsCollectorsListCall) Pages(ctx context.Context, f func(*ListCollectorsResponse) error) error {
  1666  	c.ctx_ = ctx
  1667  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  1668  	for {
  1669  		x, err := c.Do()
  1670  		if err != nil {
  1671  			return err
  1672  		}
  1673  		if err := f(x); err != nil {
  1674  			return err
  1675  		}
  1676  		if x.NextPageToken == "" {
  1677  			return nil
  1678  		}
  1679  		c.PageToken(x.NextPageToken)
  1680  	}
  1681  }
  1682  
  1683  type ProjectsLocationsCollectorsPatchCall struct {
  1684  	s          *Service
  1685  	name       string
  1686  	collector  *Collector
  1687  	urlParams_ gensupport.URLParams
  1688  	ctx_       context.Context
  1689  	header_    http.Header
  1690  }
  1691  
  1692  // Patch: Updates the parameters of a single Collector.
  1693  //
  1694  // - name: name of resource.
  1695  func (r *ProjectsLocationsCollectorsService) Patch(name string, collector *Collector) *ProjectsLocationsCollectorsPatchCall {
  1696  	c := &ProjectsLocationsCollectorsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1697  	c.name = name
  1698  	c.collector = collector
  1699  	return c
  1700  }
  1701  
  1702  // RequestId sets the optional parameter "requestId": An optional request ID to
  1703  // identify requests. Specify a unique request ID so that if you must retry
  1704  // your request, the server will know to ignore the request if it has already
  1705  // been completed. The server will guarantee that for at least 60 minutes since
  1706  // the first request. For example, consider a situation where you make an
  1707  // initial request and the request times out. If you make the request again
  1708  // with the same request ID, the server can check if original operation with
  1709  // the same request ID was received, and if so, will ignore the second request.
  1710  // This prevents clients from accidentally creating duplicate commitments. The
  1711  // request ID must be a valid UUID with the exception that zero UUID is not
  1712  // supported (00000000-0000-0000-0000-000000000000).
  1713  func (c *ProjectsLocationsCollectorsPatchCall) RequestId(requestId string) *ProjectsLocationsCollectorsPatchCall {
  1714  	c.urlParams_.Set("requestId", requestId)
  1715  	return c
  1716  }
  1717  
  1718  // UpdateMask sets the optional parameter "updateMask": Required. Field mask is
  1719  // used to specify the fields to be overwritten in the Collector resource by
  1720  // the update. The fields specified in the update_mask are relative to the
  1721  // resource, not the full request. A field will be overwritten if it is in the
  1722  // mask. If the user does not provide a mask then all fields will be
  1723  // overwritten.
  1724  func (c *ProjectsLocationsCollectorsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsCollectorsPatchCall {
  1725  	c.urlParams_.Set("updateMask", updateMask)
  1726  	return c
  1727  }
  1728  
  1729  // Fields allows partial responses to be retrieved. See
  1730  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1731  // details.
  1732  func (c *ProjectsLocationsCollectorsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectorsPatchCall {
  1733  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1734  	return c
  1735  }
  1736  
  1737  // Context sets the context to be used in this call's Do method.
  1738  func (c *ProjectsLocationsCollectorsPatchCall) Context(ctx context.Context) *ProjectsLocationsCollectorsPatchCall {
  1739  	c.ctx_ = ctx
  1740  	return c
  1741  }
  1742  
  1743  // Header returns a http.Header that can be modified by the caller to add
  1744  // headers to the request.
  1745  func (c *ProjectsLocationsCollectorsPatchCall) Header() http.Header {
  1746  	if c.header_ == nil {
  1747  		c.header_ = make(http.Header)
  1748  	}
  1749  	return c.header_
  1750  }
  1751  
  1752  func (c *ProjectsLocationsCollectorsPatchCall) doRequest(alt string) (*http.Response, error) {
  1753  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1754  	var body io.Reader = nil
  1755  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.collector)
  1756  	if err != nil {
  1757  		return nil, err
  1758  	}
  1759  	c.urlParams_.Set("alt", alt)
  1760  	c.urlParams_.Set("prettyPrint", "false")
  1761  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  1762  	urls += "?" + c.urlParams_.Encode()
  1763  	req, err := http.NewRequest("PATCH", urls, body)
  1764  	if err != nil {
  1765  		return nil, err
  1766  	}
  1767  	req.Header = reqHeaders
  1768  	googleapi.Expand(req.URL, map[string]string{
  1769  		"name": c.name,
  1770  	})
  1771  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1772  }
  1773  
  1774  // Do executes the "rapidmigrationassessment.projects.locations.collectors.patch" call.
  1775  // Any non-2xx status code is an error. Response headers are in either
  1776  // *Operation.ServerResponse.Header or (if a response was returned at all) in
  1777  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1778  // whether the returned error was because http.StatusNotModified was returned.
  1779  func (c *ProjectsLocationsCollectorsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  1780  	gensupport.SetOptions(c.urlParams_, opts...)
  1781  	res, err := c.doRequest("json")
  1782  	if res != nil && res.StatusCode == http.StatusNotModified {
  1783  		if res.Body != nil {
  1784  			res.Body.Close()
  1785  		}
  1786  		return nil, gensupport.WrapError(&googleapi.Error{
  1787  			Code:   res.StatusCode,
  1788  			Header: res.Header,
  1789  		})
  1790  	}
  1791  	if err != nil {
  1792  		return nil, err
  1793  	}
  1794  	defer googleapi.CloseBody(res)
  1795  	if err := googleapi.CheckResponse(res); err != nil {
  1796  		return nil, gensupport.WrapError(err)
  1797  	}
  1798  	ret := &Operation{
  1799  		ServerResponse: googleapi.ServerResponse{
  1800  			Header:         res.Header,
  1801  			HTTPStatusCode: res.StatusCode,
  1802  		},
  1803  	}
  1804  	target := &ret
  1805  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1806  		return nil, err
  1807  	}
  1808  	return ret, nil
  1809  }
  1810  
  1811  type ProjectsLocationsCollectorsPauseCall struct {
  1812  	s                     *Service
  1813  	name                  string
  1814  	pausecollectorrequest *PauseCollectorRequest
  1815  	urlParams_            gensupport.URLParams
  1816  	ctx_                  context.Context
  1817  	header_               http.Header
  1818  }
  1819  
  1820  // Pause: Pauses the given collector.
  1821  //
  1822  // - name: Name of the resource.
  1823  func (r *ProjectsLocationsCollectorsService) Pause(name string, pausecollectorrequest *PauseCollectorRequest) *ProjectsLocationsCollectorsPauseCall {
  1824  	c := &ProjectsLocationsCollectorsPauseCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1825  	c.name = name
  1826  	c.pausecollectorrequest = pausecollectorrequest
  1827  	return c
  1828  }
  1829  
  1830  // Fields allows partial responses to be retrieved. See
  1831  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1832  // details.
  1833  func (c *ProjectsLocationsCollectorsPauseCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectorsPauseCall {
  1834  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1835  	return c
  1836  }
  1837  
  1838  // Context sets the context to be used in this call's Do method.
  1839  func (c *ProjectsLocationsCollectorsPauseCall) Context(ctx context.Context) *ProjectsLocationsCollectorsPauseCall {
  1840  	c.ctx_ = ctx
  1841  	return c
  1842  }
  1843  
  1844  // Header returns a http.Header that can be modified by the caller to add
  1845  // headers to the request.
  1846  func (c *ProjectsLocationsCollectorsPauseCall) Header() http.Header {
  1847  	if c.header_ == nil {
  1848  		c.header_ = make(http.Header)
  1849  	}
  1850  	return c.header_
  1851  }
  1852  
  1853  func (c *ProjectsLocationsCollectorsPauseCall) doRequest(alt string) (*http.Response, error) {
  1854  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1855  	var body io.Reader = nil
  1856  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.pausecollectorrequest)
  1857  	if err != nil {
  1858  		return nil, err
  1859  	}
  1860  	c.urlParams_.Set("alt", alt)
  1861  	c.urlParams_.Set("prettyPrint", "false")
  1862  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:pause")
  1863  	urls += "?" + c.urlParams_.Encode()
  1864  	req, err := http.NewRequest("POST", urls, body)
  1865  	if err != nil {
  1866  		return nil, err
  1867  	}
  1868  	req.Header = reqHeaders
  1869  	googleapi.Expand(req.URL, map[string]string{
  1870  		"name": c.name,
  1871  	})
  1872  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1873  }
  1874  
  1875  // Do executes the "rapidmigrationassessment.projects.locations.collectors.pause" call.
  1876  // Any non-2xx status code is an error. Response headers are in either
  1877  // *Operation.ServerResponse.Header or (if a response was returned at all) in
  1878  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1879  // whether the returned error was because http.StatusNotModified was returned.
  1880  func (c *ProjectsLocationsCollectorsPauseCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  1881  	gensupport.SetOptions(c.urlParams_, opts...)
  1882  	res, err := c.doRequest("json")
  1883  	if res != nil && res.StatusCode == http.StatusNotModified {
  1884  		if res.Body != nil {
  1885  			res.Body.Close()
  1886  		}
  1887  		return nil, gensupport.WrapError(&googleapi.Error{
  1888  			Code:   res.StatusCode,
  1889  			Header: res.Header,
  1890  		})
  1891  	}
  1892  	if err != nil {
  1893  		return nil, err
  1894  	}
  1895  	defer googleapi.CloseBody(res)
  1896  	if err := googleapi.CheckResponse(res); err != nil {
  1897  		return nil, gensupport.WrapError(err)
  1898  	}
  1899  	ret := &Operation{
  1900  		ServerResponse: googleapi.ServerResponse{
  1901  			Header:         res.Header,
  1902  			HTTPStatusCode: res.StatusCode,
  1903  		},
  1904  	}
  1905  	target := &ret
  1906  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1907  		return nil, err
  1908  	}
  1909  	return ret, nil
  1910  }
  1911  
  1912  type ProjectsLocationsCollectorsRegisterCall struct {
  1913  	s                        *Service
  1914  	name                     string
  1915  	registercollectorrequest *RegisterCollectorRequest
  1916  	urlParams_               gensupport.URLParams
  1917  	ctx_                     context.Context
  1918  	header_                  http.Header
  1919  }
  1920  
  1921  // Register: Registers the given collector.
  1922  //
  1923  // - name: Name of the resource.
  1924  func (r *ProjectsLocationsCollectorsService) Register(name string, registercollectorrequest *RegisterCollectorRequest) *ProjectsLocationsCollectorsRegisterCall {
  1925  	c := &ProjectsLocationsCollectorsRegisterCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1926  	c.name = name
  1927  	c.registercollectorrequest = registercollectorrequest
  1928  	return c
  1929  }
  1930  
  1931  // Fields allows partial responses to be retrieved. See
  1932  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1933  // details.
  1934  func (c *ProjectsLocationsCollectorsRegisterCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectorsRegisterCall {
  1935  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1936  	return c
  1937  }
  1938  
  1939  // Context sets the context to be used in this call's Do method.
  1940  func (c *ProjectsLocationsCollectorsRegisterCall) Context(ctx context.Context) *ProjectsLocationsCollectorsRegisterCall {
  1941  	c.ctx_ = ctx
  1942  	return c
  1943  }
  1944  
  1945  // Header returns a http.Header that can be modified by the caller to add
  1946  // headers to the request.
  1947  func (c *ProjectsLocationsCollectorsRegisterCall) Header() http.Header {
  1948  	if c.header_ == nil {
  1949  		c.header_ = make(http.Header)
  1950  	}
  1951  	return c.header_
  1952  }
  1953  
  1954  func (c *ProjectsLocationsCollectorsRegisterCall) doRequest(alt string) (*http.Response, error) {
  1955  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1956  	var body io.Reader = nil
  1957  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.registercollectorrequest)
  1958  	if err != nil {
  1959  		return nil, err
  1960  	}
  1961  	c.urlParams_.Set("alt", alt)
  1962  	c.urlParams_.Set("prettyPrint", "false")
  1963  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:register")
  1964  	urls += "?" + c.urlParams_.Encode()
  1965  	req, err := http.NewRequest("POST", urls, body)
  1966  	if err != nil {
  1967  		return nil, err
  1968  	}
  1969  	req.Header = reqHeaders
  1970  	googleapi.Expand(req.URL, map[string]string{
  1971  		"name": c.name,
  1972  	})
  1973  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1974  }
  1975  
  1976  // Do executes the "rapidmigrationassessment.projects.locations.collectors.register" call.
  1977  // Any non-2xx status code is an error. Response headers are in either
  1978  // *Operation.ServerResponse.Header or (if a response was returned at all) in
  1979  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1980  // whether the returned error was because http.StatusNotModified was returned.
  1981  func (c *ProjectsLocationsCollectorsRegisterCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  1982  	gensupport.SetOptions(c.urlParams_, opts...)
  1983  	res, err := c.doRequest("json")
  1984  	if res != nil && res.StatusCode == http.StatusNotModified {
  1985  		if res.Body != nil {
  1986  			res.Body.Close()
  1987  		}
  1988  		return nil, gensupport.WrapError(&googleapi.Error{
  1989  			Code:   res.StatusCode,
  1990  			Header: res.Header,
  1991  		})
  1992  	}
  1993  	if err != nil {
  1994  		return nil, err
  1995  	}
  1996  	defer googleapi.CloseBody(res)
  1997  	if err := googleapi.CheckResponse(res); err != nil {
  1998  		return nil, gensupport.WrapError(err)
  1999  	}
  2000  	ret := &Operation{
  2001  		ServerResponse: googleapi.ServerResponse{
  2002  			Header:         res.Header,
  2003  			HTTPStatusCode: res.StatusCode,
  2004  		},
  2005  	}
  2006  	target := &ret
  2007  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2008  		return nil, err
  2009  	}
  2010  	return ret, nil
  2011  }
  2012  
  2013  type ProjectsLocationsCollectorsResumeCall struct {
  2014  	s                      *Service
  2015  	name                   string
  2016  	resumecollectorrequest *ResumeCollectorRequest
  2017  	urlParams_             gensupport.URLParams
  2018  	ctx_                   context.Context
  2019  	header_                http.Header
  2020  }
  2021  
  2022  // Resume: Resumes the given collector.
  2023  //
  2024  // - name: Name of the resource.
  2025  func (r *ProjectsLocationsCollectorsService) Resume(name string, resumecollectorrequest *ResumeCollectorRequest) *ProjectsLocationsCollectorsResumeCall {
  2026  	c := &ProjectsLocationsCollectorsResumeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2027  	c.name = name
  2028  	c.resumecollectorrequest = resumecollectorrequest
  2029  	return c
  2030  }
  2031  
  2032  // Fields allows partial responses to be retrieved. See
  2033  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2034  // details.
  2035  func (c *ProjectsLocationsCollectorsResumeCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectorsResumeCall {
  2036  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2037  	return c
  2038  }
  2039  
  2040  // Context sets the context to be used in this call's Do method.
  2041  func (c *ProjectsLocationsCollectorsResumeCall) Context(ctx context.Context) *ProjectsLocationsCollectorsResumeCall {
  2042  	c.ctx_ = ctx
  2043  	return c
  2044  }
  2045  
  2046  // Header returns a http.Header that can be modified by the caller to add
  2047  // headers to the request.
  2048  func (c *ProjectsLocationsCollectorsResumeCall) Header() http.Header {
  2049  	if c.header_ == nil {
  2050  		c.header_ = make(http.Header)
  2051  	}
  2052  	return c.header_
  2053  }
  2054  
  2055  func (c *ProjectsLocationsCollectorsResumeCall) doRequest(alt string) (*http.Response, error) {
  2056  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  2057  	var body io.Reader = nil
  2058  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.resumecollectorrequest)
  2059  	if err != nil {
  2060  		return nil, err
  2061  	}
  2062  	c.urlParams_.Set("alt", alt)
  2063  	c.urlParams_.Set("prettyPrint", "false")
  2064  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:resume")
  2065  	urls += "?" + c.urlParams_.Encode()
  2066  	req, err := http.NewRequest("POST", urls, body)
  2067  	if err != nil {
  2068  		return nil, err
  2069  	}
  2070  	req.Header = reqHeaders
  2071  	googleapi.Expand(req.URL, map[string]string{
  2072  		"name": c.name,
  2073  	})
  2074  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2075  }
  2076  
  2077  // Do executes the "rapidmigrationassessment.projects.locations.collectors.resume" call.
  2078  // Any non-2xx status code is an error. Response headers are in either
  2079  // *Operation.ServerResponse.Header or (if a response was returned at all) in
  2080  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2081  // whether the returned error was because http.StatusNotModified was returned.
  2082  func (c *ProjectsLocationsCollectorsResumeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  2083  	gensupport.SetOptions(c.urlParams_, opts...)
  2084  	res, err := c.doRequest("json")
  2085  	if res != nil && res.StatusCode == http.StatusNotModified {
  2086  		if res.Body != nil {
  2087  			res.Body.Close()
  2088  		}
  2089  		return nil, gensupport.WrapError(&googleapi.Error{
  2090  			Code:   res.StatusCode,
  2091  			Header: res.Header,
  2092  		})
  2093  	}
  2094  	if err != nil {
  2095  		return nil, err
  2096  	}
  2097  	defer googleapi.CloseBody(res)
  2098  	if err := googleapi.CheckResponse(res); err != nil {
  2099  		return nil, gensupport.WrapError(err)
  2100  	}
  2101  	ret := &Operation{
  2102  		ServerResponse: googleapi.ServerResponse{
  2103  			Header:         res.Header,
  2104  			HTTPStatusCode: res.StatusCode,
  2105  		},
  2106  	}
  2107  	target := &ret
  2108  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2109  		return nil, err
  2110  	}
  2111  	return ret, nil
  2112  }
  2113  
  2114  type ProjectsLocationsOperationsCancelCall struct {
  2115  	s                      *Service
  2116  	name                   string
  2117  	canceloperationrequest *CancelOperationRequest
  2118  	urlParams_             gensupport.URLParams
  2119  	ctx_                   context.Context
  2120  	header_                http.Header
  2121  }
  2122  
  2123  // Cancel: Starts asynchronous cancellation on a long-running operation. The
  2124  // server makes a best effort to cancel the operation, but success is not
  2125  // guaranteed. If the server doesn't support this method, it returns
  2126  // `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or
  2127  // other methods to check whether the cancellation succeeded or whether the
  2128  // operation completed despite cancellation. On successful cancellation, the
  2129  // operation is not deleted; instead, it becomes an operation with an
  2130  // Operation.error value with a google.rpc.Status.code of 1, corresponding to
  2131  // `Code.CANCELLED`.
  2132  //
  2133  // - name: The name of the operation resource to be cancelled.
  2134  func (r *ProjectsLocationsOperationsService) Cancel(name string, canceloperationrequest *CancelOperationRequest) *ProjectsLocationsOperationsCancelCall {
  2135  	c := &ProjectsLocationsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2136  	c.name = name
  2137  	c.canceloperationrequest = canceloperationrequest
  2138  	return c
  2139  }
  2140  
  2141  // Fields allows partial responses to be retrieved. See
  2142  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2143  // details.
  2144  func (c *ProjectsLocationsOperationsCancelCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsCancelCall {
  2145  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2146  	return c
  2147  }
  2148  
  2149  // Context sets the context to be used in this call's Do method.
  2150  func (c *ProjectsLocationsOperationsCancelCall) Context(ctx context.Context) *ProjectsLocationsOperationsCancelCall {
  2151  	c.ctx_ = ctx
  2152  	return c
  2153  }
  2154  
  2155  // Header returns a http.Header that can be modified by the caller to add
  2156  // headers to the request.
  2157  func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header {
  2158  	if c.header_ == nil {
  2159  		c.header_ = make(http.Header)
  2160  	}
  2161  	return c.header_
  2162  }
  2163  
  2164  func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) {
  2165  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  2166  	var body io.Reader = nil
  2167  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest)
  2168  	if err != nil {
  2169  		return nil, err
  2170  	}
  2171  	c.urlParams_.Set("alt", alt)
  2172  	c.urlParams_.Set("prettyPrint", "false")
  2173  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel")
  2174  	urls += "?" + c.urlParams_.Encode()
  2175  	req, err := http.NewRequest("POST", urls, body)
  2176  	if err != nil {
  2177  		return nil, err
  2178  	}
  2179  	req.Header = reqHeaders
  2180  	googleapi.Expand(req.URL, map[string]string{
  2181  		"name": c.name,
  2182  	})
  2183  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2184  }
  2185  
  2186  // Do executes the "rapidmigrationassessment.projects.locations.operations.cancel" call.
  2187  // Any non-2xx status code is an error. Response headers are in either
  2188  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  2189  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2190  // whether the returned error was because http.StatusNotModified was returned.
  2191  func (c *ProjectsLocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  2192  	gensupport.SetOptions(c.urlParams_, opts...)
  2193  	res, err := c.doRequest("json")
  2194  	if res != nil && res.StatusCode == http.StatusNotModified {
  2195  		if res.Body != nil {
  2196  			res.Body.Close()
  2197  		}
  2198  		return nil, gensupport.WrapError(&googleapi.Error{
  2199  			Code:   res.StatusCode,
  2200  			Header: res.Header,
  2201  		})
  2202  	}
  2203  	if err != nil {
  2204  		return nil, err
  2205  	}
  2206  	defer googleapi.CloseBody(res)
  2207  	if err := googleapi.CheckResponse(res); err != nil {
  2208  		return nil, gensupport.WrapError(err)
  2209  	}
  2210  	ret := &Empty{
  2211  		ServerResponse: googleapi.ServerResponse{
  2212  			Header:         res.Header,
  2213  			HTTPStatusCode: res.StatusCode,
  2214  		},
  2215  	}
  2216  	target := &ret
  2217  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2218  		return nil, err
  2219  	}
  2220  	return ret, nil
  2221  }
  2222  
  2223  type ProjectsLocationsOperationsDeleteCall struct {
  2224  	s          *Service
  2225  	name       string
  2226  	urlParams_ gensupport.URLParams
  2227  	ctx_       context.Context
  2228  	header_    http.Header
  2229  }
  2230  
  2231  // Delete: Deletes a long-running operation. This method indicates that the
  2232  // client is no longer interested in the operation result. It does not cancel
  2233  // the operation. If the server doesn't support this method, it returns
  2234  // `google.rpc.Code.UNIMPLEMENTED`.
  2235  //
  2236  // - name: The name of the operation resource to be deleted.
  2237  func (r *ProjectsLocationsOperationsService) Delete(name string) *ProjectsLocationsOperationsDeleteCall {
  2238  	c := &ProjectsLocationsOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2239  	c.name = name
  2240  	return c
  2241  }
  2242  
  2243  // Fields allows partial responses to be retrieved. See
  2244  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2245  // details.
  2246  func (c *ProjectsLocationsOperationsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsDeleteCall {
  2247  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2248  	return c
  2249  }
  2250  
  2251  // Context sets the context to be used in this call's Do method.
  2252  func (c *ProjectsLocationsOperationsDeleteCall) Context(ctx context.Context) *ProjectsLocationsOperationsDeleteCall {
  2253  	c.ctx_ = ctx
  2254  	return c
  2255  }
  2256  
  2257  // Header returns a http.Header that can be modified by the caller to add
  2258  // headers to the request.
  2259  func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header {
  2260  	if c.header_ == nil {
  2261  		c.header_ = make(http.Header)
  2262  	}
  2263  	return c.header_
  2264  }
  2265  
  2266  func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  2267  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2268  	var body io.Reader = nil
  2269  	c.urlParams_.Set("alt", alt)
  2270  	c.urlParams_.Set("prettyPrint", "false")
  2271  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  2272  	urls += "?" + c.urlParams_.Encode()
  2273  	req, err := http.NewRequest("DELETE", urls, body)
  2274  	if err != nil {
  2275  		return nil, err
  2276  	}
  2277  	req.Header = reqHeaders
  2278  	googleapi.Expand(req.URL, map[string]string{
  2279  		"name": c.name,
  2280  	})
  2281  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2282  }
  2283  
  2284  // Do executes the "rapidmigrationassessment.projects.locations.operations.delete" call.
  2285  // Any non-2xx status code is an error. Response headers are in either
  2286  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  2287  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2288  // whether the returned error was because http.StatusNotModified was returned.
  2289  func (c *ProjectsLocationsOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  2290  	gensupport.SetOptions(c.urlParams_, opts...)
  2291  	res, err := c.doRequest("json")
  2292  	if res != nil && res.StatusCode == http.StatusNotModified {
  2293  		if res.Body != nil {
  2294  			res.Body.Close()
  2295  		}
  2296  		return nil, gensupport.WrapError(&googleapi.Error{
  2297  			Code:   res.StatusCode,
  2298  			Header: res.Header,
  2299  		})
  2300  	}
  2301  	if err != nil {
  2302  		return nil, err
  2303  	}
  2304  	defer googleapi.CloseBody(res)
  2305  	if err := googleapi.CheckResponse(res); err != nil {
  2306  		return nil, gensupport.WrapError(err)
  2307  	}
  2308  	ret := &Empty{
  2309  		ServerResponse: googleapi.ServerResponse{
  2310  			Header:         res.Header,
  2311  			HTTPStatusCode: res.StatusCode,
  2312  		},
  2313  	}
  2314  	target := &ret
  2315  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2316  		return nil, err
  2317  	}
  2318  	return ret, nil
  2319  }
  2320  
  2321  type ProjectsLocationsOperationsGetCall struct {
  2322  	s            *Service
  2323  	name         string
  2324  	urlParams_   gensupport.URLParams
  2325  	ifNoneMatch_ string
  2326  	ctx_         context.Context
  2327  	header_      http.Header
  2328  }
  2329  
  2330  // Get: Gets the latest state of a long-running operation. Clients can use this
  2331  // method to poll the operation result at intervals as recommended by the API
  2332  // service.
  2333  //
  2334  // - name: The name of the operation resource.
  2335  func (r *ProjectsLocationsOperationsService) Get(name string) *ProjectsLocationsOperationsGetCall {
  2336  	c := &ProjectsLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2337  	c.name = name
  2338  	return c
  2339  }
  2340  
  2341  // Fields allows partial responses to be retrieved. See
  2342  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2343  // details.
  2344  func (c *ProjectsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsGetCall {
  2345  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2346  	return c
  2347  }
  2348  
  2349  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2350  // object's ETag matches the given value. This is useful for getting updates
  2351  // only after the object has changed since the last request.
  2352  func (c *ProjectsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsGetCall {
  2353  	c.ifNoneMatch_ = entityTag
  2354  	return c
  2355  }
  2356  
  2357  // Context sets the context to be used in this call's Do method.
  2358  func (c *ProjectsLocationsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsOperationsGetCall {
  2359  	c.ctx_ = ctx
  2360  	return c
  2361  }
  2362  
  2363  // Header returns a http.Header that can be modified by the caller to add
  2364  // headers to the request.
  2365  func (c *ProjectsLocationsOperationsGetCall) Header() http.Header {
  2366  	if c.header_ == nil {
  2367  		c.header_ = make(http.Header)
  2368  	}
  2369  	return c.header_
  2370  }
  2371  
  2372  func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  2373  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2374  	if c.ifNoneMatch_ != "" {
  2375  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2376  	}
  2377  	var body io.Reader = nil
  2378  	c.urlParams_.Set("alt", alt)
  2379  	c.urlParams_.Set("prettyPrint", "false")
  2380  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  2381  	urls += "?" + c.urlParams_.Encode()
  2382  	req, err := http.NewRequest("GET", urls, body)
  2383  	if err != nil {
  2384  		return nil, err
  2385  	}
  2386  	req.Header = reqHeaders
  2387  	googleapi.Expand(req.URL, map[string]string{
  2388  		"name": c.name,
  2389  	})
  2390  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2391  }
  2392  
  2393  // Do executes the "rapidmigrationassessment.projects.locations.operations.get" call.
  2394  // Any non-2xx status code is an error. Response headers are in either
  2395  // *Operation.ServerResponse.Header or (if a response was returned at all) in
  2396  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2397  // whether the returned error was because http.StatusNotModified was returned.
  2398  func (c *ProjectsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  2399  	gensupport.SetOptions(c.urlParams_, opts...)
  2400  	res, err := c.doRequest("json")
  2401  	if res != nil && res.StatusCode == http.StatusNotModified {
  2402  		if res.Body != nil {
  2403  			res.Body.Close()
  2404  		}
  2405  		return nil, gensupport.WrapError(&googleapi.Error{
  2406  			Code:   res.StatusCode,
  2407  			Header: res.Header,
  2408  		})
  2409  	}
  2410  	if err != nil {
  2411  		return nil, err
  2412  	}
  2413  	defer googleapi.CloseBody(res)
  2414  	if err := googleapi.CheckResponse(res); err != nil {
  2415  		return nil, gensupport.WrapError(err)
  2416  	}
  2417  	ret := &Operation{
  2418  		ServerResponse: googleapi.ServerResponse{
  2419  			Header:         res.Header,
  2420  			HTTPStatusCode: res.StatusCode,
  2421  		},
  2422  	}
  2423  	target := &ret
  2424  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2425  		return nil, err
  2426  	}
  2427  	return ret, nil
  2428  }
  2429  
  2430  type ProjectsLocationsOperationsListCall struct {
  2431  	s            *Service
  2432  	name         string
  2433  	urlParams_   gensupport.URLParams
  2434  	ifNoneMatch_ string
  2435  	ctx_         context.Context
  2436  	header_      http.Header
  2437  }
  2438  
  2439  // List: Lists operations that match the specified filter in the request. If
  2440  // the server doesn't support this method, it returns `UNIMPLEMENTED`.
  2441  //
  2442  // - name: The name of the operation's parent resource.
  2443  func (r *ProjectsLocationsOperationsService) List(name string) *ProjectsLocationsOperationsListCall {
  2444  	c := &ProjectsLocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2445  	c.name = name
  2446  	return c
  2447  }
  2448  
  2449  // Filter sets the optional parameter "filter": The standard list filter.
  2450  func (c *ProjectsLocationsOperationsListCall) Filter(filter string) *ProjectsLocationsOperationsListCall {
  2451  	c.urlParams_.Set("filter", filter)
  2452  	return c
  2453  }
  2454  
  2455  // PageSize sets the optional parameter "pageSize": The standard list page
  2456  // size.
  2457  func (c *ProjectsLocationsOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsOperationsListCall {
  2458  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  2459  	return c
  2460  }
  2461  
  2462  // PageToken sets the optional parameter "pageToken": The standard list page
  2463  // token.
  2464  func (c *ProjectsLocationsOperationsListCall) PageToken(pageToken string) *ProjectsLocationsOperationsListCall {
  2465  	c.urlParams_.Set("pageToken", pageToken)
  2466  	return c
  2467  }
  2468  
  2469  // Fields allows partial responses to be retrieved. See
  2470  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2471  // details.
  2472  func (c *ProjectsLocationsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsListCall {
  2473  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2474  	return c
  2475  }
  2476  
  2477  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2478  // object's ETag matches the given value. This is useful for getting updates
  2479  // only after the object has changed since the last request.
  2480  func (c *ProjectsLocationsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsListCall {
  2481  	c.ifNoneMatch_ = entityTag
  2482  	return c
  2483  }
  2484  
  2485  // Context sets the context to be used in this call's Do method.
  2486  func (c *ProjectsLocationsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsOperationsListCall {
  2487  	c.ctx_ = ctx
  2488  	return c
  2489  }
  2490  
  2491  // Header returns a http.Header that can be modified by the caller to add
  2492  // headers to the request.
  2493  func (c *ProjectsLocationsOperationsListCall) Header() http.Header {
  2494  	if c.header_ == nil {
  2495  		c.header_ = make(http.Header)
  2496  	}
  2497  	return c.header_
  2498  }
  2499  
  2500  func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Response, error) {
  2501  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2502  	if c.ifNoneMatch_ != "" {
  2503  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2504  	}
  2505  	var body io.Reader = nil
  2506  	c.urlParams_.Set("alt", alt)
  2507  	c.urlParams_.Set("prettyPrint", "false")
  2508  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations")
  2509  	urls += "?" + c.urlParams_.Encode()
  2510  	req, err := http.NewRequest("GET", urls, body)
  2511  	if err != nil {
  2512  		return nil, err
  2513  	}
  2514  	req.Header = reqHeaders
  2515  	googleapi.Expand(req.URL, map[string]string{
  2516  		"name": c.name,
  2517  	})
  2518  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2519  }
  2520  
  2521  // Do executes the "rapidmigrationassessment.projects.locations.operations.list" call.
  2522  // Any non-2xx status code is an error. Response headers are in either
  2523  // *ListOperationsResponse.ServerResponse.Header or (if a response was returned
  2524  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2525  // check whether the returned error was because http.StatusNotModified was
  2526  // returned.
  2527  func (c *ProjectsLocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) {
  2528  	gensupport.SetOptions(c.urlParams_, opts...)
  2529  	res, err := c.doRequest("json")
  2530  	if res != nil && res.StatusCode == http.StatusNotModified {
  2531  		if res.Body != nil {
  2532  			res.Body.Close()
  2533  		}
  2534  		return nil, gensupport.WrapError(&googleapi.Error{
  2535  			Code:   res.StatusCode,
  2536  			Header: res.Header,
  2537  		})
  2538  	}
  2539  	if err != nil {
  2540  		return nil, err
  2541  	}
  2542  	defer googleapi.CloseBody(res)
  2543  	if err := googleapi.CheckResponse(res); err != nil {
  2544  		return nil, gensupport.WrapError(err)
  2545  	}
  2546  	ret := &ListOperationsResponse{
  2547  		ServerResponse: googleapi.ServerResponse{
  2548  			Header:         res.Header,
  2549  			HTTPStatusCode: res.StatusCode,
  2550  		},
  2551  	}
  2552  	target := &ret
  2553  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2554  		return nil, err
  2555  	}
  2556  	return ret, nil
  2557  }
  2558  
  2559  // Pages invokes f for each page of results.
  2560  // A non-nil error returned from f will halt the iteration.
  2561  // The provided context supersedes any context provided to the Context method.
  2562  func (c *ProjectsLocationsOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error {
  2563  	c.ctx_ = ctx
  2564  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  2565  	for {
  2566  		x, err := c.Do()
  2567  		if err != nil {
  2568  			return err
  2569  		}
  2570  		if err := f(x); err != nil {
  2571  			return err
  2572  		}
  2573  		if x.NextPageToken == "" {
  2574  			return nil
  2575  		}
  2576  		c.PageToken(x.NextPageToken)
  2577  	}
  2578  }
  2579  

View as plain text