...

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

Documentation: google.golang.org/api/workflows/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 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/v1"
    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/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 = "workflows:v1"
    90  const apiName = "workflows"
    91  const apiVersion = "v1"
    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  // ListWorkflowRevisionsResponse: Response for the ListWorkflowRevisions
   268  // method.
   269  type ListWorkflowRevisionsResponse struct {
   270  	// NextPageToken: A token, which can be sent as `page_token` to retrieve the
   271  	// next page. If this field is omitted, there are no subsequent pages.
   272  	NextPageToken string `json:"nextPageToken,omitempty"`
   273  	// Workflows: The revisions of the workflow, ordered in reverse chronological
   274  	// order.
   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 *ListWorkflowRevisionsResponse) MarshalJSON() ([]byte, error) {
   293  	type NoMethod ListWorkflowRevisionsResponse
   294  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   295  }
   296  
   297  // ListWorkflowsResponse: Response for the ListWorkflows method.
   298  type ListWorkflowsResponse struct {
   299  	// NextPageToken: A token, which can be sent as `page_token` to retrieve the
   300  	// next page. If this field is omitted, there are no subsequent pages.
   301  	NextPageToken string `json:"nextPageToken,omitempty"`
   302  	// Unreachable: Unreachable resources.
   303  	Unreachable []string `json:"unreachable,omitempty"`
   304  	// Workflows: The workflows that match the request.
   305  	Workflows []*Workflow `json:"workflows,omitempty"`
   306  
   307  	// ServerResponse contains the HTTP response code and headers from the server.
   308  	googleapi.ServerResponse `json:"-"`
   309  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
   310  	// unconditionally include in API requests. By default, fields with empty or
   311  	// default values are omitted from API requests. See
   312  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   313  	// details.
   314  	ForceSendFields []string `json:"-"`
   315  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
   316  	// requests with the JSON null value. By default, fields with empty values are
   317  	// omitted from API requests. See
   318  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   319  	NullFields []string `json:"-"`
   320  }
   321  
   322  func (s *ListWorkflowsResponse) MarshalJSON() ([]byte, error) {
   323  	type NoMethod ListWorkflowsResponse
   324  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   325  }
   326  
   327  // Location: A resource that represents a Google Cloud location.
   328  type Location struct {
   329  	// DisplayName: The friendly name for this location, typically a nearby city
   330  	// name. For example, "Tokyo".
   331  	DisplayName string `json:"displayName,omitempty"`
   332  	// Labels: Cross-service attributes for the location. For example
   333  	// {"cloud.googleapis.com/region": "us-east1"}
   334  	Labels map[string]string `json:"labels,omitempty"`
   335  	// LocationId: The canonical id for this location. For example: "us-east1".
   336  	LocationId string `json:"locationId,omitempty"`
   337  	// Metadata: Service-specific metadata. For example the available capacity at
   338  	// the given location.
   339  	Metadata googleapi.RawMessage `json:"metadata,omitempty"`
   340  	// Name: Resource name for the location, which may vary between
   341  	// implementations. For example:
   342  	// "projects/example-project/locations/us-east1"
   343  	Name string `json:"name,omitempty"`
   344  
   345  	// ServerResponse contains the HTTP response code and headers from the server.
   346  	googleapi.ServerResponse `json:"-"`
   347  	// ForceSendFields is a list of field names (e.g. "DisplayName") to
   348  	// unconditionally include in API requests. By default, fields with empty or
   349  	// default values are omitted from API requests. See
   350  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   351  	// details.
   352  	ForceSendFields []string `json:"-"`
   353  	// NullFields is a list of field names (e.g. "DisplayName") to include in API
   354  	// requests with the JSON null value. By default, fields with empty values are
   355  	// omitted from API requests. See
   356  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   357  	NullFields []string `json:"-"`
   358  }
   359  
   360  func (s *Location) MarshalJSON() ([]byte, error) {
   361  	type NoMethod Location
   362  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   363  }
   364  
   365  // Operation: This resource represents a long-running operation that is the
   366  // result of a network API call.
   367  type Operation struct {
   368  	// Done: If the value is `false`, it means the operation is still in progress.
   369  	// If `true`, the operation is completed, and either `error` or `response` is
   370  	// available.
   371  	Done bool `json:"done,omitempty"`
   372  	// Error: The error result of the operation in case of failure or cancellation.
   373  	Error *Status `json:"error,omitempty"`
   374  	// Metadata: Service-specific metadata associated with the operation. It
   375  	// typically contains progress information and common metadata such as create
   376  	// time. Some services might not provide such metadata. Any method that returns
   377  	// a long-running operation should document the metadata type, if any.
   378  	Metadata googleapi.RawMessage `json:"metadata,omitempty"`
   379  	// Name: The server-assigned name, which is only unique within the same service
   380  	// that originally returns it. If you use the default HTTP mapping, the `name`
   381  	// should be a resource name ending with `operations/{unique_id}`.
   382  	Name string `json:"name,omitempty"`
   383  	// Response: The normal, successful response of the operation. If the original
   384  	// method returns no data on success, such as `Delete`, the response is
   385  	// `google.protobuf.Empty`. If the original method is standard
   386  	// `Get`/`Create`/`Update`, the response should be the resource. For other
   387  	// methods, the response should have the type `XxxResponse`, where `Xxx` is the
   388  	// original method name. For example, if the original method name is
   389  	// `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
   390  	Response googleapi.RawMessage `json:"response,omitempty"`
   391  
   392  	// ServerResponse contains the HTTP response code and headers from the server.
   393  	googleapi.ServerResponse `json:"-"`
   394  	// ForceSendFields is a list of field names (e.g. "Done") to unconditionally
   395  	// include in API requests. By default, fields with empty or default values are
   396  	// 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. "Done") to include in API requests
   401  	// with the JSON null value. By default, fields with empty values are omitted
   402  	// 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 *Operation) MarshalJSON() ([]byte, error) {
   408  	type NoMethod Operation
   409  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   410  }
   411  
   412  // OperationMetadata: Represents the metadata of the long-running operation.
   413  type OperationMetadata struct {
   414  	// ApiVersion: API version used to start the operation.
   415  	ApiVersion string `json:"apiVersion,omitempty"`
   416  	// CreateTime: The time the operation was created.
   417  	CreateTime string `json:"createTime,omitempty"`
   418  	// EndTime: The time the operation finished running.
   419  	EndTime string `json:"endTime,omitempty"`
   420  	// Target: Server-defined resource path for the target of the operation.
   421  	Target string `json:"target,omitempty"`
   422  	// Verb: Name of the verb executed by the operation.
   423  	Verb string `json:"verb,omitempty"`
   424  	// ForceSendFields is a list of field names (e.g. "ApiVersion") to
   425  	// unconditionally include in API requests. By default, fields with empty or
   426  	// default values are omitted from API requests. See
   427  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   428  	// details.
   429  	ForceSendFields []string `json:"-"`
   430  	// NullFields is a list of field names (e.g. "ApiVersion") to include in API
   431  	// requests with the JSON null value. By default, fields with empty values are
   432  	// omitted from API requests. See
   433  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   434  	NullFields []string `json:"-"`
   435  }
   436  
   437  func (s *OperationMetadata) MarshalJSON() ([]byte, error) {
   438  	type NoMethod OperationMetadata
   439  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   440  }
   441  
   442  // StateError: Describes an error related to the current state of the workflow.
   443  type StateError struct {
   444  	// Details: Provides specifics about the error.
   445  	Details string `json:"details,omitempty"`
   446  	// Type: The type of this state error.
   447  	//
   448  	// Possible values:
   449  	//   "TYPE_UNSPECIFIED" - No type specified.
   450  	//   "KMS_ERROR" - Caused by an issue with KMS.
   451  	Type string `json:"type,omitempty"`
   452  	// ForceSendFields is a list of field names (e.g. "Details") to unconditionally
   453  	// include in API requests. By default, fields with empty or default values are
   454  	// omitted from API requests. See
   455  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   456  	// details.
   457  	ForceSendFields []string `json:"-"`
   458  	// NullFields is a list of field names (e.g. "Details") to include in API
   459  	// requests with the JSON null value. By default, fields with empty values are
   460  	// omitted from API requests. See
   461  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   462  	NullFields []string `json:"-"`
   463  }
   464  
   465  func (s *StateError) MarshalJSON() ([]byte, error) {
   466  	type NoMethod StateError
   467  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   468  }
   469  
   470  // Status: The `Status` type defines a logical error model that is suitable for
   471  // different programming environments, including REST APIs and RPC APIs. It is
   472  // used by gRPC (https://github.com/grpc). Each `Status` message contains three
   473  // pieces of data: error code, error message, and error details. You can find
   474  // out more about this error model and how to work with it in the API Design
   475  // Guide (https://cloud.google.com/apis/design/errors).
   476  type Status struct {
   477  	// Code: The status code, which should be an enum value of google.rpc.Code.
   478  	Code int64 `json:"code,omitempty"`
   479  	// Details: A list of messages that carry the error details. There is a common
   480  	// set of message types for APIs to use.
   481  	Details []googleapi.RawMessage `json:"details,omitempty"`
   482  	// Message: A developer-facing error message, which should be in English. Any
   483  	// user-facing error message should be localized and sent in the
   484  	// google.rpc.Status.details field, or localized by the client.
   485  	Message string `json:"message,omitempty"`
   486  	// ForceSendFields is a list of field names (e.g. "Code") to unconditionally
   487  	// include in API requests. By default, fields with empty or default values are
   488  	// omitted from API requests. See
   489  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   490  	// details.
   491  	ForceSendFields []string `json:"-"`
   492  	// NullFields is a list of field names (e.g. "Code") to include in API requests
   493  	// with the JSON null value. By default, fields with empty values are omitted
   494  	// from API requests. See
   495  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   496  	NullFields []string `json:"-"`
   497  }
   498  
   499  func (s *Status) MarshalJSON() ([]byte, error) {
   500  	type NoMethod Status
   501  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   502  }
   503  
   504  // Workflow: Workflow program to be executed by Workflows.
   505  type Workflow struct {
   506  	// CallLogLevel: Optional. Describes the level of platform logging to apply to
   507  	// calls and call responses during executions of this workflow. If both the
   508  	// workflow and the execution specify a logging level, the execution level
   509  	// takes precedence.
   510  	//
   511  	// Possible values:
   512  	//   "CALL_LOG_LEVEL_UNSPECIFIED" - No call logging level specified.
   513  	//   "LOG_ALL_CALLS" - Log all call steps within workflows, all call returns,
   514  	// and all exceptions raised.
   515  	//   "LOG_ERRORS_ONLY" - Log only exceptions that are raised from call steps
   516  	// within workflows.
   517  	//   "LOG_NONE" - Explicitly log nothing.
   518  	CallLogLevel string `json:"callLogLevel,omitempty"`
   519  	// CreateTime: Output only. The timestamp for when the workflow was created.
   520  	// This is a workflow-wide field and is not tied to a specific revision.
   521  	CreateTime string `json:"createTime,omitempty"`
   522  	// CryptoKeyName: Optional. The resource name of a KMS crypto key used to
   523  	// encrypt or decrypt the data associated with the workflow. Format:
   524  	// projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{crypto
   525  	// Key} Using `-` as a wildcard for the `{project}` or not providing one at all
   526  	// will infer the project from the account. If not provided, data associated
   527  	// with the workflow will not be CMEK-encrypted.
   528  	CryptoKeyName string `json:"cryptoKeyName,omitempty"`
   529  	// Description: Description of the workflow provided by the user. Must be at
   530  	// most 1000 Unicode characters long. This is a workflow-wide field and is not
   531  	// tied to a specific revision.
   532  	Description string `json:"description,omitempty"`
   533  	// Labels: Labels associated with this workflow. Labels can contain at most 64
   534  	// entries. Keys and values can be no longer than 63 characters and can only
   535  	// contain lowercase letters, numeric characters, underscores, and dashes.
   536  	// Label keys must start with a letter. International characters are allowed.
   537  	// This is a workflow-wide field and is not tied to a specific revision.
   538  	Labels map[string]string `json:"labels,omitempty"`
   539  	// Name: The resource name of the workflow. Format:
   540  	// projects/{project}/locations/{location}/workflows/{workflow}. This is a
   541  	// workflow-wide field and is not tied to a specific revision.
   542  	Name string `json:"name,omitempty"`
   543  	// RevisionCreateTime: Output only. The timestamp for the latest revision of
   544  	// the workflow's creation.
   545  	RevisionCreateTime string `json:"revisionCreateTime,omitempty"`
   546  	// RevisionId: Output only. The revision of the workflow. A new revision of a
   547  	// workflow is created as a result of updating the following properties of a
   548  	// workflow: - Service account - Workflow code to be executed The format is
   549  	// "000001-a4d", where the first six characters define the zero-padded revision
   550  	// ordinal number. They are followed by a hyphen and three hexadecimal random
   551  	// characters.
   552  	RevisionId string `json:"revisionId,omitempty"`
   553  	// ServiceAccount: The service account associated with the latest workflow
   554  	// version. This service account represents the identity of the workflow and
   555  	// determines what permissions the workflow has. Format:
   556  	// projects/{project}/serviceAccounts/{account} or {account} Using `-` as a
   557  	// wildcard for the `{project}` or not providing one at all will infer the
   558  	// project from the account. The `{account}` value can be the `email` address
   559  	// or the `unique_id` of the service account. If not provided, workflow will
   560  	// use the project's default service account. Modifying this field for an
   561  	// existing workflow results in a new workflow revision.
   562  	ServiceAccount string `json:"serviceAccount,omitempty"`
   563  	// SourceContents: Workflow code to be executed. The size limit is 128KB.
   564  	SourceContents string `json:"sourceContents,omitempty"`
   565  	// State: Output only. State of the workflow deployment.
   566  	//
   567  	// Possible values:
   568  	//   "STATE_UNSPECIFIED" - Invalid state.
   569  	//   "ACTIVE" - The workflow has been deployed successfully and is serving.
   570  	//   "UNAVAILABLE" - Workflow data is unavailable. See the `state_error` field.
   571  	State string `json:"state,omitempty"`
   572  	// StateError: Output only. Error regarding the state of the workflow. For
   573  	// example, this field will have error details if the execution data is
   574  	// unavailable due to revoked KMS key permissions.
   575  	StateError *StateError `json:"stateError,omitempty"`
   576  	// UpdateTime: Output only. The timestamp for when the workflow was last
   577  	// updated. This is a workflow-wide field and is not tied to a specific
   578  	// revision.
   579  	UpdateTime string `json:"updateTime,omitempty"`
   580  	// UserEnvVars: Optional. User-defined environment variables associated with
   581  	// this workflow revision. This map has a maximum length of 20. Each string can
   582  	// take up to 4KiB. Keys cannot be empty strings and cannot start with "GOOGLE"
   583  	// or "WORKFLOWS".
   584  	UserEnvVars map[string]string `json:"userEnvVars,omitempty"`
   585  
   586  	// ServerResponse contains the HTTP response code and headers from the server.
   587  	googleapi.ServerResponse `json:"-"`
   588  	// ForceSendFields is a list of field names (e.g. "CallLogLevel") to
   589  	// unconditionally include in API requests. By default, fields with empty or
   590  	// default values are omitted from API requests. See
   591  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   592  	// details.
   593  	ForceSendFields []string `json:"-"`
   594  	// NullFields is a list of field names (e.g. "CallLogLevel") to include in API
   595  	// requests with the JSON null value. By default, fields with empty values are
   596  	// omitted from API requests. See
   597  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   598  	NullFields []string `json:"-"`
   599  }
   600  
   601  func (s *Workflow) MarshalJSON() ([]byte, error) {
   602  	type NoMethod Workflow
   603  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   604  }
   605  
   606  type ProjectsLocationsGetCall struct {
   607  	s            *Service
   608  	name         string
   609  	urlParams_   gensupport.URLParams
   610  	ifNoneMatch_ string
   611  	ctx_         context.Context
   612  	header_      http.Header
   613  }
   614  
   615  // Get: Gets information about a location.
   616  //
   617  // - name: Resource name for the location.
   618  func (r *ProjectsLocationsService) Get(name string) *ProjectsLocationsGetCall {
   619  	c := &ProjectsLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
   620  	c.name = name
   621  	return c
   622  }
   623  
   624  // Fields allows partial responses to be retrieved. See
   625  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
   626  // details.
   627  func (c *ProjectsLocationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGetCall {
   628  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
   629  	return c
   630  }
   631  
   632  // IfNoneMatch sets an optional parameter which makes the operation fail if the
   633  // object's ETag matches the given value. This is useful for getting updates
   634  // only after the object has changed since the last request.
   635  func (c *ProjectsLocationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGetCall {
   636  	c.ifNoneMatch_ = entityTag
   637  	return c
   638  }
   639  
   640  // Context sets the context to be used in this call's Do method.
   641  func (c *ProjectsLocationsGetCall) Context(ctx context.Context) *ProjectsLocationsGetCall {
   642  	c.ctx_ = ctx
   643  	return c
   644  }
   645  
   646  // Header returns a http.Header that can be modified by the caller to add
   647  // headers to the request.
   648  func (c *ProjectsLocationsGetCall) Header() http.Header {
   649  	if c.header_ == nil {
   650  		c.header_ = make(http.Header)
   651  	}
   652  	return c.header_
   653  }
   654  
   655  func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) {
   656  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
   657  	if c.ifNoneMatch_ != "" {
   658  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
   659  	}
   660  	var body io.Reader = nil
   661  	c.urlParams_.Set("alt", alt)
   662  	c.urlParams_.Set("prettyPrint", "false")
   663  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
   664  	urls += "?" + c.urlParams_.Encode()
   665  	req, err := http.NewRequest("GET", urls, body)
   666  	if err != nil {
   667  		return nil, err
   668  	}
   669  	req.Header = reqHeaders
   670  	googleapi.Expand(req.URL, map[string]string{
   671  		"name": c.name,
   672  	})
   673  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
   674  }
   675  
   676  // Do executes the "workflows.projects.locations.get" call.
   677  // Any non-2xx status code is an error. Response headers are in either
   678  // *Location.ServerResponse.Header or (if a response was returned at all) in
   679  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
   680  // whether the returned error was because http.StatusNotModified was returned.
   681  func (c *ProjectsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) {
   682  	gensupport.SetOptions(c.urlParams_, opts...)
   683  	res, err := c.doRequest("json")
   684  	if res != nil && res.StatusCode == http.StatusNotModified {
   685  		if res.Body != nil {
   686  			res.Body.Close()
   687  		}
   688  		return nil, gensupport.WrapError(&googleapi.Error{
   689  			Code:   res.StatusCode,
   690  			Header: res.Header,
   691  		})
   692  	}
   693  	if err != nil {
   694  		return nil, err
   695  	}
   696  	defer googleapi.CloseBody(res)
   697  	if err := googleapi.CheckResponse(res); err != nil {
   698  		return nil, gensupport.WrapError(err)
   699  	}
   700  	ret := &Location{
   701  		ServerResponse: googleapi.ServerResponse{
   702  			Header:         res.Header,
   703  			HTTPStatusCode: res.StatusCode,
   704  		},
   705  	}
   706  	target := &ret
   707  	if err := gensupport.DecodeResponse(target, res); err != nil {
   708  		return nil, err
   709  	}
   710  	return ret, nil
   711  }
   712  
   713  type ProjectsLocationsListCall struct {
   714  	s            *Service
   715  	name         string
   716  	urlParams_   gensupport.URLParams
   717  	ifNoneMatch_ string
   718  	ctx_         context.Context
   719  	header_      http.Header
   720  }
   721  
   722  // List: Lists information about the supported locations for this service.
   723  //
   724  // - name: The resource that owns the locations collection, if applicable.
   725  func (r *ProjectsLocationsService) List(name string) *ProjectsLocationsListCall {
   726  	c := &ProjectsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
   727  	c.name = name
   728  	return c
   729  }
   730  
   731  // Filter sets the optional parameter "filter": A filter to narrow down results
   732  // to a preferred subset. The filtering language accepts strings like
   733  // "displayName=tokyo", and is documented in more detail in AIP-160
   734  // (https://google.aip.dev/160).
   735  func (c *ProjectsLocationsListCall) Filter(filter string) *ProjectsLocationsListCall {
   736  	c.urlParams_.Set("filter", filter)
   737  	return c
   738  }
   739  
   740  // PageSize sets the optional parameter "pageSize": The maximum number of
   741  // results to return. If not set, the service selects a default.
   742  func (c *ProjectsLocationsListCall) PageSize(pageSize int64) *ProjectsLocationsListCall {
   743  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
   744  	return c
   745  }
   746  
   747  // PageToken sets the optional parameter "pageToken": A page token received
   748  // from the `next_page_token` field in the response. Send that page token to
   749  // receive the subsequent page.
   750  func (c *ProjectsLocationsListCall) PageToken(pageToken string) *ProjectsLocationsListCall {
   751  	c.urlParams_.Set("pageToken", pageToken)
   752  	return c
   753  }
   754  
   755  // Fields allows partial responses to be retrieved. See
   756  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
   757  // details.
   758  func (c *ProjectsLocationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsListCall {
   759  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
   760  	return c
   761  }
   762  
   763  // IfNoneMatch sets an optional parameter which makes the operation fail if the
   764  // object's ETag matches the given value. This is useful for getting updates
   765  // only after the object has changed since the last request.
   766  func (c *ProjectsLocationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsListCall {
   767  	c.ifNoneMatch_ = entityTag
   768  	return c
   769  }
   770  
   771  // Context sets the context to be used in this call's Do method.
   772  func (c *ProjectsLocationsListCall) Context(ctx context.Context) *ProjectsLocationsListCall {
   773  	c.ctx_ = ctx
   774  	return c
   775  }
   776  
   777  // Header returns a http.Header that can be modified by the caller to add
   778  // headers to the request.
   779  func (c *ProjectsLocationsListCall) Header() http.Header {
   780  	if c.header_ == nil {
   781  		c.header_ = make(http.Header)
   782  	}
   783  	return c.header_
   784  }
   785  
   786  func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error) {
   787  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
   788  	if c.ifNoneMatch_ != "" {
   789  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
   790  	}
   791  	var body io.Reader = nil
   792  	c.urlParams_.Set("alt", alt)
   793  	c.urlParams_.Set("prettyPrint", "false")
   794  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations")
   795  	urls += "?" + c.urlParams_.Encode()
   796  	req, err := http.NewRequest("GET", urls, body)
   797  	if err != nil {
   798  		return nil, err
   799  	}
   800  	req.Header = reqHeaders
   801  	googleapi.Expand(req.URL, map[string]string{
   802  		"name": c.name,
   803  	})
   804  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
   805  }
   806  
   807  // Do executes the "workflows.projects.locations.list" call.
   808  // Any non-2xx status code is an error. Response headers are in either
   809  // *ListLocationsResponse.ServerResponse.Header or (if a response was returned
   810  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
   811  // check whether the returned error was because http.StatusNotModified was
   812  // returned.
   813  func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) {
   814  	gensupport.SetOptions(c.urlParams_, opts...)
   815  	res, err := c.doRequest("json")
   816  	if res != nil && res.StatusCode == http.StatusNotModified {
   817  		if res.Body != nil {
   818  			res.Body.Close()
   819  		}
   820  		return nil, gensupport.WrapError(&googleapi.Error{
   821  			Code:   res.StatusCode,
   822  			Header: res.Header,
   823  		})
   824  	}
   825  	if err != nil {
   826  		return nil, err
   827  	}
   828  	defer googleapi.CloseBody(res)
   829  	if err := googleapi.CheckResponse(res); err != nil {
   830  		return nil, gensupport.WrapError(err)
   831  	}
   832  	ret := &ListLocationsResponse{
   833  		ServerResponse: googleapi.ServerResponse{
   834  			Header:         res.Header,
   835  			HTTPStatusCode: res.StatusCode,
   836  		},
   837  	}
   838  	target := &ret
   839  	if err := gensupport.DecodeResponse(target, res); err != nil {
   840  		return nil, err
   841  	}
   842  	return ret, nil
   843  }
   844  
   845  // Pages invokes f for each page of results.
   846  // A non-nil error returned from f will halt the iteration.
   847  // The provided context supersedes any context provided to the Context method.
   848  func (c *ProjectsLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error {
   849  	c.ctx_ = ctx
   850  	defer c.PageToken(c.urlParams_.Get("pageToken"))
   851  	for {
   852  		x, err := c.Do()
   853  		if err != nil {
   854  			return err
   855  		}
   856  		if err := f(x); err != nil {
   857  			return err
   858  		}
   859  		if x.NextPageToken == "" {
   860  			return nil
   861  		}
   862  		c.PageToken(x.NextPageToken)
   863  	}
   864  }
   865  
   866  type ProjectsLocationsOperationsDeleteCall struct {
   867  	s          *Service
   868  	name       string
   869  	urlParams_ gensupport.URLParams
   870  	ctx_       context.Context
   871  	header_    http.Header
   872  }
   873  
   874  // Delete: Deletes a long-running operation. This method indicates that the
   875  // client is no longer interested in the operation result. It does not cancel
   876  // the operation. If the server doesn't support this method, it returns
   877  // `google.rpc.Code.UNIMPLEMENTED`.
   878  //
   879  // - name: The name of the operation resource to be deleted.
   880  func (r *ProjectsLocationsOperationsService) Delete(name string) *ProjectsLocationsOperationsDeleteCall {
   881  	c := &ProjectsLocationsOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
   882  	c.name = name
   883  	return c
   884  }
   885  
   886  // Fields allows partial responses to be retrieved. See
   887  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
   888  // details.
   889  func (c *ProjectsLocationsOperationsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsDeleteCall {
   890  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
   891  	return c
   892  }
   893  
   894  // Context sets the context to be used in this call's Do method.
   895  func (c *ProjectsLocationsOperationsDeleteCall) Context(ctx context.Context) *ProjectsLocationsOperationsDeleteCall {
   896  	c.ctx_ = ctx
   897  	return c
   898  }
   899  
   900  // Header returns a http.Header that can be modified by the caller to add
   901  // headers to the request.
   902  func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header {
   903  	if c.header_ == nil {
   904  		c.header_ = make(http.Header)
   905  	}
   906  	return c.header_
   907  }
   908  
   909  func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
   910  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
   911  	var body io.Reader = nil
   912  	c.urlParams_.Set("alt", alt)
   913  	c.urlParams_.Set("prettyPrint", "false")
   914  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
   915  	urls += "?" + c.urlParams_.Encode()
   916  	req, err := http.NewRequest("DELETE", urls, body)
   917  	if err != nil {
   918  		return nil, err
   919  	}
   920  	req.Header = reqHeaders
   921  	googleapi.Expand(req.URL, map[string]string{
   922  		"name": c.name,
   923  	})
   924  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
   925  }
   926  
   927  // Do executes the "workflows.projects.locations.operations.delete" call.
   928  // Any non-2xx status code is an error. Response headers are in either
   929  // *Empty.ServerResponse.Header or (if a response was returned at all) in
   930  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
   931  // whether the returned error was because http.StatusNotModified was returned.
   932  func (c *ProjectsLocationsOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
   933  	gensupport.SetOptions(c.urlParams_, opts...)
   934  	res, err := c.doRequest("json")
   935  	if res != nil && res.StatusCode == http.StatusNotModified {
   936  		if res.Body != nil {
   937  			res.Body.Close()
   938  		}
   939  		return nil, gensupport.WrapError(&googleapi.Error{
   940  			Code:   res.StatusCode,
   941  			Header: res.Header,
   942  		})
   943  	}
   944  	if err != nil {
   945  		return nil, err
   946  	}
   947  	defer googleapi.CloseBody(res)
   948  	if err := googleapi.CheckResponse(res); err != nil {
   949  		return nil, gensupport.WrapError(err)
   950  	}
   951  	ret := &Empty{
   952  		ServerResponse: googleapi.ServerResponse{
   953  			Header:         res.Header,
   954  			HTTPStatusCode: res.StatusCode,
   955  		},
   956  	}
   957  	target := &ret
   958  	if err := gensupport.DecodeResponse(target, res); err != nil {
   959  		return nil, err
   960  	}
   961  	return ret, nil
   962  }
   963  
   964  type ProjectsLocationsOperationsGetCall struct {
   965  	s            *Service
   966  	name         string
   967  	urlParams_   gensupport.URLParams
   968  	ifNoneMatch_ string
   969  	ctx_         context.Context
   970  	header_      http.Header
   971  }
   972  
   973  // Get: Gets the latest state of a long-running operation. Clients can use this
   974  // method to poll the operation result at intervals as recommended by the API
   975  // service.
   976  //
   977  // - name: The name of the operation resource.
   978  func (r *ProjectsLocationsOperationsService) Get(name string) *ProjectsLocationsOperationsGetCall {
   979  	c := &ProjectsLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
   980  	c.name = name
   981  	return c
   982  }
   983  
   984  // Fields allows partial responses to be retrieved. See
   985  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
   986  // details.
   987  func (c *ProjectsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsGetCall {
   988  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
   989  	return c
   990  }
   991  
   992  // IfNoneMatch sets an optional parameter which makes the operation fail if the
   993  // object's ETag matches the given value. This is useful for getting updates
   994  // only after the object has changed since the last request.
   995  func (c *ProjectsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsGetCall {
   996  	c.ifNoneMatch_ = entityTag
   997  	return c
   998  }
   999  
  1000  // Context sets the context to be used in this call's Do method.
  1001  func (c *ProjectsLocationsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsOperationsGetCall {
  1002  	c.ctx_ = ctx
  1003  	return c
  1004  }
  1005  
  1006  // Header returns a http.Header that can be modified by the caller to add
  1007  // headers to the request.
  1008  func (c *ProjectsLocationsOperationsGetCall) Header() http.Header {
  1009  	if c.header_ == nil {
  1010  		c.header_ = make(http.Header)
  1011  	}
  1012  	return c.header_
  1013  }
  1014  
  1015  func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  1016  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1017  	if c.ifNoneMatch_ != "" {
  1018  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1019  	}
  1020  	var body io.Reader = nil
  1021  	c.urlParams_.Set("alt", alt)
  1022  	c.urlParams_.Set("prettyPrint", "false")
  1023  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  1024  	urls += "?" + c.urlParams_.Encode()
  1025  	req, err := http.NewRequest("GET", urls, body)
  1026  	if err != nil {
  1027  		return nil, err
  1028  	}
  1029  	req.Header = reqHeaders
  1030  	googleapi.Expand(req.URL, map[string]string{
  1031  		"name": c.name,
  1032  	})
  1033  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1034  }
  1035  
  1036  // Do executes the "workflows.projects.locations.operations.get" call.
  1037  // Any non-2xx status code is an error. Response headers are in either
  1038  // *Operation.ServerResponse.Header or (if a response was returned at all) in
  1039  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1040  // whether the returned error was because http.StatusNotModified was returned.
  1041  func (c *ProjectsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  1042  	gensupport.SetOptions(c.urlParams_, opts...)
  1043  	res, err := c.doRequest("json")
  1044  	if res != nil && res.StatusCode == http.StatusNotModified {
  1045  		if res.Body != nil {
  1046  			res.Body.Close()
  1047  		}
  1048  		return nil, gensupport.WrapError(&googleapi.Error{
  1049  			Code:   res.StatusCode,
  1050  			Header: res.Header,
  1051  		})
  1052  	}
  1053  	if err != nil {
  1054  		return nil, err
  1055  	}
  1056  	defer googleapi.CloseBody(res)
  1057  	if err := googleapi.CheckResponse(res); err != nil {
  1058  		return nil, gensupport.WrapError(err)
  1059  	}
  1060  	ret := &Operation{
  1061  		ServerResponse: googleapi.ServerResponse{
  1062  			Header:         res.Header,
  1063  			HTTPStatusCode: res.StatusCode,
  1064  		},
  1065  	}
  1066  	target := &ret
  1067  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1068  		return nil, err
  1069  	}
  1070  	return ret, nil
  1071  }
  1072  
  1073  type ProjectsLocationsOperationsListCall struct {
  1074  	s            *Service
  1075  	name         string
  1076  	urlParams_   gensupport.URLParams
  1077  	ifNoneMatch_ string
  1078  	ctx_         context.Context
  1079  	header_      http.Header
  1080  }
  1081  
  1082  // List: Lists operations that match the specified filter in the request. If
  1083  // the server doesn't support this method, it returns `UNIMPLEMENTED`.
  1084  //
  1085  // - name: The name of the operation's parent resource.
  1086  func (r *ProjectsLocationsOperationsService) List(name string) *ProjectsLocationsOperationsListCall {
  1087  	c := &ProjectsLocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1088  	c.name = name
  1089  	return c
  1090  }
  1091  
  1092  // Filter sets the optional parameter "filter": The standard list filter.
  1093  func (c *ProjectsLocationsOperationsListCall) Filter(filter string) *ProjectsLocationsOperationsListCall {
  1094  	c.urlParams_.Set("filter", filter)
  1095  	return c
  1096  }
  1097  
  1098  // PageSize sets the optional parameter "pageSize": The standard list page
  1099  // size.
  1100  func (c *ProjectsLocationsOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsOperationsListCall {
  1101  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  1102  	return c
  1103  }
  1104  
  1105  // PageToken sets the optional parameter "pageToken": The standard list page
  1106  // token.
  1107  func (c *ProjectsLocationsOperationsListCall) PageToken(pageToken string) *ProjectsLocationsOperationsListCall {
  1108  	c.urlParams_.Set("pageToken", pageToken)
  1109  	return c
  1110  }
  1111  
  1112  // Fields allows partial responses to be retrieved. See
  1113  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1114  // details.
  1115  func (c *ProjectsLocationsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsListCall {
  1116  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1117  	return c
  1118  }
  1119  
  1120  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1121  // object's ETag matches the given value. This is useful for getting updates
  1122  // only after the object has changed since the last request.
  1123  func (c *ProjectsLocationsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsListCall {
  1124  	c.ifNoneMatch_ = entityTag
  1125  	return c
  1126  }
  1127  
  1128  // Context sets the context to be used in this call's Do method.
  1129  func (c *ProjectsLocationsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsOperationsListCall {
  1130  	c.ctx_ = ctx
  1131  	return c
  1132  }
  1133  
  1134  // Header returns a http.Header that can be modified by the caller to add
  1135  // headers to the request.
  1136  func (c *ProjectsLocationsOperationsListCall) Header() http.Header {
  1137  	if c.header_ == nil {
  1138  		c.header_ = make(http.Header)
  1139  	}
  1140  	return c.header_
  1141  }
  1142  
  1143  func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Response, error) {
  1144  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1145  	if c.ifNoneMatch_ != "" {
  1146  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1147  	}
  1148  	var body io.Reader = nil
  1149  	c.urlParams_.Set("alt", alt)
  1150  	c.urlParams_.Set("prettyPrint", "false")
  1151  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations")
  1152  	urls += "?" + c.urlParams_.Encode()
  1153  	req, err := http.NewRequest("GET", urls, body)
  1154  	if err != nil {
  1155  		return nil, err
  1156  	}
  1157  	req.Header = reqHeaders
  1158  	googleapi.Expand(req.URL, map[string]string{
  1159  		"name": c.name,
  1160  	})
  1161  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1162  }
  1163  
  1164  // Do executes the "workflows.projects.locations.operations.list" call.
  1165  // Any non-2xx status code is an error. Response headers are in either
  1166  // *ListOperationsResponse.ServerResponse.Header or (if a response was returned
  1167  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1168  // check whether the returned error was because http.StatusNotModified was
  1169  // returned.
  1170  func (c *ProjectsLocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) {
  1171  	gensupport.SetOptions(c.urlParams_, opts...)
  1172  	res, err := c.doRequest("json")
  1173  	if res != nil && res.StatusCode == http.StatusNotModified {
  1174  		if res.Body != nil {
  1175  			res.Body.Close()
  1176  		}
  1177  		return nil, gensupport.WrapError(&googleapi.Error{
  1178  			Code:   res.StatusCode,
  1179  			Header: res.Header,
  1180  		})
  1181  	}
  1182  	if err != nil {
  1183  		return nil, err
  1184  	}
  1185  	defer googleapi.CloseBody(res)
  1186  	if err := googleapi.CheckResponse(res); err != nil {
  1187  		return nil, gensupport.WrapError(err)
  1188  	}
  1189  	ret := &ListOperationsResponse{
  1190  		ServerResponse: googleapi.ServerResponse{
  1191  			Header:         res.Header,
  1192  			HTTPStatusCode: res.StatusCode,
  1193  		},
  1194  	}
  1195  	target := &ret
  1196  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1197  		return nil, err
  1198  	}
  1199  	return ret, nil
  1200  }
  1201  
  1202  // Pages invokes f for each page of results.
  1203  // A non-nil error returned from f will halt the iteration.
  1204  // The provided context supersedes any context provided to the Context method.
  1205  func (c *ProjectsLocationsOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error {
  1206  	c.ctx_ = ctx
  1207  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  1208  	for {
  1209  		x, err := c.Do()
  1210  		if err != nil {
  1211  			return err
  1212  		}
  1213  		if err := f(x); err != nil {
  1214  			return err
  1215  		}
  1216  		if x.NextPageToken == "" {
  1217  			return nil
  1218  		}
  1219  		c.PageToken(x.NextPageToken)
  1220  	}
  1221  }
  1222  
  1223  type ProjectsLocationsWorkflowsCreateCall struct {
  1224  	s          *Service
  1225  	parent     string
  1226  	workflow   *Workflow
  1227  	urlParams_ gensupport.URLParams
  1228  	ctx_       context.Context
  1229  	header_    http.Header
  1230  }
  1231  
  1232  // Create: Creates a new workflow. If a workflow with the specified name
  1233  // already exists in the specified project and location, the long running
  1234  // operation returns a ALREADY_EXISTS error.
  1235  //
  1236  //   - parent: Project and location in which the workflow should be created.
  1237  //     Format: projects/{project}/locations/{location}.
  1238  func (r *ProjectsLocationsWorkflowsService) Create(parent string, workflow *Workflow) *ProjectsLocationsWorkflowsCreateCall {
  1239  	c := &ProjectsLocationsWorkflowsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1240  	c.parent = parent
  1241  	c.workflow = workflow
  1242  	return c
  1243  }
  1244  
  1245  // WorkflowId sets the optional parameter "workflowId": Required. The ID of the
  1246  // workflow to be created. It has to fulfill the following requirements: * Must
  1247  // contain only letters, numbers, underscores and hyphens. * Must start with a
  1248  // letter. * Must be between 1-64 characters. * Must end with a number or a
  1249  // letter. * Must be unique within the customer project and location.
  1250  func (c *ProjectsLocationsWorkflowsCreateCall) WorkflowId(workflowId string) *ProjectsLocationsWorkflowsCreateCall {
  1251  	c.urlParams_.Set("workflowId", workflowId)
  1252  	return c
  1253  }
  1254  
  1255  // Fields allows partial responses to be retrieved. See
  1256  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1257  // details.
  1258  func (c *ProjectsLocationsWorkflowsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowsCreateCall {
  1259  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1260  	return c
  1261  }
  1262  
  1263  // Context sets the context to be used in this call's Do method.
  1264  func (c *ProjectsLocationsWorkflowsCreateCall) Context(ctx context.Context) *ProjectsLocationsWorkflowsCreateCall {
  1265  	c.ctx_ = ctx
  1266  	return c
  1267  }
  1268  
  1269  // Header returns a http.Header that can be modified by the caller to add
  1270  // headers to the request.
  1271  func (c *ProjectsLocationsWorkflowsCreateCall) Header() http.Header {
  1272  	if c.header_ == nil {
  1273  		c.header_ = make(http.Header)
  1274  	}
  1275  	return c.header_
  1276  }
  1277  
  1278  func (c *ProjectsLocationsWorkflowsCreateCall) doRequest(alt string) (*http.Response, error) {
  1279  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1280  	var body io.Reader = nil
  1281  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.workflow)
  1282  	if err != nil {
  1283  		return nil, err
  1284  	}
  1285  	c.urlParams_.Set("alt", alt)
  1286  	c.urlParams_.Set("prettyPrint", "false")
  1287  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/workflows")
  1288  	urls += "?" + c.urlParams_.Encode()
  1289  	req, err := http.NewRequest("POST", urls, body)
  1290  	if err != nil {
  1291  		return nil, err
  1292  	}
  1293  	req.Header = reqHeaders
  1294  	googleapi.Expand(req.URL, map[string]string{
  1295  		"parent": c.parent,
  1296  	})
  1297  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1298  }
  1299  
  1300  // Do executes the "workflows.projects.locations.workflows.create" call.
  1301  // Any non-2xx status code is an error. Response headers are in either
  1302  // *Operation.ServerResponse.Header or (if a response was returned at all) in
  1303  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1304  // whether the returned error was because http.StatusNotModified was returned.
  1305  func (c *ProjectsLocationsWorkflowsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  1306  	gensupport.SetOptions(c.urlParams_, opts...)
  1307  	res, err := c.doRequest("json")
  1308  	if res != nil && res.StatusCode == http.StatusNotModified {
  1309  		if res.Body != nil {
  1310  			res.Body.Close()
  1311  		}
  1312  		return nil, gensupport.WrapError(&googleapi.Error{
  1313  			Code:   res.StatusCode,
  1314  			Header: res.Header,
  1315  		})
  1316  	}
  1317  	if err != nil {
  1318  		return nil, err
  1319  	}
  1320  	defer googleapi.CloseBody(res)
  1321  	if err := googleapi.CheckResponse(res); err != nil {
  1322  		return nil, gensupport.WrapError(err)
  1323  	}
  1324  	ret := &Operation{
  1325  		ServerResponse: googleapi.ServerResponse{
  1326  			Header:         res.Header,
  1327  			HTTPStatusCode: res.StatusCode,
  1328  		},
  1329  	}
  1330  	target := &ret
  1331  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1332  		return nil, err
  1333  	}
  1334  	return ret, nil
  1335  }
  1336  
  1337  type ProjectsLocationsWorkflowsDeleteCall struct {
  1338  	s          *Service
  1339  	name       string
  1340  	urlParams_ gensupport.URLParams
  1341  	ctx_       context.Context
  1342  	header_    http.Header
  1343  }
  1344  
  1345  // Delete: Deletes a workflow with the specified name. This method also cancels
  1346  // and deletes all running executions of the workflow.
  1347  //
  1348  //   - name: Name of the workflow to be deleted. Format:
  1349  //     projects/{project}/locations/{location}/workflows/{workflow}.
  1350  func (r *ProjectsLocationsWorkflowsService) Delete(name string) *ProjectsLocationsWorkflowsDeleteCall {
  1351  	c := &ProjectsLocationsWorkflowsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1352  	c.name = name
  1353  	return c
  1354  }
  1355  
  1356  // Fields allows partial responses to be retrieved. See
  1357  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1358  // details.
  1359  func (c *ProjectsLocationsWorkflowsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowsDeleteCall {
  1360  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1361  	return c
  1362  }
  1363  
  1364  // Context sets the context to be used in this call's Do method.
  1365  func (c *ProjectsLocationsWorkflowsDeleteCall) Context(ctx context.Context) *ProjectsLocationsWorkflowsDeleteCall {
  1366  	c.ctx_ = ctx
  1367  	return c
  1368  }
  1369  
  1370  // Header returns a http.Header that can be modified by the caller to add
  1371  // headers to the request.
  1372  func (c *ProjectsLocationsWorkflowsDeleteCall) Header() http.Header {
  1373  	if c.header_ == nil {
  1374  		c.header_ = make(http.Header)
  1375  	}
  1376  	return c.header_
  1377  }
  1378  
  1379  func (c *ProjectsLocationsWorkflowsDeleteCall) doRequest(alt string) (*http.Response, error) {
  1380  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1381  	var body io.Reader = nil
  1382  	c.urlParams_.Set("alt", alt)
  1383  	c.urlParams_.Set("prettyPrint", "false")
  1384  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  1385  	urls += "?" + c.urlParams_.Encode()
  1386  	req, err := http.NewRequest("DELETE", urls, body)
  1387  	if err != nil {
  1388  		return nil, err
  1389  	}
  1390  	req.Header = reqHeaders
  1391  	googleapi.Expand(req.URL, map[string]string{
  1392  		"name": c.name,
  1393  	})
  1394  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1395  }
  1396  
  1397  // Do executes the "workflows.projects.locations.workflows.delete" call.
  1398  // Any non-2xx status code is an error. Response headers are in either
  1399  // *Operation.ServerResponse.Header or (if a response was returned at all) in
  1400  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1401  // whether the returned error was because http.StatusNotModified was returned.
  1402  func (c *ProjectsLocationsWorkflowsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  1403  	gensupport.SetOptions(c.urlParams_, opts...)
  1404  	res, err := c.doRequest("json")
  1405  	if res != nil && res.StatusCode == http.StatusNotModified {
  1406  		if res.Body != nil {
  1407  			res.Body.Close()
  1408  		}
  1409  		return nil, gensupport.WrapError(&googleapi.Error{
  1410  			Code:   res.StatusCode,
  1411  			Header: res.Header,
  1412  		})
  1413  	}
  1414  	if err != nil {
  1415  		return nil, err
  1416  	}
  1417  	defer googleapi.CloseBody(res)
  1418  	if err := googleapi.CheckResponse(res); err != nil {
  1419  		return nil, gensupport.WrapError(err)
  1420  	}
  1421  	ret := &Operation{
  1422  		ServerResponse: googleapi.ServerResponse{
  1423  			Header:         res.Header,
  1424  			HTTPStatusCode: res.StatusCode,
  1425  		},
  1426  	}
  1427  	target := &ret
  1428  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1429  		return nil, err
  1430  	}
  1431  	return ret, nil
  1432  }
  1433  
  1434  type ProjectsLocationsWorkflowsGetCall struct {
  1435  	s            *Service
  1436  	name         string
  1437  	urlParams_   gensupport.URLParams
  1438  	ifNoneMatch_ string
  1439  	ctx_         context.Context
  1440  	header_      http.Header
  1441  }
  1442  
  1443  // Get: Gets details of a single workflow.
  1444  //
  1445  //   - name: Name of the workflow for which information should be retrieved.
  1446  //     Format: projects/{project}/locations/{location}/workflows/{workflow}.
  1447  func (r *ProjectsLocationsWorkflowsService) Get(name string) *ProjectsLocationsWorkflowsGetCall {
  1448  	c := &ProjectsLocationsWorkflowsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1449  	c.name = name
  1450  	return c
  1451  }
  1452  
  1453  // RevisionId sets the optional parameter "revisionId": The revision of the
  1454  // workflow to retrieve. If the revision_id is empty, the latest revision is
  1455  // retrieved. The format is "000001-a4d", where the first six characters define
  1456  // the zero-padded decimal revision number. They are followed by a hyphen and
  1457  // three hexadecimal characters.
  1458  func (c *ProjectsLocationsWorkflowsGetCall) RevisionId(revisionId string) *ProjectsLocationsWorkflowsGetCall {
  1459  	c.urlParams_.Set("revisionId", revisionId)
  1460  	return c
  1461  }
  1462  
  1463  // Fields allows partial responses to be retrieved. See
  1464  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1465  // details.
  1466  func (c *ProjectsLocationsWorkflowsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowsGetCall {
  1467  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1468  	return c
  1469  }
  1470  
  1471  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1472  // object's ETag matches the given value. This is useful for getting updates
  1473  // only after the object has changed since the last request.
  1474  func (c *ProjectsLocationsWorkflowsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsWorkflowsGetCall {
  1475  	c.ifNoneMatch_ = entityTag
  1476  	return c
  1477  }
  1478  
  1479  // Context sets the context to be used in this call's Do method.
  1480  func (c *ProjectsLocationsWorkflowsGetCall) Context(ctx context.Context) *ProjectsLocationsWorkflowsGetCall {
  1481  	c.ctx_ = ctx
  1482  	return c
  1483  }
  1484  
  1485  // Header returns a http.Header that can be modified by the caller to add
  1486  // headers to the request.
  1487  func (c *ProjectsLocationsWorkflowsGetCall) Header() http.Header {
  1488  	if c.header_ == nil {
  1489  		c.header_ = make(http.Header)
  1490  	}
  1491  	return c.header_
  1492  }
  1493  
  1494  func (c *ProjectsLocationsWorkflowsGetCall) doRequest(alt string) (*http.Response, error) {
  1495  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1496  	if c.ifNoneMatch_ != "" {
  1497  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1498  	}
  1499  	var body io.Reader = nil
  1500  	c.urlParams_.Set("alt", alt)
  1501  	c.urlParams_.Set("prettyPrint", "false")
  1502  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  1503  	urls += "?" + c.urlParams_.Encode()
  1504  	req, err := http.NewRequest("GET", urls, body)
  1505  	if err != nil {
  1506  		return nil, err
  1507  	}
  1508  	req.Header = reqHeaders
  1509  	googleapi.Expand(req.URL, map[string]string{
  1510  		"name": c.name,
  1511  	})
  1512  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1513  }
  1514  
  1515  // Do executes the "workflows.projects.locations.workflows.get" call.
  1516  // Any non-2xx status code is an error. Response headers are in either
  1517  // *Workflow.ServerResponse.Header or (if a response was returned at all) in
  1518  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1519  // whether the returned error was because http.StatusNotModified was returned.
  1520  func (c *ProjectsLocationsWorkflowsGetCall) Do(opts ...googleapi.CallOption) (*Workflow, error) {
  1521  	gensupport.SetOptions(c.urlParams_, opts...)
  1522  	res, err := c.doRequest("json")
  1523  	if res != nil && res.StatusCode == http.StatusNotModified {
  1524  		if res.Body != nil {
  1525  			res.Body.Close()
  1526  		}
  1527  		return nil, gensupport.WrapError(&googleapi.Error{
  1528  			Code:   res.StatusCode,
  1529  			Header: res.Header,
  1530  		})
  1531  	}
  1532  	if err != nil {
  1533  		return nil, err
  1534  	}
  1535  	defer googleapi.CloseBody(res)
  1536  	if err := googleapi.CheckResponse(res); err != nil {
  1537  		return nil, gensupport.WrapError(err)
  1538  	}
  1539  	ret := &Workflow{
  1540  		ServerResponse: googleapi.ServerResponse{
  1541  			Header:         res.Header,
  1542  			HTTPStatusCode: res.StatusCode,
  1543  		},
  1544  	}
  1545  	target := &ret
  1546  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1547  		return nil, err
  1548  	}
  1549  	return ret, nil
  1550  }
  1551  
  1552  type ProjectsLocationsWorkflowsListCall struct {
  1553  	s            *Service
  1554  	parent       string
  1555  	urlParams_   gensupport.URLParams
  1556  	ifNoneMatch_ string
  1557  	ctx_         context.Context
  1558  	header_      http.Header
  1559  }
  1560  
  1561  // List: Lists workflows in a given project and location. The default order is
  1562  // not specified.
  1563  //
  1564  //   - parent: Project and location from which the workflows should be listed.
  1565  //     Format: projects/{project}/locations/{location}.
  1566  func (r *ProjectsLocationsWorkflowsService) List(parent string) *ProjectsLocationsWorkflowsListCall {
  1567  	c := &ProjectsLocationsWorkflowsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1568  	c.parent = parent
  1569  	return c
  1570  }
  1571  
  1572  // Filter sets the optional parameter "filter": Filter to restrict results to
  1573  // specific workflows. For details, see AIP-160. For example, if you are using
  1574  // the Google APIs Explorer: `state="SUCCEEDED" or `createTime>"2023-08-01"
  1575  // AND state="FAILED"
  1576  func (c *ProjectsLocationsWorkflowsListCall) Filter(filter string) *ProjectsLocationsWorkflowsListCall {
  1577  	c.urlParams_.Set("filter", filter)
  1578  	return c
  1579  }
  1580  
  1581  // OrderBy sets the optional parameter "orderBy": Comma-separated list of
  1582  // fields that specify the order of the results. Default sorting order for a
  1583  // field is ascending. To specify descending order for a field, append a "desc"
  1584  // suffix. If not specified, the results are returned in an unspecified order.
  1585  func (c *ProjectsLocationsWorkflowsListCall) OrderBy(orderBy string) *ProjectsLocationsWorkflowsListCall {
  1586  	c.urlParams_.Set("orderBy", orderBy)
  1587  	return c
  1588  }
  1589  
  1590  // PageSize sets the optional parameter "pageSize": Maximum number of workflows
  1591  // to return per call. The service might return fewer than this value even if
  1592  // not at the end of the collection. If a value is not specified, a default
  1593  // value of 500 is used. The maximum permitted value is 1000 and values greater
  1594  // than 1000 are coerced down to 1000.
  1595  func (c *ProjectsLocationsWorkflowsListCall) PageSize(pageSize int64) *ProjectsLocationsWorkflowsListCall {
  1596  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  1597  	return c
  1598  }
  1599  
  1600  // PageToken sets the optional parameter "pageToken": A page token, received
  1601  // from a previous `ListWorkflows` call. Provide this to retrieve the
  1602  // subsequent page. When paginating, all other parameters provided to
  1603  // `ListWorkflows` must match the call that provided the page token.
  1604  func (c *ProjectsLocationsWorkflowsListCall) PageToken(pageToken string) *ProjectsLocationsWorkflowsListCall {
  1605  	c.urlParams_.Set("pageToken", pageToken)
  1606  	return c
  1607  }
  1608  
  1609  // Fields allows partial responses to be retrieved. See
  1610  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1611  // details.
  1612  func (c *ProjectsLocationsWorkflowsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowsListCall {
  1613  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1614  	return c
  1615  }
  1616  
  1617  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1618  // object's ETag matches the given value. This is useful for getting updates
  1619  // only after the object has changed since the last request.
  1620  func (c *ProjectsLocationsWorkflowsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsWorkflowsListCall {
  1621  	c.ifNoneMatch_ = entityTag
  1622  	return c
  1623  }
  1624  
  1625  // Context sets the context to be used in this call's Do method.
  1626  func (c *ProjectsLocationsWorkflowsListCall) Context(ctx context.Context) *ProjectsLocationsWorkflowsListCall {
  1627  	c.ctx_ = ctx
  1628  	return c
  1629  }
  1630  
  1631  // Header returns a http.Header that can be modified by the caller to add
  1632  // headers to the request.
  1633  func (c *ProjectsLocationsWorkflowsListCall) Header() http.Header {
  1634  	if c.header_ == nil {
  1635  		c.header_ = make(http.Header)
  1636  	}
  1637  	return c.header_
  1638  }
  1639  
  1640  func (c *ProjectsLocationsWorkflowsListCall) doRequest(alt string) (*http.Response, error) {
  1641  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1642  	if c.ifNoneMatch_ != "" {
  1643  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1644  	}
  1645  	var body io.Reader = nil
  1646  	c.urlParams_.Set("alt", alt)
  1647  	c.urlParams_.Set("prettyPrint", "false")
  1648  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/workflows")
  1649  	urls += "?" + c.urlParams_.Encode()
  1650  	req, err := http.NewRequest("GET", urls, body)
  1651  	if err != nil {
  1652  		return nil, err
  1653  	}
  1654  	req.Header = reqHeaders
  1655  	googleapi.Expand(req.URL, map[string]string{
  1656  		"parent": c.parent,
  1657  	})
  1658  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1659  }
  1660  
  1661  // Do executes the "workflows.projects.locations.workflows.list" call.
  1662  // Any non-2xx status code is an error. Response headers are in either
  1663  // *ListWorkflowsResponse.ServerResponse.Header or (if a response was returned
  1664  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1665  // check whether the returned error was because http.StatusNotModified was
  1666  // returned.
  1667  func (c *ProjectsLocationsWorkflowsListCall) Do(opts ...googleapi.CallOption) (*ListWorkflowsResponse, error) {
  1668  	gensupport.SetOptions(c.urlParams_, opts...)
  1669  	res, err := c.doRequest("json")
  1670  	if res != nil && res.StatusCode == http.StatusNotModified {
  1671  		if res.Body != nil {
  1672  			res.Body.Close()
  1673  		}
  1674  		return nil, gensupport.WrapError(&googleapi.Error{
  1675  			Code:   res.StatusCode,
  1676  			Header: res.Header,
  1677  		})
  1678  	}
  1679  	if err != nil {
  1680  		return nil, err
  1681  	}
  1682  	defer googleapi.CloseBody(res)
  1683  	if err := googleapi.CheckResponse(res); err != nil {
  1684  		return nil, gensupport.WrapError(err)
  1685  	}
  1686  	ret := &ListWorkflowsResponse{
  1687  		ServerResponse: googleapi.ServerResponse{
  1688  			Header:         res.Header,
  1689  			HTTPStatusCode: res.StatusCode,
  1690  		},
  1691  	}
  1692  	target := &ret
  1693  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1694  		return nil, err
  1695  	}
  1696  	return ret, nil
  1697  }
  1698  
  1699  // Pages invokes f for each page of results.
  1700  // A non-nil error returned from f will halt the iteration.
  1701  // The provided context supersedes any context provided to the Context method.
  1702  func (c *ProjectsLocationsWorkflowsListCall) Pages(ctx context.Context, f func(*ListWorkflowsResponse) error) error {
  1703  	c.ctx_ = ctx
  1704  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  1705  	for {
  1706  		x, err := c.Do()
  1707  		if err != nil {
  1708  			return err
  1709  		}
  1710  		if err := f(x); err != nil {
  1711  			return err
  1712  		}
  1713  		if x.NextPageToken == "" {
  1714  			return nil
  1715  		}
  1716  		c.PageToken(x.NextPageToken)
  1717  	}
  1718  }
  1719  
  1720  type ProjectsLocationsWorkflowsListRevisionsCall struct {
  1721  	s            *Service
  1722  	name         string
  1723  	urlParams_   gensupport.URLParams
  1724  	ifNoneMatch_ string
  1725  	ctx_         context.Context
  1726  	header_      http.Header
  1727  }
  1728  
  1729  // ListRevisions: Lists revisions for a given workflow.
  1730  //
  1731  //   - name: Workflow for which the revisions should be listed. Format:
  1732  //     projects/{project}/locations/{location}/workflows/{workflow}.
  1733  func (r *ProjectsLocationsWorkflowsService) ListRevisions(name string) *ProjectsLocationsWorkflowsListRevisionsCall {
  1734  	c := &ProjectsLocationsWorkflowsListRevisionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1735  	c.name = name
  1736  	return c
  1737  }
  1738  
  1739  // PageSize sets the optional parameter "pageSize": The maximum number of
  1740  // revisions to return per page. If a value is not specified, a default value
  1741  // of 20 is used. The maximum permitted value is 100. Values greater than 100
  1742  // are coerced down to 100.
  1743  func (c *ProjectsLocationsWorkflowsListRevisionsCall) PageSize(pageSize int64) *ProjectsLocationsWorkflowsListRevisionsCall {
  1744  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  1745  	return c
  1746  }
  1747  
  1748  // PageToken sets the optional parameter "pageToken": The page token, received
  1749  // from a previous ListWorkflowRevisions call. Provide this to retrieve the
  1750  // subsequent page.
  1751  func (c *ProjectsLocationsWorkflowsListRevisionsCall) PageToken(pageToken string) *ProjectsLocationsWorkflowsListRevisionsCall {
  1752  	c.urlParams_.Set("pageToken", pageToken)
  1753  	return c
  1754  }
  1755  
  1756  // Fields allows partial responses to be retrieved. See
  1757  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1758  // details.
  1759  func (c *ProjectsLocationsWorkflowsListRevisionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowsListRevisionsCall {
  1760  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1761  	return c
  1762  }
  1763  
  1764  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1765  // object's ETag matches the given value. This is useful for getting updates
  1766  // only after the object has changed since the last request.
  1767  func (c *ProjectsLocationsWorkflowsListRevisionsCall) IfNoneMatch(entityTag string) *ProjectsLocationsWorkflowsListRevisionsCall {
  1768  	c.ifNoneMatch_ = entityTag
  1769  	return c
  1770  }
  1771  
  1772  // Context sets the context to be used in this call's Do method.
  1773  func (c *ProjectsLocationsWorkflowsListRevisionsCall) Context(ctx context.Context) *ProjectsLocationsWorkflowsListRevisionsCall {
  1774  	c.ctx_ = ctx
  1775  	return c
  1776  }
  1777  
  1778  // Header returns a http.Header that can be modified by the caller to add
  1779  // headers to the request.
  1780  func (c *ProjectsLocationsWorkflowsListRevisionsCall) Header() http.Header {
  1781  	if c.header_ == nil {
  1782  		c.header_ = make(http.Header)
  1783  	}
  1784  	return c.header_
  1785  }
  1786  
  1787  func (c *ProjectsLocationsWorkflowsListRevisionsCall) doRequest(alt string) (*http.Response, error) {
  1788  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1789  	if c.ifNoneMatch_ != "" {
  1790  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1791  	}
  1792  	var body io.Reader = nil
  1793  	c.urlParams_.Set("alt", alt)
  1794  	c.urlParams_.Set("prettyPrint", "false")
  1795  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:listRevisions")
  1796  	urls += "?" + c.urlParams_.Encode()
  1797  	req, err := http.NewRequest("GET", urls, body)
  1798  	if err != nil {
  1799  		return nil, err
  1800  	}
  1801  	req.Header = reqHeaders
  1802  	googleapi.Expand(req.URL, map[string]string{
  1803  		"name": c.name,
  1804  	})
  1805  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1806  }
  1807  
  1808  // Do executes the "workflows.projects.locations.workflows.listRevisions" call.
  1809  // Any non-2xx status code is an error. Response headers are in either
  1810  // *ListWorkflowRevisionsResponse.ServerResponse.Header or (if a response was
  1811  // returned at all) in error.(*googleapi.Error).Header. Use
  1812  // googleapi.IsNotModified to check whether the returned error was because
  1813  // http.StatusNotModified was returned.
  1814  func (c *ProjectsLocationsWorkflowsListRevisionsCall) Do(opts ...googleapi.CallOption) (*ListWorkflowRevisionsResponse, error) {
  1815  	gensupport.SetOptions(c.urlParams_, opts...)
  1816  	res, err := c.doRequest("json")
  1817  	if res != nil && res.StatusCode == http.StatusNotModified {
  1818  		if res.Body != nil {
  1819  			res.Body.Close()
  1820  		}
  1821  		return nil, gensupport.WrapError(&googleapi.Error{
  1822  			Code:   res.StatusCode,
  1823  			Header: res.Header,
  1824  		})
  1825  	}
  1826  	if err != nil {
  1827  		return nil, err
  1828  	}
  1829  	defer googleapi.CloseBody(res)
  1830  	if err := googleapi.CheckResponse(res); err != nil {
  1831  		return nil, gensupport.WrapError(err)
  1832  	}
  1833  	ret := &ListWorkflowRevisionsResponse{
  1834  		ServerResponse: googleapi.ServerResponse{
  1835  			Header:         res.Header,
  1836  			HTTPStatusCode: res.StatusCode,
  1837  		},
  1838  	}
  1839  	target := &ret
  1840  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1841  		return nil, err
  1842  	}
  1843  	return ret, nil
  1844  }
  1845  
  1846  // Pages invokes f for each page of results.
  1847  // A non-nil error returned from f will halt the iteration.
  1848  // The provided context supersedes any context provided to the Context method.
  1849  func (c *ProjectsLocationsWorkflowsListRevisionsCall) Pages(ctx context.Context, f func(*ListWorkflowRevisionsResponse) error) error {
  1850  	c.ctx_ = ctx
  1851  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  1852  	for {
  1853  		x, err := c.Do()
  1854  		if err != nil {
  1855  			return err
  1856  		}
  1857  		if err := f(x); err != nil {
  1858  			return err
  1859  		}
  1860  		if x.NextPageToken == "" {
  1861  			return nil
  1862  		}
  1863  		c.PageToken(x.NextPageToken)
  1864  	}
  1865  }
  1866  
  1867  type ProjectsLocationsWorkflowsPatchCall struct {
  1868  	s          *Service
  1869  	name       string
  1870  	workflow   *Workflow
  1871  	urlParams_ gensupport.URLParams
  1872  	ctx_       context.Context
  1873  	header_    http.Header
  1874  }
  1875  
  1876  // Patch: Updates an existing workflow. Running this method has no impact on
  1877  // already running executions of the workflow. A new revision of the workflow
  1878  // might be created as a result of a successful update operation. In that case,
  1879  // the new revision is used in new workflow executions.
  1880  //
  1881  //   - name: The resource name of the workflow. Format:
  1882  //     projects/{project}/locations/{location}/workflows/{workflow}. This is a
  1883  //     workflow-wide field and is not tied to a specific revision.
  1884  func (r *ProjectsLocationsWorkflowsService) Patch(name string, workflow *Workflow) *ProjectsLocationsWorkflowsPatchCall {
  1885  	c := &ProjectsLocationsWorkflowsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1886  	c.name = name
  1887  	c.workflow = workflow
  1888  	return c
  1889  }
  1890  
  1891  // UpdateMask sets the optional parameter "updateMask": List of fields to be
  1892  // updated. If not present, the entire workflow will be updated.
  1893  func (c *ProjectsLocationsWorkflowsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsWorkflowsPatchCall {
  1894  	c.urlParams_.Set("updateMask", updateMask)
  1895  	return c
  1896  }
  1897  
  1898  // Fields allows partial responses to be retrieved. See
  1899  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1900  // details.
  1901  func (c *ProjectsLocationsWorkflowsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowsPatchCall {
  1902  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1903  	return c
  1904  }
  1905  
  1906  // Context sets the context to be used in this call's Do method.
  1907  func (c *ProjectsLocationsWorkflowsPatchCall) Context(ctx context.Context) *ProjectsLocationsWorkflowsPatchCall {
  1908  	c.ctx_ = ctx
  1909  	return c
  1910  }
  1911  
  1912  // Header returns a http.Header that can be modified by the caller to add
  1913  // headers to the request.
  1914  func (c *ProjectsLocationsWorkflowsPatchCall) Header() http.Header {
  1915  	if c.header_ == nil {
  1916  		c.header_ = make(http.Header)
  1917  	}
  1918  	return c.header_
  1919  }
  1920  
  1921  func (c *ProjectsLocationsWorkflowsPatchCall) doRequest(alt string) (*http.Response, error) {
  1922  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1923  	var body io.Reader = nil
  1924  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.workflow)
  1925  	if err != nil {
  1926  		return nil, err
  1927  	}
  1928  	c.urlParams_.Set("alt", alt)
  1929  	c.urlParams_.Set("prettyPrint", "false")
  1930  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  1931  	urls += "?" + c.urlParams_.Encode()
  1932  	req, err := http.NewRequest("PATCH", urls, body)
  1933  	if err != nil {
  1934  		return nil, err
  1935  	}
  1936  	req.Header = reqHeaders
  1937  	googleapi.Expand(req.URL, map[string]string{
  1938  		"name": c.name,
  1939  	})
  1940  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1941  }
  1942  
  1943  // Do executes the "workflows.projects.locations.workflows.patch" call.
  1944  // Any non-2xx status code is an error. Response headers are in either
  1945  // *Operation.ServerResponse.Header or (if a response was returned at all) in
  1946  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1947  // whether the returned error was because http.StatusNotModified was returned.
  1948  func (c *ProjectsLocationsWorkflowsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  1949  	gensupport.SetOptions(c.urlParams_, opts...)
  1950  	res, err := c.doRequest("json")
  1951  	if res != nil && res.StatusCode == http.StatusNotModified {
  1952  		if res.Body != nil {
  1953  			res.Body.Close()
  1954  		}
  1955  		return nil, gensupport.WrapError(&googleapi.Error{
  1956  			Code:   res.StatusCode,
  1957  			Header: res.Header,
  1958  		})
  1959  	}
  1960  	if err != nil {
  1961  		return nil, err
  1962  	}
  1963  	defer googleapi.CloseBody(res)
  1964  	if err := googleapi.CheckResponse(res); err != nil {
  1965  		return nil, gensupport.WrapError(err)
  1966  	}
  1967  	ret := &Operation{
  1968  		ServerResponse: googleapi.ServerResponse{
  1969  			Header:         res.Header,
  1970  			HTTPStatusCode: res.StatusCode,
  1971  		},
  1972  	}
  1973  	target := &ret
  1974  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1975  		return nil, err
  1976  	}
  1977  	return ret, nil
  1978  }
  1979  

View as plain text