...

Source file src/google.golang.org/api/workflows/v1beta/workflows-gen.go

Documentation: google.golang.org/api/workflows/v1beta

     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 workflows provides access to the Workflows API.
     8  //
     9  // For product documentation, see: https://cloud.google.com/workflows
    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/workflows/v1beta"
    27  //	...
    28  //	ctx := context.Background()
    29  //	workflowsService, err := workflows.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  //	workflowsService, err := workflows.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  //	workflowsService, err := workflows.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
    49  //
    50  // See [google.golang.org/api/option.ClientOption] for details on options.
    51  package workflows // import "google.golang.org/api/workflows/v1beta"
    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 = "workflows:v1beta"
    90  const apiName = "workflows"
    91  const apiVersion = "v1beta"
    92  const basePath = "https://workflows.googleapis.com/"
    93  const basePathTemplate = "https://workflows.UNIVERSE_DOMAIN/"
    94  const mtlsBasePath = "https://workflows.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.Operations = NewProjectsLocationsOperationsService(s)
   172  	rs.Workflows = NewProjectsLocationsWorkflowsService(s)
   173  	return rs
   174  }
   175  
   176  type ProjectsLocationsService struct {
   177  	s *Service
   178  
   179  	Operations *ProjectsLocationsOperationsService
   180  
   181  	Workflows *ProjectsLocationsWorkflowsService
   182  }
   183  
   184  func NewProjectsLocationsOperationsService(s *Service) *ProjectsLocationsOperationsService {
   185  	rs := &ProjectsLocationsOperationsService{s: s}
   186  	return rs
   187  }
   188  
   189  type ProjectsLocationsOperationsService struct {
   190  	s *Service
   191  }
   192  
   193  func NewProjectsLocationsWorkflowsService(s *Service) *ProjectsLocationsWorkflowsService {
   194  	rs := &ProjectsLocationsWorkflowsService{s: s}
   195  	return rs
   196  }
   197  
   198  type ProjectsLocationsWorkflowsService struct {
   199  	s *Service
   200  }
   201  
   202  // Empty: A generic empty message that you can re-use to avoid defining
   203  // duplicated empty messages in your APIs. A typical example is to use it as
   204  // the request or the response type of an API method. For instance: service Foo
   205  // { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }
   206  type Empty struct {
   207  	// ServerResponse contains the HTTP response code and headers from the server.
   208  	googleapi.ServerResponse `json:"-"`
   209  }
   210  
   211  // ListLocationsResponse: The response message for Locations.ListLocations.
   212  type ListLocationsResponse struct {
   213  	// Locations: A list of locations that matches the specified filter in the
   214  	// request.
   215  	Locations []*Location `json:"locations,omitempty"`
   216  	// NextPageToken: The standard List next-page token.
   217  	NextPageToken string `json:"nextPageToken,omitempty"`
   218  
   219  	// ServerResponse contains the HTTP response code and headers from the server.
   220  	googleapi.ServerResponse `json:"-"`
   221  	// ForceSendFields is a list of field names (e.g. "Locations") to
   222  	// unconditionally include in API requests. By default, fields with empty or
   223  	// default values are omitted from API requests. See
   224  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   225  	// details.
   226  	ForceSendFields []string `json:"-"`
   227  	// NullFields is a list of field names (e.g. "Locations") to include in API
   228  	// requests with the JSON null value. By default, fields with empty values are
   229  	// omitted from API requests. See
   230  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   231  	NullFields []string `json:"-"`
   232  }
   233  
   234  func (s *ListLocationsResponse) MarshalJSON() ([]byte, error) {
   235  	type NoMethod ListLocationsResponse
   236  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   237  }
   238  
   239  // ListOperationsResponse: The response message for Operations.ListOperations.
   240  type ListOperationsResponse struct {
   241  	// NextPageToken: The standard List next-page token.
   242  	NextPageToken string `json:"nextPageToken,omitempty"`
   243  	// Operations: A list of operations that matches the specified filter in the
   244  	// request.
   245  	Operations []*Operation `json:"operations,omitempty"`
   246  
   247  	// ServerResponse contains the HTTP response code and headers from the server.
   248  	googleapi.ServerResponse `json:"-"`
   249  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
   250  	// unconditionally include in API requests. By default, fields with empty or
   251  	// default values are omitted from API requests. See
   252  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   253  	// details.
   254  	ForceSendFields []string `json:"-"`
   255  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
   256  	// requests with the JSON null value. By default, fields with empty values are
   257  	// omitted from API requests. See
   258  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   259  	NullFields []string `json:"-"`
   260  }
   261  
   262  func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) {
   263  	type NoMethod ListOperationsResponse
   264  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   265  }
   266  
   267  // ListWorkflowsResponse: Response for the ListWorkflows method.
   268  type ListWorkflowsResponse struct {
   269  	// NextPageToken: A token, which can be sent as `page_token` to retrieve the
   270  	// next page. If this field is omitted, there are no subsequent pages.
   271  	NextPageToken string `json:"nextPageToken,omitempty"`
   272  	// Unreachable: Unreachable resources.
   273  	Unreachable []string `json:"unreachable,omitempty"`
   274  	// Workflows: The workflows which match the request.
   275  	Workflows []*Workflow `json:"workflows,omitempty"`
   276  
   277  	// ServerResponse contains the HTTP response code and headers from the server.
   278  	googleapi.ServerResponse `json:"-"`
   279  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
   280  	// unconditionally include in API requests. By default, fields with empty or
   281  	// default values are omitted from API requests. See
   282  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   283  	// details.
   284  	ForceSendFields []string `json:"-"`
   285  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
   286  	// requests with the JSON null value. By default, fields with empty values are
   287  	// omitted from API requests. See
   288  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   289  	NullFields []string `json:"-"`
   290  }
   291  
   292  func (s *ListWorkflowsResponse) MarshalJSON() ([]byte, error) {
   293  	type NoMethod ListWorkflowsResponse
   294  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   295  }
   296  
   297  // Location: A resource that represents a Google Cloud location.
   298  type Location struct {
   299  	// DisplayName: The friendly name for this location, typically a nearby city
   300  	// name. For example, "Tokyo".
   301  	DisplayName string `json:"displayName,omitempty"`
   302  	// Labels: Cross-service attributes for the location. For example
   303  	// {"cloud.googleapis.com/region": "us-east1"}
   304  	Labels map[string]string `json:"labels,omitempty"`
   305  	// LocationId: The canonical id for this location. For example: "us-east1".
   306  	LocationId string `json:"locationId,omitempty"`
   307  	// Metadata: Service-specific metadata. For example the available capacity at
   308  	// the given location.
   309  	Metadata googleapi.RawMessage `json:"metadata,omitempty"`
   310  	// Name: Resource name for the location, which may vary between
   311  	// implementations. For example:
   312  	// "projects/example-project/locations/us-east1"
   313  	Name string `json:"name,omitempty"`
   314  
   315  	// ServerResponse contains the HTTP response code and headers from the server.
   316  	googleapi.ServerResponse `json:"-"`
   317  	// ForceSendFields is a list of field names (e.g. "DisplayName") to
   318  	// unconditionally include in API requests. By default, fields with empty or
   319  	// default values are omitted from API requests. See
   320  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   321  	// details.
   322  	ForceSendFields []string `json:"-"`
   323  	// NullFields is a list of field names (e.g. "DisplayName") to include in API
   324  	// requests with the JSON null value. By default, fields with empty values are
   325  	// omitted from API requests. See
   326  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   327  	NullFields []string `json:"-"`
   328  }
   329  
   330  func (s *Location) MarshalJSON() ([]byte, error) {
   331  	type NoMethod Location
   332  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   333  }
   334  
   335  // Operation: This resource represents a long-running operation that is the
   336  // result of a network API call.
   337  type Operation struct {
   338  	// Done: If the value is `false`, it means the operation is still in progress.
   339  	// If `true`, the operation is completed, and either `error` or `response` is
   340  	// available.
   341  	Done bool `json:"done,omitempty"`
   342  	// Error: The error result of the operation in case of failure or cancellation.
   343  	Error *Status `json:"error,omitempty"`
   344  	// Metadata: Service-specific metadata associated with the operation. It
   345  	// typically contains progress information and common metadata such as create
   346  	// time. Some services might not provide such metadata. Any method that returns
   347  	// a long-running operation should document the metadata type, if any.
   348  	Metadata googleapi.RawMessage `json:"metadata,omitempty"`
   349  	// Name: The server-assigned name, which is only unique within the same service
   350  	// that originally returns it. If you use the default HTTP mapping, the `name`
   351  	// should be a resource name ending with `operations/{unique_id}`.
   352  	Name string `json:"name,omitempty"`
   353  	// Response: The normal, successful response of the operation. If the original
   354  	// method returns no data on success, such as `Delete`, the response is
   355  	// `google.protobuf.Empty`. If the original method is standard
   356  	// `Get`/`Create`/`Update`, the response should be the resource. For other
   357  	// methods, the response should have the type `XxxResponse`, where `Xxx` is the
   358  	// original method name. For example, if the original method name is
   359  	// `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
   360  	Response googleapi.RawMessage `json:"response,omitempty"`
   361  
   362  	// ServerResponse contains the HTTP response code and headers from the server.
   363  	googleapi.ServerResponse `json:"-"`
   364  	// ForceSendFields is a list of field names (e.g. "Done") to unconditionally
   365  	// include in API requests. By default, fields with empty or default values are
   366  	// omitted from API requests. See
   367  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   368  	// details.
   369  	ForceSendFields []string `json:"-"`
   370  	// NullFields is a list of field names (e.g. "Done") to include in API requests
   371  	// with the JSON null value. By default, fields with empty values are omitted
   372  	// from API requests. See
   373  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   374  	NullFields []string `json:"-"`
   375  }
   376  
   377  func (s *Operation) MarshalJSON() ([]byte, error) {
   378  	type NoMethod Operation
   379  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   380  }
   381  
   382  // OperationMetadata: Represents the metadata of the long-running operation.
   383  type OperationMetadata struct {
   384  	// ApiVersion: API version used to start the operation.
   385  	ApiVersion string `json:"apiVersion,omitempty"`
   386  	// CreateTime: The time the operation was created.
   387  	CreateTime string `json:"createTime,omitempty"`
   388  	// EndTime: The time the operation finished running.
   389  	EndTime string `json:"endTime,omitempty"`
   390  	// Target: Server-defined resource path for the target of the operation.
   391  	Target string `json:"target,omitempty"`
   392  	// Verb: Name of the verb executed by the operation.
   393  	Verb string `json:"verb,omitempty"`
   394  	// ForceSendFields is a list of field names (e.g. "ApiVersion") to
   395  	// unconditionally include in API requests. By default, fields with empty or
   396  	// default values are omitted from API requests. See
   397  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   398  	// details.
   399  	ForceSendFields []string `json:"-"`
   400  	// NullFields is a list of field names (e.g. "ApiVersion") to include in API
   401  	// requests with the JSON null value. By default, fields with empty values are
   402  	// omitted from API requests. See
   403  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   404  	NullFields []string `json:"-"`
   405  }
   406  
   407  func (s *OperationMetadata) MarshalJSON() ([]byte, error) {
   408  	type NoMethod OperationMetadata
   409  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   410  }
   411  
   412  // Status: The `Status` type defines a logical error model that is suitable for
   413  // different programming environments, including REST APIs and RPC APIs. It is
   414  // used by gRPC (https://github.com/grpc). Each `Status` message contains three
   415  // pieces of data: error code, error message, and error details. You can find
   416  // out more about this error model and how to work with it in the API Design
   417  // Guide (https://cloud.google.com/apis/design/errors).
   418  type Status struct {
   419  	// Code: The status code, which should be an enum value of google.rpc.Code.
   420  	Code int64 `json:"code,omitempty"`
   421  	// Details: A list of messages that carry the error details. There is a common
   422  	// set of message types for APIs to use.
   423  	Details []googleapi.RawMessage `json:"details,omitempty"`
   424  	// Message: A developer-facing error message, which should be in English. Any
   425  	// user-facing error message should be localized and sent in the
   426  	// google.rpc.Status.details field, or localized by the client.
   427  	Message string `json:"message,omitempty"`
   428  	// ForceSendFields is a list of field names (e.g. "Code") to unconditionally
   429  	// include in API requests. By default, fields with empty or default values are
   430  	// omitted from API requests. See
   431  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   432  	// details.
   433  	ForceSendFields []string `json:"-"`
   434  	// NullFields is a list of field names (e.g. "Code") to include in API requests
   435  	// with the JSON null value. By default, fields with empty values are omitted
   436  	// from API requests. See
   437  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   438  	NullFields []string `json:"-"`
   439  }
   440  
   441  func (s *Status) MarshalJSON() ([]byte, error) {
   442  	type NoMethod Status
   443  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   444  }
   445  
   446  // Workflow: Workflow program to be executed by Workflows.
   447  type Workflow struct {
   448  	// CreateTime: Output only. The timestamp of when the workflow was created.
   449  	CreateTime string `json:"createTime,omitempty"`
   450  	// Description: Description of the workflow provided by the user. Must be at
   451  	// most 1000 unicode characters long.
   452  	Description string `json:"description,omitempty"`
   453  	// Labels: Labels associated with this workflow. Labels can contain at most 64
   454  	// entries. Keys and values can be no longer than 63 characters and can only
   455  	// contain lowercase letters, numeric characters, underscores and dashes. Label
   456  	// keys must start with a letter. International characters are allowed.
   457  	Labels map[string]string `json:"labels,omitempty"`
   458  	// Name: The resource name of the workflow. Format:
   459  	// projects/{project}/locations/{location}/workflows/{workflow}
   460  	Name string `json:"name,omitempty"`
   461  	// RevisionCreateTime: Output only. The timestamp that the latest revision of
   462  	// the workflow was created.
   463  	RevisionCreateTime string `json:"revisionCreateTime,omitempty"`
   464  	// RevisionId: Output only. The revision of the workflow. A new revision of a
   465  	// workflow is created as a result of updating the following properties of a
   466  	// workflow: - Service account - Workflow code to be executed The format is
   467  	// "000001-a4d", where the first 6 characters define the zero-padded revision
   468  	// ordinal number. They are followed by a hyphen and 3 hexadecimal random
   469  	// characters.
   470  	RevisionId string `json:"revisionId,omitempty"`
   471  	// ServiceAccount: The service account associated with the latest workflow
   472  	// version. This service account represents the identity of the workflow and
   473  	// determines what permissions the workflow has. Format:
   474  	// projects/{project}/serviceAccounts/{account} or {account} Using `-` as a
   475  	// wildcard for the `{project}` or not providing one at all will infer the
   476  	// project from the account. The `{account}` value can be the `email` address
   477  	// or the `unique_id` of the service account. If not provided, workflow will
   478  	// use the project's default service account. Modifying this field for an
   479  	// existing workflow results in a new workflow revision.
   480  	ServiceAccount string `json:"serviceAccount,omitempty"`
   481  	// SourceContents: Workflow code to be executed. The size limit is 128KB.
   482  	SourceContents string `json:"sourceContents,omitempty"`
   483  	// State: Output only. State of the workflow deployment.
   484  	//
   485  	// Possible values:
   486  	//   "STATE_UNSPECIFIED" - Invalid state.
   487  	//   "ACTIVE" - The workflow has been deployed successfully and is serving.
   488  	State string `json:"state,omitempty"`
   489  	// UpdateTime: Output only. The last update timestamp of the workflow.
   490  	UpdateTime string `json:"updateTime,omitempty"`
   491  
   492  	// ServerResponse contains the HTTP response code and headers from the server.
   493  	googleapi.ServerResponse `json:"-"`
   494  	// ForceSendFields is a list of field names (e.g. "CreateTime") to
   495  	// unconditionally include in API requests. By default, fields with empty or
   496  	// default values are omitted from API requests. See
   497  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   498  	// details.
   499  	ForceSendFields []string `json:"-"`
   500  	// NullFields is a list of field names (e.g. "CreateTime") to include in API
   501  	// requests with the JSON null value. By default, fields with empty values are
   502  	// omitted from API requests. See
   503  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   504  	NullFields []string `json:"-"`
   505  }
   506  
   507  func (s *Workflow) MarshalJSON() ([]byte, error) {
   508  	type NoMethod Workflow
   509  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   510  }
   511  
   512  type ProjectsLocationsGetCall struct {
   513  	s            *Service
   514  	name         string
   515  	urlParams_   gensupport.URLParams
   516  	ifNoneMatch_ string
   517  	ctx_         context.Context
   518  	header_      http.Header
   519  }
   520  
   521  // Get: Gets information about a location.
   522  //
   523  // - name: Resource name for the location.
   524  func (r *ProjectsLocationsService) Get(name string) *ProjectsLocationsGetCall {
   525  	c := &ProjectsLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
   526  	c.name = name
   527  	return c
   528  }
   529  
   530  // Fields allows partial responses to be retrieved. See
   531  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
   532  // details.
   533  func (c *ProjectsLocationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGetCall {
   534  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
   535  	return c
   536  }
   537  
   538  // IfNoneMatch sets an optional parameter which makes the operation fail if the
   539  // object's ETag matches the given value. This is useful for getting updates
   540  // only after the object has changed since the last request.
   541  func (c *ProjectsLocationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGetCall {
   542  	c.ifNoneMatch_ = entityTag
   543  	return c
   544  }
   545  
   546  // Context sets the context to be used in this call's Do method.
   547  func (c *ProjectsLocationsGetCall) Context(ctx context.Context) *ProjectsLocationsGetCall {
   548  	c.ctx_ = ctx
   549  	return c
   550  }
   551  
   552  // Header returns a http.Header that can be modified by the caller to add
   553  // headers to the request.
   554  func (c *ProjectsLocationsGetCall) Header() http.Header {
   555  	if c.header_ == nil {
   556  		c.header_ = make(http.Header)
   557  	}
   558  	return c.header_
   559  }
   560  
   561  func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) {
   562  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
   563  	if c.ifNoneMatch_ != "" {
   564  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
   565  	}
   566  	var body io.Reader = nil
   567  	c.urlParams_.Set("alt", alt)
   568  	c.urlParams_.Set("prettyPrint", "false")
   569  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}")
   570  	urls += "?" + c.urlParams_.Encode()
   571  	req, err := http.NewRequest("GET", urls, body)
   572  	if err != nil {
   573  		return nil, err
   574  	}
   575  	req.Header = reqHeaders
   576  	googleapi.Expand(req.URL, map[string]string{
   577  		"name": c.name,
   578  	})
   579  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
   580  }
   581  
   582  // Do executes the "workflows.projects.locations.get" call.
   583  // Any non-2xx status code is an error. Response headers are in either
   584  // *Location.ServerResponse.Header or (if a response was returned at all) in
   585  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
   586  // whether the returned error was because http.StatusNotModified was returned.
   587  func (c *ProjectsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) {
   588  	gensupport.SetOptions(c.urlParams_, opts...)
   589  	res, err := c.doRequest("json")
   590  	if res != nil && res.StatusCode == http.StatusNotModified {
   591  		if res.Body != nil {
   592  			res.Body.Close()
   593  		}
   594  		return nil, gensupport.WrapError(&googleapi.Error{
   595  			Code:   res.StatusCode,
   596  			Header: res.Header,
   597  		})
   598  	}
   599  	if err != nil {
   600  		return nil, err
   601  	}
   602  	defer googleapi.CloseBody(res)
   603  	if err := googleapi.CheckResponse(res); err != nil {
   604  		return nil, gensupport.WrapError(err)
   605  	}
   606  	ret := &Location{
   607  		ServerResponse: googleapi.ServerResponse{
   608  			Header:         res.Header,
   609  			HTTPStatusCode: res.StatusCode,
   610  		},
   611  	}
   612  	target := &ret
   613  	if err := gensupport.DecodeResponse(target, res); err != nil {
   614  		return nil, err
   615  	}
   616  	return ret, nil
   617  }
   618  
   619  type ProjectsLocationsListCall struct {
   620  	s            *Service
   621  	name         string
   622  	urlParams_   gensupport.URLParams
   623  	ifNoneMatch_ string
   624  	ctx_         context.Context
   625  	header_      http.Header
   626  }
   627  
   628  // List: Lists information about the supported locations for this service.
   629  //
   630  // - name: The resource that owns the locations collection, if applicable.
   631  func (r *ProjectsLocationsService) List(name string) *ProjectsLocationsListCall {
   632  	c := &ProjectsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
   633  	c.name = name
   634  	return c
   635  }
   636  
   637  // Filter sets the optional parameter "filter": A filter to narrow down results
   638  // to a preferred subset. The filtering language accepts strings like
   639  // "displayName=tokyo", and is documented in more detail in AIP-160
   640  // (https://google.aip.dev/160).
   641  func (c *ProjectsLocationsListCall) Filter(filter string) *ProjectsLocationsListCall {
   642  	c.urlParams_.Set("filter", filter)
   643  	return c
   644  }
   645  
   646  // PageSize sets the optional parameter "pageSize": The maximum number of
   647  // results to return. If not set, the service selects a default.
   648  func (c *ProjectsLocationsListCall) PageSize(pageSize int64) *ProjectsLocationsListCall {
   649  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
   650  	return c
   651  }
   652  
   653  // PageToken sets the optional parameter "pageToken": A page token received
   654  // from the `next_page_token` field in the response. Send that page token to
   655  // receive the subsequent page.
   656  func (c *ProjectsLocationsListCall) PageToken(pageToken string) *ProjectsLocationsListCall {
   657  	c.urlParams_.Set("pageToken", pageToken)
   658  	return c
   659  }
   660  
   661  // Fields allows partial responses to be retrieved. See
   662  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
   663  // details.
   664  func (c *ProjectsLocationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsListCall {
   665  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
   666  	return c
   667  }
   668  
   669  // IfNoneMatch sets an optional parameter which makes the operation fail if the
   670  // object's ETag matches the given value. This is useful for getting updates
   671  // only after the object has changed since the last request.
   672  func (c *ProjectsLocationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsListCall {
   673  	c.ifNoneMatch_ = entityTag
   674  	return c
   675  }
   676  
   677  // Context sets the context to be used in this call's Do method.
   678  func (c *ProjectsLocationsListCall) Context(ctx context.Context) *ProjectsLocationsListCall {
   679  	c.ctx_ = ctx
   680  	return c
   681  }
   682  
   683  // Header returns a http.Header that can be modified by the caller to add
   684  // headers to the request.
   685  func (c *ProjectsLocationsListCall) Header() http.Header {
   686  	if c.header_ == nil {
   687  		c.header_ = make(http.Header)
   688  	}
   689  	return c.header_
   690  }
   691  
   692  func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error) {
   693  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
   694  	if c.ifNoneMatch_ != "" {
   695  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
   696  	}
   697  	var body io.Reader = nil
   698  	c.urlParams_.Set("alt", alt)
   699  	c.urlParams_.Set("prettyPrint", "false")
   700  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}/locations")
   701  	urls += "?" + c.urlParams_.Encode()
   702  	req, err := http.NewRequest("GET", urls, body)
   703  	if err != nil {
   704  		return nil, err
   705  	}
   706  	req.Header = reqHeaders
   707  	googleapi.Expand(req.URL, map[string]string{
   708  		"name": c.name,
   709  	})
   710  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
   711  }
   712  
   713  // Do executes the "workflows.projects.locations.list" call.
   714  // Any non-2xx status code is an error. Response headers are in either
   715  // *ListLocationsResponse.ServerResponse.Header or (if a response was returned
   716  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
   717  // check whether the returned error was because http.StatusNotModified was
   718  // returned.
   719  func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) {
   720  	gensupport.SetOptions(c.urlParams_, opts...)
   721  	res, err := c.doRequest("json")
   722  	if res != nil && res.StatusCode == http.StatusNotModified {
   723  		if res.Body != nil {
   724  			res.Body.Close()
   725  		}
   726  		return nil, gensupport.WrapError(&googleapi.Error{
   727  			Code:   res.StatusCode,
   728  			Header: res.Header,
   729  		})
   730  	}
   731  	if err != nil {
   732  		return nil, err
   733  	}
   734  	defer googleapi.CloseBody(res)
   735  	if err := googleapi.CheckResponse(res); err != nil {
   736  		return nil, gensupport.WrapError(err)
   737  	}
   738  	ret := &ListLocationsResponse{
   739  		ServerResponse: googleapi.ServerResponse{
   740  			Header:         res.Header,
   741  			HTTPStatusCode: res.StatusCode,
   742  		},
   743  	}
   744  	target := &ret
   745  	if err := gensupport.DecodeResponse(target, res); err != nil {
   746  		return nil, err
   747  	}
   748  	return ret, nil
   749  }
   750  
   751  // Pages invokes f for each page of results.
   752  // A non-nil error returned from f will halt the iteration.
   753  // The provided context supersedes any context provided to the Context method.
   754  func (c *ProjectsLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error {
   755  	c.ctx_ = ctx
   756  	defer c.PageToken(c.urlParams_.Get("pageToken"))
   757  	for {
   758  		x, err := c.Do()
   759  		if err != nil {
   760  			return err
   761  		}
   762  		if err := f(x); err != nil {
   763  			return err
   764  		}
   765  		if x.NextPageToken == "" {
   766  			return nil
   767  		}
   768  		c.PageToken(x.NextPageToken)
   769  	}
   770  }
   771  
   772  type ProjectsLocationsOperationsDeleteCall struct {
   773  	s          *Service
   774  	name       string
   775  	urlParams_ gensupport.URLParams
   776  	ctx_       context.Context
   777  	header_    http.Header
   778  }
   779  
   780  // Delete: Deletes a long-running operation. This method indicates that the
   781  // client is no longer interested in the operation result. It does not cancel
   782  // the operation. If the server doesn't support this method, it returns
   783  // `google.rpc.Code.UNIMPLEMENTED`.
   784  //
   785  // - name: The name of the operation resource to be deleted.
   786  func (r *ProjectsLocationsOperationsService) Delete(name string) *ProjectsLocationsOperationsDeleteCall {
   787  	c := &ProjectsLocationsOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
   788  	c.name = name
   789  	return c
   790  }
   791  
   792  // Fields allows partial responses to be retrieved. See
   793  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
   794  // details.
   795  func (c *ProjectsLocationsOperationsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsDeleteCall {
   796  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
   797  	return c
   798  }
   799  
   800  // Context sets the context to be used in this call's Do method.
   801  func (c *ProjectsLocationsOperationsDeleteCall) Context(ctx context.Context) *ProjectsLocationsOperationsDeleteCall {
   802  	c.ctx_ = ctx
   803  	return c
   804  }
   805  
   806  // Header returns a http.Header that can be modified by the caller to add
   807  // headers to the request.
   808  func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header {
   809  	if c.header_ == nil {
   810  		c.header_ = make(http.Header)
   811  	}
   812  	return c.header_
   813  }
   814  
   815  func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
   816  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
   817  	var body io.Reader = nil
   818  	c.urlParams_.Set("alt", alt)
   819  	c.urlParams_.Set("prettyPrint", "false")
   820  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}")
   821  	urls += "?" + c.urlParams_.Encode()
   822  	req, err := http.NewRequest("DELETE", urls, body)
   823  	if err != nil {
   824  		return nil, err
   825  	}
   826  	req.Header = reqHeaders
   827  	googleapi.Expand(req.URL, map[string]string{
   828  		"name": c.name,
   829  	})
   830  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
   831  }
   832  
   833  // Do executes the "workflows.projects.locations.operations.delete" call.
   834  // Any non-2xx status code is an error. Response headers are in either
   835  // *Empty.ServerResponse.Header or (if a response was returned at all) in
   836  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
   837  // whether the returned error was because http.StatusNotModified was returned.
   838  func (c *ProjectsLocationsOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
   839  	gensupport.SetOptions(c.urlParams_, opts...)
   840  	res, err := c.doRequest("json")
   841  	if res != nil && res.StatusCode == http.StatusNotModified {
   842  		if res.Body != nil {
   843  			res.Body.Close()
   844  		}
   845  		return nil, gensupport.WrapError(&googleapi.Error{
   846  			Code:   res.StatusCode,
   847  			Header: res.Header,
   848  		})
   849  	}
   850  	if err != nil {
   851  		return nil, err
   852  	}
   853  	defer googleapi.CloseBody(res)
   854  	if err := googleapi.CheckResponse(res); err != nil {
   855  		return nil, gensupport.WrapError(err)
   856  	}
   857  	ret := &Empty{
   858  		ServerResponse: googleapi.ServerResponse{
   859  			Header:         res.Header,
   860  			HTTPStatusCode: res.StatusCode,
   861  		},
   862  	}
   863  	target := &ret
   864  	if err := gensupport.DecodeResponse(target, res); err != nil {
   865  		return nil, err
   866  	}
   867  	return ret, nil
   868  }
   869  
   870  type ProjectsLocationsOperationsGetCall struct {
   871  	s            *Service
   872  	name         string
   873  	urlParams_   gensupport.URLParams
   874  	ifNoneMatch_ string
   875  	ctx_         context.Context
   876  	header_      http.Header
   877  }
   878  
   879  // Get: Gets the latest state of a long-running operation. Clients can use this
   880  // method to poll the operation result at intervals as recommended by the API
   881  // service.
   882  //
   883  // - name: The name of the operation resource.
   884  func (r *ProjectsLocationsOperationsService) Get(name string) *ProjectsLocationsOperationsGetCall {
   885  	c := &ProjectsLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
   886  	c.name = name
   887  	return c
   888  }
   889  
   890  // Fields allows partial responses to be retrieved. See
   891  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
   892  // details.
   893  func (c *ProjectsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsGetCall {
   894  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
   895  	return c
   896  }
   897  
   898  // IfNoneMatch sets an optional parameter which makes the operation fail if the
   899  // object's ETag matches the given value. This is useful for getting updates
   900  // only after the object has changed since the last request.
   901  func (c *ProjectsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsGetCall {
   902  	c.ifNoneMatch_ = entityTag
   903  	return c
   904  }
   905  
   906  // Context sets the context to be used in this call's Do method.
   907  func (c *ProjectsLocationsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsOperationsGetCall {
   908  	c.ctx_ = ctx
   909  	return c
   910  }
   911  
   912  // Header returns a http.Header that can be modified by the caller to add
   913  // headers to the request.
   914  func (c *ProjectsLocationsOperationsGetCall) Header() http.Header {
   915  	if c.header_ == nil {
   916  		c.header_ = make(http.Header)
   917  	}
   918  	return c.header_
   919  }
   920  
   921  func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
   922  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
   923  	if c.ifNoneMatch_ != "" {
   924  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
   925  	}
   926  	var body io.Reader = nil
   927  	c.urlParams_.Set("alt", alt)
   928  	c.urlParams_.Set("prettyPrint", "false")
   929  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}")
   930  	urls += "?" + c.urlParams_.Encode()
   931  	req, err := http.NewRequest("GET", urls, body)
   932  	if err != nil {
   933  		return nil, err
   934  	}
   935  	req.Header = reqHeaders
   936  	googleapi.Expand(req.URL, map[string]string{
   937  		"name": c.name,
   938  	})
   939  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
   940  }
   941  
   942  // Do executes the "workflows.projects.locations.operations.get" call.
   943  // Any non-2xx status code is an error. Response headers are in either
   944  // *Operation.ServerResponse.Header or (if a response was returned at all) in
   945  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
   946  // whether the returned error was because http.StatusNotModified was returned.
   947  func (c *ProjectsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
   948  	gensupport.SetOptions(c.urlParams_, opts...)
   949  	res, err := c.doRequest("json")
   950  	if res != nil && res.StatusCode == http.StatusNotModified {
   951  		if res.Body != nil {
   952  			res.Body.Close()
   953  		}
   954  		return nil, gensupport.WrapError(&googleapi.Error{
   955  			Code:   res.StatusCode,
   956  			Header: res.Header,
   957  		})
   958  	}
   959  	if err != nil {
   960  		return nil, err
   961  	}
   962  	defer googleapi.CloseBody(res)
   963  	if err := googleapi.CheckResponse(res); err != nil {
   964  		return nil, gensupport.WrapError(err)
   965  	}
   966  	ret := &Operation{
   967  		ServerResponse: googleapi.ServerResponse{
   968  			Header:         res.Header,
   969  			HTTPStatusCode: res.StatusCode,
   970  		},
   971  	}
   972  	target := &ret
   973  	if err := gensupport.DecodeResponse(target, res); err != nil {
   974  		return nil, err
   975  	}
   976  	return ret, nil
   977  }
   978  
   979  type ProjectsLocationsOperationsListCall struct {
   980  	s            *Service
   981  	name         string
   982  	urlParams_   gensupport.URLParams
   983  	ifNoneMatch_ string
   984  	ctx_         context.Context
   985  	header_      http.Header
   986  }
   987  
   988  // List: Lists operations that match the specified filter in the request. If
   989  // the server doesn't support this method, it returns `UNIMPLEMENTED`.
   990  //
   991  // - name: The name of the operation's parent resource.
   992  func (r *ProjectsLocationsOperationsService) List(name string) *ProjectsLocationsOperationsListCall {
   993  	c := &ProjectsLocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
   994  	c.name = name
   995  	return c
   996  }
   997  
   998  // Filter sets the optional parameter "filter": The standard list filter.
   999  func (c *ProjectsLocationsOperationsListCall) Filter(filter string) *ProjectsLocationsOperationsListCall {
  1000  	c.urlParams_.Set("filter", filter)
  1001  	return c
  1002  }
  1003  
  1004  // PageSize sets the optional parameter "pageSize": The standard list page
  1005  // size.
  1006  func (c *ProjectsLocationsOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsOperationsListCall {
  1007  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  1008  	return c
  1009  }
  1010  
  1011  // PageToken sets the optional parameter "pageToken": The standard list page
  1012  // token.
  1013  func (c *ProjectsLocationsOperationsListCall) PageToken(pageToken string) *ProjectsLocationsOperationsListCall {
  1014  	c.urlParams_.Set("pageToken", pageToken)
  1015  	return c
  1016  }
  1017  
  1018  // Fields allows partial responses to be retrieved. See
  1019  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1020  // details.
  1021  func (c *ProjectsLocationsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsListCall {
  1022  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1023  	return c
  1024  }
  1025  
  1026  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1027  // object's ETag matches the given value. This is useful for getting updates
  1028  // only after the object has changed since the last request.
  1029  func (c *ProjectsLocationsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsListCall {
  1030  	c.ifNoneMatch_ = entityTag
  1031  	return c
  1032  }
  1033  
  1034  // Context sets the context to be used in this call's Do method.
  1035  func (c *ProjectsLocationsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsOperationsListCall {
  1036  	c.ctx_ = ctx
  1037  	return c
  1038  }
  1039  
  1040  // Header returns a http.Header that can be modified by the caller to add
  1041  // headers to the request.
  1042  func (c *ProjectsLocationsOperationsListCall) Header() http.Header {
  1043  	if c.header_ == nil {
  1044  		c.header_ = make(http.Header)
  1045  	}
  1046  	return c.header_
  1047  }
  1048  
  1049  func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Response, error) {
  1050  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1051  	if c.ifNoneMatch_ != "" {
  1052  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1053  	}
  1054  	var body io.Reader = nil
  1055  	c.urlParams_.Set("alt", alt)
  1056  	c.urlParams_.Set("prettyPrint", "false")
  1057  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}/operations")
  1058  	urls += "?" + c.urlParams_.Encode()
  1059  	req, err := http.NewRequest("GET", urls, body)
  1060  	if err != nil {
  1061  		return nil, err
  1062  	}
  1063  	req.Header = reqHeaders
  1064  	googleapi.Expand(req.URL, map[string]string{
  1065  		"name": c.name,
  1066  	})
  1067  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1068  }
  1069  
  1070  // Do executes the "workflows.projects.locations.operations.list" call.
  1071  // Any non-2xx status code is an error. Response headers are in either
  1072  // *ListOperationsResponse.ServerResponse.Header or (if a response was returned
  1073  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1074  // check whether the returned error was because http.StatusNotModified was
  1075  // returned.
  1076  func (c *ProjectsLocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) {
  1077  	gensupport.SetOptions(c.urlParams_, opts...)
  1078  	res, err := c.doRequest("json")
  1079  	if res != nil && res.StatusCode == http.StatusNotModified {
  1080  		if res.Body != nil {
  1081  			res.Body.Close()
  1082  		}
  1083  		return nil, gensupport.WrapError(&googleapi.Error{
  1084  			Code:   res.StatusCode,
  1085  			Header: res.Header,
  1086  		})
  1087  	}
  1088  	if err != nil {
  1089  		return nil, err
  1090  	}
  1091  	defer googleapi.CloseBody(res)
  1092  	if err := googleapi.CheckResponse(res); err != nil {
  1093  		return nil, gensupport.WrapError(err)
  1094  	}
  1095  	ret := &ListOperationsResponse{
  1096  		ServerResponse: googleapi.ServerResponse{
  1097  			Header:         res.Header,
  1098  			HTTPStatusCode: res.StatusCode,
  1099  		},
  1100  	}
  1101  	target := &ret
  1102  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1103  		return nil, err
  1104  	}
  1105  	return ret, nil
  1106  }
  1107  
  1108  // Pages invokes f for each page of results.
  1109  // A non-nil error returned from f will halt the iteration.
  1110  // The provided context supersedes any context provided to the Context method.
  1111  func (c *ProjectsLocationsOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error {
  1112  	c.ctx_ = ctx
  1113  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  1114  	for {
  1115  		x, err := c.Do()
  1116  		if err != nil {
  1117  			return err
  1118  		}
  1119  		if err := f(x); err != nil {
  1120  			return err
  1121  		}
  1122  		if x.NextPageToken == "" {
  1123  			return nil
  1124  		}
  1125  		c.PageToken(x.NextPageToken)
  1126  	}
  1127  }
  1128  
  1129  type ProjectsLocationsWorkflowsCreateCall struct {
  1130  	s          *Service
  1131  	parent     string
  1132  	workflow   *Workflow
  1133  	urlParams_ gensupport.URLParams
  1134  	ctx_       context.Context
  1135  	header_    http.Header
  1136  }
  1137  
  1138  // Create: Creates a new workflow. If a workflow with the specified name
  1139  // already exists in the specified project and location, the long running
  1140  // operation will return ALREADY_EXISTS error.
  1141  //
  1142  //   - parent: Project and location in which the workflow should be created.
  1143  //     Format: projects/{project}/locations/{location}.
  1144  func (r *ProjectsLocationsWorkflowsService) Create(parent string, workflow *Workflow) *ProjectsLocationsWorkflowsCreateCall {
  1145  	c := &ProjectsLocationsWorkflowsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1146  	c.parent = parent
  1147  	c.workflow = workflow
  1148  	return c
  1149  }
  1150  
  1151  // WorkflowId sets the optional parameter "workflowId": Required. The ID of the
  1152  // workflow to be created. It has to fulfill the following requirements: * Must
  1153  // contain only letters, numbers, underscores and hyphens. * Must start with a
  1154  // letter. * Must be between 1-64 characters. * Must end with a number or a
  1155  // letter. * Must be unique within the customer project and location.
  1156  func (c *ProjectsLocationsWorkflowsCreateCall) WorkflowId(workflowId string) *ProjectsLocationsWorkflowsCreateCall {
  1157  	c.urlParams_.Set("workflowId", workflowId)
  1158  	return c
  1159  }
  1160  
  1161  // Fields allows partial responses to be retrieved. See
  1162  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1163  // details.
  1164  func (c *ProjectsLocationsWorkflowsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowsCreateCall {
  1165  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1166  	return c
  1167  }
  1168  
  1169  // Context sets the context to be used in this call's Do method.
  1170  func (c *ProjectsLocationsWorkflowsCreateCall) Context(ctx context.Context) *ProjectsLocationsWorkflowsCreateCall {
  1171  	c.ctx_ = ctx
  1172  	return c
  1173  }
  1174  
  1175  // Header returns a http.Header that can be modified by the caller to add
  1176  // headers to the request.
  1177  func (c *ProjectsLocationsWorkflowsCreateCall) Header() http.Header {
  1178  	if c.header_ == nil {
  1179  		c.header_ = make(http.Header)
  1180  	}
  1181  	return c.header_
  1182  }
  1183  
  1184  func (c *ProjectsLocationsWorkflowsCreateCall) doRequest(alt string) (*http.Response, error) {
  1185  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1186  	var body io.Reader = nil
  1187  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.workflow)
  1188  	if err != nil {
  1189  		return nil, err
  1190  	}
  1191  	c.urlParams_.Set("alt", alt)
  1192  	c.urlParams_.Set("prettyPrint", "false")
  1193  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/workflows")
  1194  	urls += "?" + c.urlParams_.Encode()
  1195  	req, err := http.NewRequest("POST", urls, body)
  1196  	if err != nil {
  1197  		return nil, err
  1198  	}
  1199  	req.Header = reqHeaders
  1200  	googleapi.Expand(req.URL, map[string]string{
  1201  		"parent": c.parent,
  1202  	})
  1203  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1204  }
  1205  
  1206  // Do executes the "workflows.projects.locations.workflows.create" call.
  1207  // Any non-2xx status code is an error. Response headers are in either
  1208  // *Operation.ServerResponse.Header or (if a response was returned at all) in
  1209  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1210  // whether the returned error was because http.StatusNotModified was returned.
  1211  func (c *ProjectsLocationsWorkflowsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  1212  	gensupport.SetOptions(c.urlParams_, opts...)
  1213  	res, err := c.doRequest("json")
  1214  	if res != nil && res.StatusCode == http.StatusNotModified {
  1215  		if res.Body != nil {
  1216  			res.Body.Close()
  1217  		}
  1218  		return nil, gensupport.WrapError(&googleapi.Error{
  1219  			Code:   res.StatusCode,
  1220  			Header: res.Header,
  1221  		})
  1222  	}
  1223  	if err != nil {
  1224  		return nil, err
  1225  	}
  1226  	defer googleapi.CloseBody(res)
  1227  	if err := googleapi.CheckResponse(res); err != nil {
  1228  		return nil, gensupport.WrapError(err)
  1229  	}
  1230  	ret := &Operation{
  1231  		ServerResponse: googleapi.ServerResponse{
  1232  			Header:         res.Header,
  1233  			HTTPStatusCode: res.StatusCode,
  1234  		},
  1235  	}
  1236  	target := &ret
  1237  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1238  		return nil, err
  1239  	}
  1240  	return ret, nil
  1241  }
  1242  
  1243  type ProjectsLocationsWorkflowsDeleteCall struct {
  1244  	s          *Service
  1245  	name       string
  1246  	urlParams_ gensupport.URLParams
  1247  	ctx_       context.Context
  1248  	header_    http.Header
  1249  }
  1250  
  1251  // Delete: Deletes a workflow with the specified name. This method also cancels
  1252  // and deletes all running executions of the workflow.
  1253  //
  1254  //   - name: Name of the workflow to be deleted. Format:
  1255  //     projects/{project}/locations/{location}/workflows/{workflow}.
  1256  func (r *ProjectsLocationsWorkflowsService) Delete(name string) *ProjectsLocationsWorkflowsDeleteCall {
  1257  	c := &ProjectsLocationsWorkflowsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1258  	c.name = name
  1259  	return c
  1260  }
  1261  
  1262  // Fields allows partial responses to be retrieved. See
  1263  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1264  // details.
  1265  func (c *ProjectsLocationsWorkflowsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowsDeleteCall {
  1266  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1267  	return c
  1268  }
  1269  
  1270  // Context sets the context to be used in this call's Do method.
  1271  func (c *ProjectsLocationsWorkflowsDeleteCall) Context(ctx context.Context) *ProjectsLocationsWorkflowsDeleteCall {
  1272  	c.ctx_ = ctx
  1273  	return c
  1274  }
  1275  
  1276  // Header returns a http.Header that can be modified by the caller to add
  1277  // headers to the request.
  1278  func (c *ProjectsLocationsWorkflowsDeleteCall) Header() http.Header {
  1279  	if c.header_ == nil {
  1280  		c.header_ = make(http.Header)
  1281  	}
  1282  	return c.header_
  1283  }
  1284  
  1285  func (c *ProjectsLocationsWorkflowsDeleteCall) doRequest(alt string) (*http.Response, error) {
  1286  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1287  	var body io.Reader = nil
  1288  	c.urlParams_.Set("alt", alt)
  1289  	c.urlParams_.Set("prettyPrint", "false")
  1290  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}")
  1291  	urls += "?" + c.urlParams_.Encode()
  1292  	req, err := http.NewRequest("DELETE", urls, body)
  1293  	if err != nil {
  1294  		return nil, err
  1295  	}
  1296  	req.Header = reqHeaders
  1297  	googleapi.Expand(req.URL, map[string]string{
  1298  		"name": c.name,
  1299  	})
  1300  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1301  }
  1302  
  1303  // Do executes the "workflows.projects.locations.workflows.delete" call.
  1304  // Any non-2xx status code is an error. Response headers are in either
  1305  // *Operation.ServerResponse.Header or (if a response was returned at all) in
  1306  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1307  // whether the returned error was because http.StatusNotModified was returned.
  1308  func (c *ProjectsLocationsWorkflowsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  1309  	gensupport.SetOptions(c.urlParams_, opts...)
  1310  	res, err := c.doRequest("json")
  1311  	if res != nil && res.StatusCode == http.StatusNotModified {
  1312  		if res.Body != nil {
  1313  			res.Body.Close()
  1314  		}
  1315  		return nil, gensupport.WrapError(&googleapi.Error{
  1316  			Code:   res.StatusCode,
  1317  			Header: res.Header,
  1318  		})
  1319  	}
  1320  	if err != nil {
  1321  		return nil, err
  1322  	}
  1323  	defer googleapi.CloseBody(res)
  1324  	if err := googleapi.CheckResponse(res); err != nil {
  1325  		return nil, gensupport.WrapError(err)
  1326  	}
  1327  	ret := &Operation{
  1328  		ServerResponse: googleapi.ServerResponse{
  1329  			Header:         res.Header,
  1330  			HTTPStatusCode: res.StatusCode,
  1331  		},
  1332  	}
  1333  	target := &ret
  1334  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1335  		return nil, err
  1336  	}
  1337  	return ret, nil
  1338  }
  1339  
  1340  type ProjectsLocationsWorkflowsGetCall struct {
  1341  	s            *Service
  1342  	name         string
  1343  	urlParams_   gensupport.URLParams
  1344  	ifNoneMatch_ string
  1345  	ctx_         context.Context
  1346  	header_      http.Header
  1347  }
  1348  
  1349  // Get: Gets details of a single Workflow.
  1350  //
  1351  //   - name: Name of the workflow which information should be retrieved. Format:
  1352  //     projects/{project}/locations/{location}/workflows/{workflow}.
  1353  func (r *ProjectsLocationsWorkflowsService) Get(name string) *ProjectsLocationsWorkflowsGetCall {
  1354  	c := &ProjectsLocationsWorkflowsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1355  	c.name = name
  1356  	return c
  1357  }
  1358  
  1359  // Fields allows partial responses to be retrieved. See
  1360  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1361  // details.
  1362  func (c *ProjectsLocationsWorkflowsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowsGetCall {
  1363  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1364  	return c
  1365  }
  1366  
  1367  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1368  // object's ETag matches the given value. This is useful for getting updates
  1369  // only after the object has changed since the last request.
  1370  func (c *ProjectsLocationsWorkflowsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsWorkflowsGetCall {
  1371  	c.ifNoneMatch_ = entityTag
  1372  	return c
  1373  }
  1374  
  1375  // Context sets the context to be used in this call's Do method.
  1376  func (c *ProjectsLocationsWorkflowsGetCall) Context(ctx context.Context) *ProjectsLocationsWorkflowsGetCall {
  1377  	c.ctx_ = ctx
  1378  	return c
  1379  }
  1380  
  1381  // Header returns a http.Header that can be modified by the caller to add
  1382  // headers to the request.
  1383  func (c *ProjectsLocationsWorkflowsGetCall) Header() http.Header {
  1384  	if c.header_ == nil {
  1385  		c.header_ = make(http.Header)
  1386  	}
  1387  	return c.header_
  1388  }
  1389  
  1390  func (c *ProjectsLocationsWorkflowsGetCall) doRequest(alt string) (*http.Response, error) {
  1391  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1392  	if c.ifNoneMatch_ != "" {
  1393  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1394  	}
  1395  	var body io.Reader = nil
  1396  	c.urlParams_.Set("alt", alt)
  1397  	c.urlParams_.Set("prettyPrint", "false")
  1398  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}")
  1399  	urls += "?" + c.urlParams_.Encode()
  1400  	req, err := http.NewRequest("GET", urls, body)
  1401  	if err != nil {
  1402  		return nil, err
  1403  	}
  1404  	req.Header = reqHeaders
  1405  	googleapi.Expand(req.URL, map[string]string{
  1406  		"name": c.name,
  1407  	})
  1408  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1409  }
  1410  
  1411  // Do executes the "workflows.projects.locations.workflows.get" call.
  1412  // Any non-2xx status code is an error. Response headers are in either
  1413  // *Workflow.ServerResponse.Header or (if a response was returned at all) in
  1414  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1415  // whether the returned error was because http.StatusNotModified was returned.
  1416  func (c *ProjectsLocationsWorkflowsGetCall) Do(opts ...googleapi.CallOption) (*Workflow, error) {
  1417  	gensupport.SetOptions(c.urlParams_, opts...)
  1418  	res, err := c.doRequest("json")
  1419  	if res != nil && res.StatusCode == http.StatusNotModified {
  1420  		if res.Body != nil {
  1421  			res.Body.Close()
  1422  		}
  1423  		return nil, gensupport.WrapError(&googleapi.Error{
  1424  			Code:   res.StatusCode,
  1425  			Header: res.Header,
  1426  		})
  1427  	}
  1428  	if err != nil {
  1429  		return nil, err
  1430  	}
  1431  	defer googleapi.CloseBody(res)
  1432  	if err := googleapi.CheckResponse(res); err != nil {
  1433  		return nil, gensupport.WrapError(err)
  1434  	}
  1435  	ret := &Workflow{
  1436  		ServerResponse: googleapi.ServerResponse{
  1437  			Header:         res.Header,
  1438  			HTTPStatusCode: res.StatusCode,
  1439  		},
  1440  	}
  1441  	target := &ret
  1442  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1443  		return nil, err
  1444  	}
  1445  	return ret, nil
  1446  }
  1447  
  1448  type ProjectsLocationsWorkflowsListCall struct {
  1449  	s            *Service
  1450  	parent       string
  1451  	urlParams_   gensupport.URLParams
  1452  	ifNoneMatch_ string
  1453  	ctx_         context.Context
  1454  	header_      http.Header
  1455  }
  1456  
  1457  // List: Lists Workflows in a given project and location. The default order is
  1458  // not specified.
  1459  //
  1460  //   - parent: Project and location from which the workflows should be listed.
  1461  //     Format: projects/{project}/locations/{location}.
  1462  func (r *ProjectsLocationsWorkflowsService) List(parent string) *ProjectsLocationsWorkflowsListCall {
  1463  	c := &ProjectsLocationsWorkflowsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1464  	c.parent = parent
  1465  	return c
  1466  }
  1467  
  1468  // Filter sets the optional parameter "filter": Filter to restrict results to
  1469  // specific workflows.
  1470  func (c *ProjectsLocationsWorkflowsListCall) Filter(filter string) *ProjectsLocationsWorkflowsListCall {
  1471  	c.urlParams_.Set("filter", filter)
  1472  	return c
  1473  }
  1474  
  1475  // OrderBy sets the optional parameter "orderBy": Comma-separated list of
  1476  // fields that that specify the order of the results. Default sorting order for
  1477  // a field is ascending. To specify descending order for a field, append a "
  1478  // desc" suffix. If not specified, the results will be returned in an
  1479  // unspecified order.
  1480  func (c *ProjectsLocationsWorkflowsListCall) OrderBy(orderBy string) *ProjectsLocationsWorkflowsListCall {
  1481  	c.urlParams_.Set("orderBy", orderBy)
  1482  	return c
  1483  }
  1484  
  1485  // PageSize sets the optional parameter "pageSize": Maximum number of workflows
  1486  // to return per call. The service may return fewer than this value. If the
  1487  // value is not specified, a default value of 500 will be used. The maximum
  1488  // permitted value is 1000 and values greater than 1000 will be coerced down to
  1489  // 1000.
  1490  func (c *ProjectsLocationsWorkflowsListCall) PageSize(pageSize int64) *ProjectsLocationsWorkflowsListCall {
  1491  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  1492  	return c
  1493  }
  1494  
  1495  // PageToken sets the optional parameter "pageToken": A page token, received
  1496  // from a previous `ListWorkflows` call. Provide this to retrieve the
  1497  // subsequent page. When paginating, all other parameters provided to
  1498  // `ListWorkflows` must match the call that provided the page token.
  1499  func (c *ProjectsLocationsWorkflowsListCall) PageToken(pageToken string) *ProjectsLocationsWorkflowsListCall {
  1500  	c.urlParams_.Set("pageToken", pageToken)
  1501  	return c
  1502  }
  1503  
  1504  // Fields allows partial responses to be retrieved. See
  1505  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1506  // details.
  1507  func (c *ProjectsLocationsWorkflowsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowsListCall {
  1508  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1509  	return c
  1510  }
  1511  
  1512  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1513  // object's ETag matches the given value. This is useful for getting updates
  1514  // only after the object has changed since the last request.
  1515  func (c *ProjectsLocationsWorkflowsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsWorkflowsListCall {
  1516  	c.ifNoneMatch_ = entityTag
  1517  	return c
  1518  }
  1519  
  1520  // Context sets the context to be used in this call's Do method.
  1521  func (c *ProjectsLocationsWorkflowsListCall) Context(ctx context.Context) *ProjectsLocationsWorkflowsListCall {
  1522  	c.ctx_ = ctx
  1523  	return c
  1524  }
  1525  
  1526  // Header returns a http.Header that can be modified by the caller to add
  1527  // headers to the request.
  1528  func (c *ProjectsLocationsWorkflowsListCall) Header() http.Header {
  1529  	if c.header_ == nil {
  1530  		c.header_ = make(http.Header)
  1531  	}
  1532  	return c.header_
  1533  }
  1534  
  1535  func (c *ProjectsLocationsWorkflowsListCall) doRequest(alt string) (*http.Response, error) {
  1536  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1537  	if c.ifNoneMatch_ != "" {
  1538  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1539  	}
  1540  	var body io.Reader = nil
  1541  	c.urlParams_.Set("alt", alt)
  1542  	c.urlParams_.Set("prettyPrint", "false")
  1543  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/workflows")
  1544  	urls += "?" + c.urlParams_.Encode()
  1545  	req, err := http.NewRequest("GET", urls, body)
  1546  	if err != nil {
  1547  		return nil, err
  1548  	}
  1549  	req.Header = reqHeaders
  1550  	googleapi.Expand(req.URL, map[string]string{
  1551  		"parent": c.parent,
  1552  	})
  1553  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1554  }
  1555  
  1556  // Do executes the "workflows.projects.locations.workflows.list" call.
  1557  // Any non-2xx status code is an error. Response headers are in either
  1558  // *ListWorkflowsResponse.ServerResponse.Header or (if a response was returned
  1559  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1560  // check whether the returned error was because http.StatusNotModified was
  1561  // returned.
  1562  func (c *ProjectsLocationsWorkflowsListCall) Do(opts ...googleapi.CallOption) (*ListWorkflowsResponse, error) {
  1563  	gensupport.SetOptions(c.urlParams_, opts...)
  1564  	res, err := c.doRequest("json")
  1565  	if res != nil && res.StatusCode == http.StatusNotModified {
  1566  		if res.Body != nil {
  1567  			res.Body.Close()
  1568  		}
  1569  		return nil, gensupport.WrapError(&googleapi.Error{
  1570  			Code:   res.StatusCode,
  1571  			Header: res.Header,
  1572  		})
  1573  	}
  1574  	if err != nil {
  1575  		return nil, err
  1576  	}
  1577  	defer googleapi.CloseBody(res)
  1578  	if err := googleapi.CheckResponse(res); err != nil {
  1579  		return nil, gensupport.WrapError(err)
  1580  	}
  1581  	ret := &ListWorkflowsResponse{
  1582  		ServerResponse: googleapi.ServerResponse{
  1583  			Header:         res.Header,
  1584  			HTTPStatusCode: res.StatusCode,
  1585  		},
  1586  	}
  1587  	target := &ret
  1588  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1589  		return nil, err
  1590  	}
  1591  	return ret, nil
  1592  }
  1593  
  1594  // Pages invokes f for each page of results.
  1595  // A non-nil error returned from f will halt the iteration.
  1596  // The provided context supersedes any context provided to the Context method.
  1597  func (c *ProjectsLocationsWorkflowsListCall) Pages(ctx context.Context, f func(*ListWorkflowsResponse) error) error {
  1598  	c.ctx_ = ctx
  1599  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  1600  	for {
  1601  		x, err := c.Do()
  1602  		if err != nil {
  1603  			return err
  1604  		}
  1605  		if err := f(x); err != nil {
  1606  			return err
  1607  		}
  1608  		if x.NextPageToken == "" {
  1609  			return nil
  1610  		}
  1611  		c.PageToken(x.NextPageToken)
  1612  	}
  1613  }
  1614  
  1615  type ProjectsLocationsWorkflowsPatchCall struct {
  1616  	s          *Service
  1617  	name       string
  1618  	workflow   *Workflow
  1619  	urlParams_ gensupport.URLParams
  1620  	ctx_       context.Context
  1621  	header_    http.Header
  1622  }
  1623  
  1624  // Patch: Updates an existing workflow. Running this method has no impact on
  1625  // already running executions of the workflow. A new revision of the workflow
  1626  // may be created as a result of a successful update operation. In that case,
  1627  // such revision will be used in new workflow executions.
  1628  //
  1629  //   - name: The resource name of the workflow. Format:
  1630  //     projects/{project}/locations/{location}/workflows/{workflow}.
  1631  func (r *ProjectsLocationsWorkflowsService) Patch(name string, workflow *Workflow) *ProjectsLocationsWorkflowsPatchCall {
  1632  	c := &ProjectsLocationsWorkflowsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1633  	c.name = name
  1634  	c.workflow = workflow
  1635  	return c
  1636  }
  1637  
  1638  // UpdateMask sets the optional parameter "updateMask": List of fields to be
  1639  // updated. If not present, the entire workflow will be updated.
  1640  func (c *ProjectsLocationsWorkflowsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsWorkflowsPatchCall {
  1641  	c.urlParams_.Set("updateMask", updateMask)
  1642  	return c
  1643  }
  1644  
  1645  // Fields allows partial responses to be retrieved. See
  1646  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1647  // details.
  1648  func (c *ProjectsLocationsWorkflowsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowsPatchCall {
  1649  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1650  	return c
  1651  }
  1652  
  1653  // Context sets the context to be used in this call's Do method.
  1654  func (c *ProjectsLocationsWorkflowsPatchCall) Context(ctx context.Context) *ProjectsLocationsWorkflowsPatchCall {
  1655  	c.ctx_ = ctx
  1656  	return c
  1657  }
  1658  
  1659  // Header returns a http.Header that can be modified by the caller to add
  1660  // headers to the request.
  1661  func (c *ProjectsLocationsWorkflowsPatchCall) Header() http.Header {
  1662  	if c.header_ == nil {
  1663  		c.header_ = make(http.Header)
  1664  	}
  1665  	return c.header_
  1666  }
  1667  
  1668  func (c *ProjectsLocationsWorkflowsPatchCall) doRequest(alt string) (*http.Response, error) {
  1669  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1670  	var body io.Reader = nil
  1671  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.workflow)
  1672  	if err != nil {
  1673  		return nil, err
  1674  	}
  1675  	c.urlParams_.Set("alt", alt)
  1676  	c.urlParams_.Set("prettyPrint", "false")
  1677  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}")
  1678  	urls += "?" + c.urlParams_.Encode()
  1679  	req, err := http.NewRequest("PATCH", urls, body)
  1680  	if err != nil {
  1681  		return nil, err
  1682  	}
  1683  	req.Header = reqHeaders
  1684  	googleapi.Expand(req.URL, map[string]string{
  1685  		"name": c.name,
  1686  	})
  1687  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1688  }
  1689  
  1690  // Do executes the "workflows.projects.locations.workflows.patch" call.
  1691  // Any non-2xx status code is an error. Response headers are in either
  1692  // *Operation.ServerResponse.Header or (if a response was returned at all) in
  1693  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1694  // whether the returned error was because http.StatusNotModified was returned.
  1695  func (c *ProjectsLocationsWorkflowsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  1696  	gensupport.SetOptions(c.urlParams_, opts...)
  1697  	res, err := c.doRequest("json")
  1698  	if res != nil && res.StatusCode == http.StatusNotModified {
  1699  		if res.Body != nil {
  1700  			res.Body.Close()
  1701  		}
  1702  		return nil, gensupport.WrapError(&googleapi.Error{
  1703  			Code:   res.StatusCode,
  1704  			Header: res.Header,
  1705  		})
  1706  	}
  1707  	if err != nil {
  1708  		return nil, err
  1709  	}
  1710  	defer googleapi.CloseBody(res)
  1711  	if err := googleapi.CheckResponse(res); err != nil {
  1712  		return nil, gensupport.WrapError(err)
  1713  	}
  1714  	ret := &Operation{
  1715  		ServerResponse: googleapi.ServerResponse{
  1716  			Header:         res.Header,
  1717  			HTTPStatusCode: res.StatusCode,
  1718  		},
  1719  	}
  1720  	target := &ret
  1721  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1722  		return nil, err
  1723  	}
  1724  	return ret, nil
  1725  }
  1726  

View as plain text