...

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

Documentation: google.golang.org/api/datapipelines/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 datapipelines provides access to the Data pipelines API.
     8  //
     9  // For product documentation, see: https://cloud.google.com/dataflow/docs/guides/data-pipelines
    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/datapipelines/v1"
    27  //	...
    28  //	ctx := context.Background()
    29  //	datapipelinesService, err := datapipelines.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  //	datapipelinesService, err := datapipelines.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  //	datapipelinesService, err := datapipelines.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
    49  //
    50  // See [google.golang.org/api/option.ClientOption] for details on options.
    51  package datapipelines // import "google.golang.org/api/datapipelines/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 = "datapipelines:v1"
    90  const apiName = "datapipelines"
    91  const apiVersion = "v1"
    92  const basePath = "https://datapipelines.googleapis.com/"
    93  const basePathTemplate = "https://datapipelines.UNIVERSE_DOMAIN/"
    94  const mtlsBasePath = "https://datapipelines.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.Pipelines = NewProjectsLocationsPipelinesService(s)
   172  	return rs
   173  }
   174  
   175  type ProjectsLocationsService struct {
   176  	s *Service
   177  
   178  	Pipelines *ProjectsLocationsPipelinesService
   179  }
   180  
   181  func NewProjectsLocationsPipelinesService(s *Service) *ProjectsLocationsPipelinesService {
   182  	rs := &ProjectsLocationsPipelinesService{s: s}
   183  	rs.Jobs = NewProjectsLocationsPipelinesJobsService(s)
   184  	return rs
   185  }
   186  
   187  type ProjectsLocationsPipelinesService struct {
   188  	s *Service
   189  
   190  	Jobs *ProjectsLocationsPipelinesJobsService
   191  }
   192  
   193  func NewProjectsLocationsPipelinesJobsService(s *Service) *ProjectsLocationsPipelinesJobsService {
   194  	rs := &ProjectsLocationsPipelinesJobsService{s: s}
   195  	return rs
   196  }
   197  
   198  type ProjectsLocationsPipelinesJobsService struct {
   199  	s *Service
   200  }
   201  
   202  // GoogleCloudDatapipelinesV1DataflowJobDetails: Pipeline job details specific
   203  // to the Dataflow API. This is encapsulated here to allow for more executors
   204  // to store their specific details separately.
   205  type GoogleCloudDatapipelinesV1DataflowJobDetails struct {
   206  	// CurrentWorkers: Output only. The current number of workers used to run the
   207  	// jobs. Only set to a value if the job is still running.
   208  	CurrentWorkers int64 `json:"currentWorkers,omitempty"`
   209  	// ResourceInfo: Cached version of all the metrics of interest for the job.
   210  	// This value gets stored here when the job is terminated. As long as the job
   211  	// is running, this field is populated from the Dataflow API.
   212  	ResourceInfo map[string]float64 `json:"resourceInfo,omitempty"`
   213  	// SdkVersion: Output only. The SDK version used to run the job.
   214  	SdkVersion *GoogleCloudDatapipelinesV1SdkVersion `json:"sdkVersion,omitempty"`
   215  	// ForceSendFields is a list of field names (e.g. "CurrentWorkers") to
   216  	// unconditionally include in API requests. By default, fields with empty or
   217  	// default values are omitted from API requests. See
   218  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   219  	// details.
   220  	ForceSendFields []string `json:"-"`
   221  	// NullFields is a list of field names (e.g. "CurrentWorkers") to include in
   222  	// API requests with the JSON null value. By default, fields with empty values
   223  	// are omitted from API requests. See
   224  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   225  	NullFields []string `json:"-"`
   226  }
   227  
   228  func (s *GoogleCloudDatapipelinesV1DataflowJobDetails) MarshalJSON() ([]byte, error) {
   229  	type NoMethod GoogleCloudDatapipelinesV1DataflowJobDetails
   230  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   231  }
   232  
   233  // GoogleCloudDatapipelinesV1FlexTemplateRuntimeEnvironment: The environment
   234  // values to be set at runtime for a Flex Template.
   235  type GoogleCloudDatapipelinesV1FlexTemplateRuntimeEnvironment struct {
   236  	// AdditionalExperiments: Additional experiment flags for the job.
   237  	AdditionalExperiments []string `json:"additionalExperiments,omitempty"`
   238  	// AdditionalUserLabels: Additional user labels to be specified for the job.
   239  	// Keys and values must follow the restrictions specified in the labeling
   240  	// restrictions
   241  	// (https://cloud.google.com/compute/docs/labeling-resources#restrictions). An
   242  	// object containing a list of key/value pairs. Example: `{ "name": "wrench",
   243  	// "mass": "1kg", "count": "3" }`.
   244  	AdditionalUserLabels map[string]string `json:"additionalUserLabels,omitempty"`
   245  	// EnableStreamingEngine: Whether to enable Streaming Engine for the job.
   246  	EnableStreamingEngine bool `json:"enableStreamingEngine,omitempty"`
   247  	// FlexrsGoal: Set FlexRS goal for the job.
   248  	// https://cloud.google.com/dataflow/docs/guides/flexrs
   249  	//
   250  	// Possible values:
   251  	//   "FLEXRS_UNSPECIFIED" - Run in the default mode.
   252  	//   "FLEXRS_SPEED_OPTIMIZED" - Optimize for lower execution time.
   253  	//   "FLEXRS_COST_OPTIMIZED" - Optimize for lower cost.
   254  	FlexrsGoal string `json:"flexrsGoal,omitempty"`
   255  	// IpConfiguration: Configuration for VM IPs.
   256  	//
   257  	// Possible values:
   258  	//   "WORKER_IP_UNSPECIFIED" - The configuration is unknown, or unspecified.
   259  	//   "WORKER_IP_PUBLIC" - Workers should have public IP addresses.
   260  	//   "WORKER_IP_PRIVATE" - Workers should have private IP addresses.
   261  	IpConfiguration string `json:"ipConfiguration,omitempty"`
   262  	// KmsKeyName: Name for the Cloud KMS key for the job. Key format is:
   263  	// projects//locations//keyRings//cryptoKeys/
   264  	KmsKeyName string `json:"kmsKeyName,omitempty"`
   265  	// MachineType: The machine type to use for the job. Defaults to the value from
   266  	// the template if not specified.
   267  	MachineType string `json:"machineType,omitempty"`
   268  	// MaxWorkers: The maximum number of Compute Engine instances to be made
   269  	// available to your pipeline during execution, from 1 to 1000.
   270  	MaxWorkers int64 `json:"maxWorkers,omitempty"`
   271  	// Network: Network to which VMs will be assigned. If empty or unspecified, the
   272  	// service will use the network "default".
   273  	Network string `json:"network,omitempty"`
   274  	// NumWorkers: The initial number of Compute Engine instances for the job.
   275  	NumWorkers int64 `json:"numWorkers,omitempty"`
   276  	// ServiceAccountEmail: The email address of the service account to run the job
   277  	// as.
   278  	ServiceAccountEmail string `json:"serviceAccountEmail,omitempty"`
   279  	// Subnetwork: Subnetwork to which VMs will be assigned, if desired. You can
   280  	// specify a subnetwork using either a complete URL or an abbreviated path.
   281  	// Expected to be of the form
   282  	// "https://www.googleapis.com/compute/v1/projects/HOST_PROJECT_ID/regions/REGIO
   283  	// N/subnetworks/SUBNETWORK" or "regions/REGION/subnetworks/SUBNETWORK". If the
   284  	// subnetwork is located in a Shared VPC network, you must use the complete
   285  	// URL.
   286  	Subnetwork string `json:"subnetwork,omitempty"`
   287  	// TempLocation: The Cloud Storage path to use for temporary files. Must be a
   288  	// valid Cloud Storage URL, beginning with `gs://`.
   289  	TempLocation string `json:"tempLocation,omitempty"`
   290  	// WorkerRegion: The Compute Engine region
   291  	// (https://cloud.google.com/compute/docs/regions-zones/regions-zones) in which
   292  	// worker processing should occur, e.g. "us-west1". Mutually exclusive with
   293  	// worker_zone. If neither worker_region nor worker_zone is specified, defaults
   294  	// to the control plane region.
   295  	WorkerRegion string `json:"workerRegion,omitempty"`
   296  	// WorkerZone: The Compute Engine zone
   297  	// (https://cloud.google.com/compute/docs/regions-zones/regions-zones) in which
   298  	// worker processing should occur, e.g. "us-west1-a". Mutually exclusive with
   299  	// worker_region. If neither worker_region nor worker_zone is specified, a zone
   300  	// in the control plane region is chosen based on available capacity. If both
   301  	// `worker_zone` and `zone` are set, `worker_zone` takes precedence.
   302  	WorkerZone string `json:"workerZone,omitempty"`
   303  	// Zone: The Compute Engine availability zone
   304  	// (https://cloud.google.com/compute/docs/regions-zones/regions-zones) for
   305  	// launching worker instances to run your pipeline. In the future, worker_zone
   306  	// will take precedence.
   307  	Zone string `json:"zone,omitempty"`
   308  	// ForceSendFields is a list of field names (e.g. "AdditionalExperiments") to
   309  	// unconditionally include in API requests. By default, fields with empty or
   310  	// default values are omitted from API requests. See
   311  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   312  	// details.
   313  	ForceSendFields []string `json:"-"`
   314  	// NullFields is a list of field names (e.g. "AdditionalExperiments") to
   315  	// include in API requests with the JSON null value. By default, fields with
   316  	// empty values are omitted from API requests. See
   317  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   318  	NullFields []string `json:"-"`
   319  }
   320  
   321  func (s *GoogleCloudDatapipelinesV1FlexTemplateRuntimeEnvironment) MarshalJSON() ([]byte, error) {
   322  	type NoMethod GoogleCloudDatapipelinesV1FlexTemplateRuntimeEnvironment
   323  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   324  }
   325  
   326  // GoogleCloudDatapipelinesV1Job: Definition of the job information maintained
   327  // by the pipeline. Fields in this entity are retrieved from the executor API
   328  // (e.g. Dataflow API).
   329  type GoogleCloudDatapipelinesV1Job struct {
   330  	// CreateTime: Output only. The time of job creation.
   331  	CreateTime string `json:"createTime,omitempty"`
   332  	// DataflowJobDetails: All the details that are specific to a Dataflow job.
   333  	DataflowJobDetails *GoogleCloudDatapipelinesV1DataflowJobDetails `json:"dataflowJobDetails,omitempty"`
   334  	// EndTime: Output only. The time of job termination. This is absent if the job
   335  	// is still running.
   336  	EndTime string `json:"endTime,omitempty"`
   337  	// Id: Output only. The internal ID for the job.
   338  	Id string `json:"id,omitempty"`
   339  	// Name: Required. The fully qualified resource name for the job.
   340  	Name string `json:"name,omitempty"`
   341  	// State: The current state of the job.
   342  	//
   343  	// Possible values:
   344  	//   "STATE_UNSPECIFIED" - The job state isn't specified.
   345  	//   "STATE_PENDING" - The job is waiting to start execution.
   346  	//   "STATE_RUNNING" - The job is executing.
   347  	//   "STATE_DONE" - The job has finished execution successfully.
   348  	//   "STATE_FAILED" - The job has finished execution with a failure.
   349  	//   "STATE_CANCELLED" - The job has been terminated upon user request.
   350  	State string `json:"state,omitempty"`
   351  	// Status: Status capturing any error code or message related to job creation
   352  	// or execution.
   353  	Status *GoogleRpcStatus `json:"status,omitempty"`
   354  	// ForceSendFields is a list of field names (e.g. "CreateTime") to
   355  	// unconditionally include in API requests. By default, fields with empty or
   356  	// default values are omitted from API requests. See
   357  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   358  	// details.
   359  	ForceSendFields []string `json:"-"`
   360  	// NullFields is a list of field names (e.g. "CreateTime") to include in API
   361  	// requests with the JSON null value. By default, fields with empty values are
   362  	// omitted from API requests. See
   363  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   364  	NullFields []string `json:"-"`
   365  }
   366  
   367  func (s *GoogleCloudDatapipelinesV1Job) MarshalJSON() ([]byte, error) {
   368  	type NoMethod GoogleCloudDatapipelinesV1Job
   369  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   370  }
   371  
   372  // GoogleCloudDatapipelinesV1LaunchFlexTemplateParameter: Launch Flex Template
   373  // parameter.
   374  type GoogleCloudDatapipelinesV1LaunchFlexTemplateParameter struct {
   375  	// ContainerSpecGcsPath: Cloud Storage path to a file with a JSON-serialized
   376  	// ContainerSpec as content.
   377  	ContainerSpecGcsPath string `json:"containerSpecGcsPath,omitempty"`
   378  	// Environment: The runtime environment for the Flex Template job.
   379  	Environment *GoogleCloudDatapipelinesV1FlexTemplateRuntimeEnvironment `json:"environment,omitempty"`
   380  	// JobName: Required. The job name to use for the created job. For an update
   381  	// job request, the job name should be the same as the existing running job.
   382  	JobName string `json:"jobName,omitempty"`
   383  	// LaunchOptions: Launch options for this Flex Template job. This is a common
   384  	// set of options across languages and templates. This should not be used to
   385  	// pass job parameters.
   386  	LaunchOptions map[string]string `json:"launchOptions,omitempty"`
   387  	// Parameters: The parameters for the Flex Template. Example:
   388  	// `{"num_workers":"5"}`
   389  	Parameters map[string]string `json:"parameters,omitempty"`
   390  	// TransformNameMappings: Use this to pass transform name mappings for
   391  	// streaming update jobs. Example:
   392  	// `{"oldTransformName":"newTransformName",...}`
   393  	TransformNameMappings map[string]string `json:"transformNameMappings,omitempty"`
   394  	// Update: Set this to true if you are sending a request to update a running
   395  	// streaming job. When set, the job name should be the same as the running job.
   396  	Update bool `json:"update,omitempty"`
   397  	// ForceSendFields is a list of field names (e.g. "ContainerSpecGcsPath") to
   398  	// unconditionally include in API requests. By default, fields with empty or
   399  	// default values are omitted from API requests. See
   400  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   401  	// details.
   402  	ForceSendFields []string `json:"-"`
   403  	// NullFields is a list of field names (e.g. "ContainerSpecGcsPath") to include
   404  	// in API requests with the JSON null value. By default, fields with empty
   405  	// values are omitted from API requests. See
   406  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   407  	NullFields []string `json:"-"`
   408  }
   409  
   410  func (s *GoogleCloudDatapipelinesV1LaunchFlexTemplateParameter) MarshalJSON() ([]byte, error) {
   411  	type NoMethod GoogleCloudDatapipelinesV1LaunchFlexTemplateParameter
   412  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   413  }
   414  
   415  // GoogleCloudDatapipelinesV1LaunchFlexTemplateRequest: A request to launch a
   416  // Dataflow job from a Flex Template.
   417  type GoogleCloudDatapipelinesV1LaunchFlexTemplateRequest struct {
   418  	// LaunchParameter: Required. Parameter to launch a job from a Flex Template.
   419  	LaunchParameter *GoogleCloudDatapipelinesV1LaunchFlexTemplateParameter `json:"launchParameter,omitempty"`
   420  	// Location: Required. The [regional endpoint]
   421  	// (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) to
   422  	// which to direct the request. For example, `us-central1`, `us-west1`.
   423  	Location string `json:"location,omitempty"`
   424  	// ProjectId: Required. The ID of the Cloud Platform project that the job
   425  	// belongs to.
   426  	ProjectId string `json:"projectId,omitempty"`
   427  	// ValidateOnly: If true, the request is validated but not actually executed.
   428  	// Defaults to false.
   429  	ValidateOnly bool `json:"validateOnly,omitempty"`
   430  	// ForceSendFields is a list of field names (e.g. "LaunchParameter") to
   431  	// unconditionally include in API requests. By default, fields with empty or
   432  	// default values are omitted from API requests. See
   433  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   434  	// details.
   435  	ForceSendFields []string `json:"-"`
   436  	// NullFields is a list of field names (e.g. "LaunchParameter") to include in
   437  	// API requests with the JSON null value. By default, fields with empty values
   438  	// are omitted from API requests. See
   439  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   440  	NullFields []string `json:"-"`
   441  }
   442  
   443  func (s *GoogleCloudDatapipelinesV1LaunchFlexTemplateRequest) MarshalJSON() ([]byte, error) {
   444  	type NoMethod GoogleCloudDatapipelinesV1LaunchFlexTemplateRequest
   445  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   446  }
   447  
   448  // GoogleCloudDatapipelinesV1LaunchTemplateParameters: Parameters to provide to
   449  // the template being launched.
   450  type GoogleCloudDatapipelinesV1LaunchTemplateParameters struct {
   451  	// Environment: The runtime environment for the job.
   452  	Environment *GoogleCloudDatapipelinesV1RuntimeEnvironment `json:"environment,omitempty"`
   453  	// JobName: Required. The job name to use for the created job.
   454  	JobName string `json:"jobName,omitempty"`
   455  	// Parameters: The runtime parameters to pass to the job.
   456  	Parameters map[string]string `json:"parameters,omitempty"`
   457  	// TransformNameMapping: Map of transform name prefixes of the job to be
   458  	// replaced to the corresponding name prefixes of the new job. Only applicable
   459  	// when updating a pipeline.
   460  	TransformNameMapping map[string]string `json:"transformNameMapping,omitempty"`
   461  	// Update: If set, replace the existing pipeline with the name specified by
   462  	// jobName with this pipeline, preserving state.
   463  	Update bool `json:"update,omitempty"`
   464  	// ForceSendFields is a list of field names (e.g. "Environment") to
   465  	// unconditionally include in API requests. By default, fields with empty or
   466  	// default values are omitted from API requests. See
   467  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   468  	// details.
   469  	ForceSendFields []string `json:"-"`
   470  	// NullFields is a list of field names (e.g. "Environment") to include in API
   471  	// requests with the JSON null value. By default, fields with empty values are
   472  	// omitted from API requests. See
   473  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   474  	NullFields []string `json:"-"`
   475  }
   476  
   477  func (s *GoogleCloudDatapipelinesV1LaunchTemplateParameters) MarshalJSON() ([]byte, error) {
   478  	type NoMethod GoogleCloudDatapipelinesV1LaunchTemplateParameters
   479  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   480  }
   481  
   482  // GoogleCloudDatapipelinesV1LaunchTemplateRequest: A request to launch a
   483  // template.
   484  type GoogleCloudDatapipelinesV1LaunchTemplateRequest struct {
   485  	// GcsPath: A Cloud Storage path to the template from which to create the job.
   486  	// Must be a valid Cloud Storage URL, beginning with 'gs://'.
   487  	GcsPath string `json:"gcsPath,omitempty"`
   488  	// LaunchParameters: The parameters of the template to launch. This should be
   489  	// part of the body of the POST request.
   490  	LaunchParameters *GoogleCloudDatapipelinesV1LaunchTemplateParameters `json:"launchParameters,omitempty"`
   491  	// Location: The [regional endpoint]
   492  	// (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) to
   493  	// which to direct the request.
   494  	Location string `json:"location,omitempty"`
   495  	// ProjectId: Required. The ID of the Cloud Platform project that the job
   496  	// belongs to.
   497  	ProjectId string `json:"projectId,omitempty"`
   498  	// ValidateOnly: If true, the request is validated but not actually executed.
   499  	// Defaults to false.
   500  	ValidateOnly bool `json:"validateOnly,omitempty"`
   501  	// ForceSendFields is a list of field names (e.g. "GcsPath") to unconditionally
   502  	// include in API requests. By default, fields with empty or default values are
   503  	// omitted from API requests. See
   504  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   505  	// details.
   506  	ForceSendFields []string `json:"-"`
   507  	// NullFields is a list of field names (e.g. "GcsPath") to include in API
   508  	// requests with the JSON null value. By default, fields with empty values are
   509  	// omitted from API requests. See
   510  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   511  	NullFields []string `json:"-"`
   512  }
   513  
   514  func (s *GoogleCloudDatapipelinesV1LaunchTemplateRequest) MarshalJSON() ([]byte, error) {
   515  	type NoMethod GoogleCloudDatapipelinesV1LaunchTemplateRequest
   516  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   517  }
   518  
   519  // GoogleCloudDatapipelinesV1ListJobsResponse: Response message for ListJobs
   520  type GoogleCloudDatapipelinesV1ListJobsResponse struct {
   521  	// Jobs: Results that were accessible to the caller. Results are always in
   522  	// descending order of job creation date.
   523  	Jobs []*GoogleCloudDatapipelinesV1Job `json:"jobs,omitempty"`
   524  	// NextPageToken: A token, which can be sent as `page_token` to retrieve the
   525  	// next page. If this field is omitted, there are no subsequent pages.
   526  	NextPageToken string `json:"nextPageToken,omitempty"`
   527  
   528  	// ServerResponse contains the HTTP response code and headers from the server.
   529  	googleapi.ServerResponse `json:"-"`
   530  	// ForceSendFields is a list of field names (e.g. "Jobs") to unconditionally
   531  	// include in API requests. By default, fields with empty or default values are
   532  	// omitted from API requests. See
   533  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   534  	// details.
   535  	ForceSendFields []string `json:"-"`
   536  	// NullFields is a list of field names (e.g. "Jobs") to include in API requests
   537  	// with the JSON null value. By default, fields with empty values are omitted
   538  	// from API requests. See
   539  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   540  	NullFields []string `json:"-"`
   541  }
   542  
   543  func (s *GoogleCloudDatapipelinesV1ListJobsResponse) MarshalJSON() ([]byte, error) {
   544  	type NoMethod GoogleCloudDatapipelinesV1ListJobsResponse
   545  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   546  }
   547  
   548  // GoogleCloudDatapipelinesV1ListPipelinesResponse: Response message for
   549  // ListPipelines.
   550  type GoogleCloudDatapipelinesV1ListPipelinesResponse struct {
   551  	// NextPageToken: A token, which can be sent as `page_token` to retrieve the
   552  	// next page. If this field is omitted, there are no subsequent pages.
   553  	NextPageToken string `json:"nextPageToken,omitempty"`
   554  	// Pipelines: Results that matched the filter criteria and were accessible to
   555  	// the caller. Results are always in descending order of pipeline creation
   556  	// date.
   557  	Pipelines []*GoogleCloudDatapipelinesV1Pipeline `json:"pipelines,omitempty"`
   558  
   559  	// ServerResponse contains the HTTP response code and headers from the server.
   560  	googleapi.ServerResponse `json:"-"`
   561  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
   562  	// unconditionally include in API requests. By default, fields with empty or
   563  	// default values are omitted from API requests. See
   564  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   565  	// details.
   566  	ForceSendFields []string `json:"-"`
   567  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
   568  	// requests with the JSON null value. By default, fields with empty values are
   569  	// omitted from API requests. See
   570  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   571  	NullFields []string `json:"-"`
   572  }
   573  
   574  func (s *GoogleCloudDatapipelinesV1ListPipelinesResponse) MarshalJSON() ([]byte, error) {
   575  	type NoMethod GoogleCloudDatapipelinesV1ListPipelinesResponse
   576  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   577  }
   578  
   579  // GoogleCloudDatapipelinesV1Pipeline: The main pipeline entity and all the
   580  // necessary metadata for launching and managing linked jobs.
   581  type GoogleCloudDatapipelinesV1Pipeline struct {
   582  	// CreateTime: Output only. Immutable. The timestamp when the pipeline was
   583  	// initially created. Set by the Data Pipelines service.
   584  	CreateTime string `json:"createTime,omitempty"`
   585  	// DisplayName: Required. The display name of the pipeline. It can contain only
   586  	// letters ([A-Za-z]), numbers ([0-9]), hyphens (-), and underscores (_).
   587  	DisplayName string `json:"displayName,omitempty"`
   588  	// JobCount: Output only. Number of jobs.
   589  	JobCount int64 `json:"jobCount,omitempty"`
   590  	// LastUpdateTime: Output only. Immutable. The timestamp when the pipeline was
   591  	// last modified. Set by the Data Pipelines service.
   592  	LastUpdateTime string `json:"lastUpdateTime,omitempty"`
   593  	// Name: The pipeline name. For example:
   594  	// `projects/PROJECT_ID/locations/LOCATION_ID/pipelines/PIPELINE_ID`. *
   595  	// `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), hyphens (-),
   596  	// colons (:), and periods (.). For more information, see Identifying projects
   597  	// (https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects).
   598  	// * `LOCATION_ID` is the canonical ID for the pipeline's location. The list of
   599  	// available locations can be obtained by calling
   600  	// `google.cloud.location.Locations.ListLocations`. Note that the Data
   601  	// Pipelines service is not available in all regions. It depends on Cloud
   602  	// Scheduler, an App Engine application, so it's only available in App Engine
   603  	// regions (https://cloud.google.com/about/locations#region). * `PIPELINE_ID`
   604  	// is the ID of the pipeline. Must be unique for the selected project and
   605  	// location.
   606  	Name string `json:"name,omitempty"`
   607  	// PipelineSources: Immutable. The sources of the pipeline (for example,
   608  	// Dataplex). The keys and values are set by the corresponding sources during
   609  	// pipeline creation.
   610  	PipelineSources map[string]string `json:"pipelineSources,omitempty"`
   611  	// ScheduleInfo: Internal scheduling information for a pipeline. If this
   612  	// information is provided, periodic jobs will be created per the schedule. If
   613  	// not, users are responsible for creating jobs externally.
   614  	ScheduleInfo *GoogleCloudDatapipelinesV1ScheduleSpec `json:"scheduleInfo,omitempty"`
   615  	// SchedulerServiceAccountEmail: Optional. A service account email to be used
   616  	// with the Cloud Scheduler job. If not specified, the default compute engine
   617  	// service account will be used.
   618  	SchedulerServiceAccountEmail string `json:"schedulerServiceAccountEmail,omitempty"`
   619  	// State: Required. The state of the pipeline. When the pipeline is created,
   620  	// the state is set to 'PIPELINE_STATE_ACTIVE' by default. State changes can be
   621  	// requested by setting the state to stopping, paused, or resuming. State
   622  	// cannot be changed through UpdatePipeline requests.
   623  	//
   624  	// Possible values:
   625  	//   "STATE_UNSPECIFIED" - The pipeline state isn't specified.
   626  	//   "STATE_RESUMING" - The pipeline is getting started or resumed. When
   627  	// finished, the pipeline state will be 'PIPELINE_STATE_ACTIVE'.
   628  	//   "STATE_ACTIVE" - The pipeline is actively running.
   629  	//   "STATE_STOPPING" - The pipeline is in the process of stopping. When
   630  	// finished, the pipeline state will be 'PIPELINE_STATE_ARCHIVED'.
   631  	//   "STATE_ARCHIVED" - The pipeline has been stopped. This is a terminal state
   632  	// and cannot be undone.
   633  	//   "STATE_PAUSED" - The pipeline is paused. This is a non-terminal state.
   634  	// When the pipeline is paused, it will hold processing jobs, but can be
   635  	// resumed later. For a batch pipeline, this means pausing the scheduler job.
   636  	// For a streaming pipeline, creating a job snapshot to resume from will give
   637  	// the same effect.
   638  	State string `json:"state,omitempty"`
   639  	// Type: Required. The type of the pipeline. This field affects the scheduling
   640  	// of the pipeline and the type of metrics to show for the pipeline.
   641  	//
   642  	// Possible values:
   643  	//   "PIPELINE_TYPE_UNSPECIFIED" - The pipeline type isn't specified.
   644  	//   "PIPELINE_TYPE_BATCH" - A batch pipeline. It runs jobs on a specific
   645  	// schedule, and each job will automatically terminate once execution is
   646  	// finished.
   647  	//   "PIPELINE_TYPE_STREAMING" - A streaming pipeline. The underlying job is
   648  	// continuously running until it is manually terminated by the user. This type
   649  	// of pipeline doesn't have a schedule to run on, and the linked job gets
   650  	// created when the pipeline is created.
   651  	Type string `json:"type,omitempty"`
   652  	// Workload: Workload information for creating new jobs.
   653  	Workload *GoogleCloudDatapipelinesV1Workload `json:"workload,omitempty"`
   654  
   655  	// ServerResponse contains the HTTP response code and headers from the server.
   656  	googleapi.ServerResponse `json:"-"`
   657  	// ForceSendFields is a list of field names (e.g. "CreateTime") to
   658  	// unconditionally include in API requests. By default, fields with empty or
   659  	// default values are omitted from API requests. See
   660  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   661  	// details.
   662  	ForceSendFields []string `json:"-"`
   663  	// NullFields is a list of field names (e.g. "CreateTime") to include in API
   664  	// requests with the JSON null value. By default, fields with empty values are
   665  	// omitted from API requests. See
   666  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   667  	NullFields []string `json:"-"`
   668  }
   669  
   670  func (s *GoogleCloudDatapipelinesV1Pipeline) MarshalJSON() ([]byte, error) {
   671  	type NoMethod GoogleCloudDatapipelinesV1Pipeline
   672  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   673  }
   674  
   675  // GoogleCloudDatapipelinesV1RunPipelineRequest: Request message for
   676  // RunPipeline
   677  type GoogleCloudDatapipelinesV1RunPipelineRequest struct {
   678  }
   679  
   680  // GoogleCloudDatapipelinesV1RunPipelineResponse: Response message for
   681  // RunPipeline
   682  type GoogleCloudDatapipelinesV1RunPipelineResponse struct {
   683  	// Job: Job that was created as part of RunPipeline operation.
   684  	Job *GoogleCloudDatapipelinesV1Job `json:"job,omitempty"`
   685  
   686  	// ServerResponse contains the HTTP response code and headers from the server.
   687  	googleapi.ServerResponse `json:"-"`
   688  	// ForceSendFields is a list of field names (e.g. "Job") to unconditionally
   689  	// include in API requests. By default, fields with empty or default values are
   690  	// omitted from API requests. See
   691  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   692  	// details.
   693  	ForceSendFields []string `json:"-"`
   694  	// NullFields is a list of field names (e.g. "Job") to include in API requests
   695  	// with the JSON null value. By default, fields with empty values are omitted
   696  	// from API requests. See
   697  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   698  	NullFields []string `json:"-"`
   699  }
   700  
   701  func (s *GoogleCloudDatapipelinesV1RunPipelineResponse) MarshalJSON() ([]byte, error) {
   702  	type NoMethod GoogleCloudDatapipelinesV1RunPipelineResponse
   703  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   704  }
   705  
   706  // GoogleCloudDatapipelinesV1RuntimeEnvironment: The environment values to set
   707  // at runtime.
   708  type GoogleCloudDatapipelinesV1RuntimeEnvironment struct {
   709  	// AdditionalExperiments: Additional experiment flags for the job.
   710  	AdditionalExperiments []string `json:"additionalExperiments,omitempty"`
   711  	// AdditionalUserLabels: Additional user labels to be specified for the job.
   712  	// Keys and values should follow the restrictions specified in the labeling
   713  	// restrictions
   714  	// (https://cloud.google.com/compute/docs/labeling-resources#restrictions)
   715  	// page. An object containing a list of key/value pairs. Example: { "name":
   716  	// "wrench", "mass": "1kg", "count": "3" }.
   717  	AdditionalUserLabels map[string]string `json:"additionalUserLabels,omitempty"`
   718  	// BypassTempDirValidation: Whether to bypass the safety checks for the job's
   719  	// temporary directory. Use with caution.
   720  	BypassTempDirValidation bool `json:"bypassTempDirValidation,omitempty"`
   721  	// EnableStreamingEngine: Whether to enable Streaming Engine for the job.
   722  	EnableStreamingEngine bool `json:"enableStreamingEngine,omitempty"`
   723  	// IpConfiguration: Configuration for VM IPs.
   724  	//
   725  	// Possible values:
   726  	//   "WORKER_IP_UNSPECIFIED" - The configuration is unknown, or unspecified.
   727  	//   "WORKER_IP_PUBLIC" - Workers should have public IP addresses.
   728  	//   "WORKER_IP_PRIVATE" - Workers should have private IP addresses.
   729  	IpConfiguration string `json:"ipConfiguration,omitempty"`
   730  	// KmsKeyName: Name for the Cloud KMS key for the job. The key format is:
   731  	// projects//locations//keyRings//cryptoKeys/
   732  	KmsKeyName string `json:"kmsKeyName,omitempty"`
   733  	// MachineType: The machine type to use for the job. Defaults to the value from
   734  	// the template if not specified.
   735  	MachineType string `json:"machineType,omitempty"`
   736  	// MaxWorkers: The maximum number of Compute Engine instances to be made
   737  	// available to your pipeline during execution, from 1 to 1000.
   738  	MaxWorkers int64 `json:"maxWorkers,omitempty"`
   739  	// Network: Network to which VMs will be assigned. If empty or unspecified, the
   740  	// service will use the network "default".
   741  	Network string `json:"network,omitempty"`
   742  	// NumWorkers: The initial number of Compute Engine instances for the job.
   743  	NumWorkers int64 `json:"numWorkers,omitempty"`
   744  	// ServiceAccountEmail: The email address of the service account to run the job
   745  	// as.
   746  	ServiceAccountEmail string `json:"serviceAccountEmail,omitempty"`
   747  	// Subnetwork: Subnetwork to which VMs will be assigned, if desired. You can
   748  	// specify a subnetwork using either a complete URL or an abbreviated path.
   749  	// Expected to be of the form
   750  	// "https://www.googleapis.com/compute/v1/projects/HOST_PROJECT_ID/regions/REGIO
   751  	// N/subnetworks/SUBNETWORK" or "regions/REGION/subnetworks/SUBNETWORK". If the
   752  	// subnetwork is located in a Shared VPC network, you must use the complete
   753  	// URL.
   754  	Subnetwork string `json:"subnetwork,omitempty"`
   755  	// TempLocation: The Cloud Storage path to use for temporary files. Must be a
   756  	// valid Cloud Storage URL, beginning with `gs://`.
   757  	TempLocation string `json:"tempLocation,omitempty"`
   758  	// WorkerRegion: The Compute Engine region
   759  	// (https://cloud.google.com/compute/docs/regions-zones/regions-zones) in which
   760  	// worker processing should occur, e.g. "us-west1". Mutually exclusive with
   761  	// worker_zone. If neither worker_region nor worker_zone is specified, default
   762  	// to the control plane's region.
   763  	WorkerRegion string `json:"workerRegion,omitempty"`
   764  	// WorkerZone: The Compute Engine zone
   765  	// (https://cloud.google.com/compute/docs/regions-zones/regions-zones) in which
   766  	// worker processing should occur, e.g. "us-west1-a". Mutually exclusive with
   767  	// worker_region. If neither worker_region nor worker_zone is specified, a zone
   768  	// in the control plane's region is chosen based on available capacity. If both
   769  	// `worker_zone` and `zone` are set, `worker_zone` takes precedence.
   770  	WorkerZone string `json:"workerZone,omitempty"`
   771  	// Zone: The Compute Engine availability zone
   772  	// (https://cloud.google.com/compute/docs/regions-zones/regions-zones) for
   773  	// launching worker instances to run your pipeline. In the future, worker_zone
   774  	// will take precedence.
   775  	Zone string `json:"zone,omitempty"`
   776  	// ForceSendFields is a list of field names (e.g. "AdditionalExperiments") to
   777  	// unconditionally include in API requests. By default, fields with empty or
   778  	// default values are omitted from API requests. See
   779  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   780  	// details.
   781  	ForceSendFields []string `json:"-"`
   782  	// NullFields is a list of field names (e.g. "AdditionalExperiments") to
   783  	// include in API requests with the JSON null value. By default, fields with
   784  	// empty values are omitted from API requests. See
   785  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   786  	NullFields []string `json:"-"`
   787  }
   788  
   789  func (s *GoogleCloudDatapipelinesV1RuntimeEnvironment) MarshalJSON() ([]byte, error) {
   790  	type NoMethod GoogleCloudDatapipelinesV1RuntimeEnvironment
   791  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   792  }
   793  
   794  // GoogleCloudDatapipelinesV1ScheduleSpec: Details of the schedule the pipeline
   795  // runs on.
   796  type GoogleCloudDatapipelinesV1ScheduleSpec struct {
   797  	// NextJobTime: Output only. When the next Scheduler job is going to run.
   798  	NextJobTime string `json:"nextJobTime,omitempty"`
   799  	// Schedule: Unix-cron format of the schedule. This information is retrieved
   800  	// from the linked Cloud Scheduler.
   801  	Schedule string `json:"schedule,omitempty"`
   802  	// TimeZone: Timezone ID. This matches the timezone IDs used by the Cloud
   803  	// Scheduler API. If empty, UTC time is assumed.
   804  	TimeZone string `json:"timeZone,omitempty"`
   805  	// ForceSendFields is a list of field names (e.g. "NextJobTime") to
   806  	// unconditionally include in API requests. By default, fields with empty or
   807  	// default values are omitted from API requests. See
   808  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   809  	// details.
   810  	ForceSendFields []string `json:"-"`
   811  	// NullFields is a list of field names (e.g. "NextJobTime") to include in API
   812  	// requests with the JSON null value. By default, fields with empty values are
   813  	// omitted from API requests. See
   814  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   815  	NullFields []string `json:"-"`
   816  }
   817  
   818  func (s *GoogleCloudDatapipelinesV1ScheduleSpec) MarshalJSON() ([]byte, error) {
   819  	type NoMethod GoogleCloudDatapipelinesV1ScheduleSpec
   820  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   821  }
   822  
   823  // GoogleCloudDatapipelinesV1SdkVersion: The version of the SDK used to run the
   824  // job.
   825  type GoogleCloudDatapipelinesV1SdkVersion struct {
   826  	// SdkSupportStatus: The support status for this SDK version.
   827  	//
   828  	// Possible values:
   829  	//   "UNKNOWN" - Dataflow is unaware of this version.
   830  	//   "SUPPORTED" - This is a known version of an SDK, and is supported.
   831  	//   "STALE" - A newer version of the SDK exists, and an update is recommended.
   832  	//   "DEPRECATED" - This version of the SDK is deprecated and will eventually
   833  	// be unsupported.
   834  	//   "UNSUPPORTED" - Support for this SDK version has ended and it should no
   835  	// longer be used.
   836  	SdkSupportStatus string `json:"sdkSupportStatus,omitempty"`
   837  	// Version: The version of the SDK used to run the job.
   838  	Version string `json:"version,omitempty"`
   839  	// VersionDisplayName: A readable string describing the version of the SDK.
   840  	VersionDisplayName string `json:"versionDisplayName,omitempty"`
   841  	// ForceSendFields is a list of field names (e.g. "SdkSupportStatus") to
   842  	// unconditionally include in API requests. By default, fields with empty or
   843  	// default values are omitted from API requests. See
   844  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   845  	// details.
   846  	ForceSendFields []string `json:"-"`
   847  	// NullFields is a list of field names (e.g. "SdkSupportStatus") to include in
   848  	// API requests with the JSON null value. By default, fields with empty values
   849  	// are omitted from API requests. See
   850  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   851  	NullFields []string `json:"-"`
   852  }
   853  
   854  func (s *GoogleCloudDatapipelinesV1SdkVersion) MarshalJSON() ([]byte, error) {
   855  	type NoMethod GoogleCloudDatapipelinesV1SdkVersion
   856  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   857  }
   858  
   859  // GoogleCloudDatapipelinesV1StopPipelineRequest: Request message for
   860  // StopPipeline.
   861  type GoogleCloudDatapipelinesV1StopPipelineRequest struct {
   862  }
   863  
   864  // GoogleCloudDatapipelinesV1Workload: Workload details for creating the
   865  // pipeline jobs.
   866  type GoogleCloudDatapipelinesV1Workload struct {
   867  	// DataflowFlexTemplateRequest: Template information and additional parameters
   868  	// needed to launch a Dataflow job using the flex launch API.
   869  	DataflowFlexTemplateRequest *GoogleCloudDatapipelinesV1LaunchFlexTemplateRequest `json:"dataflowFlexTemplateRequest,omitempty"`
   870  	// DataflowLaunchTemplateRequest: Template information and additional
   871  	// parameters needed to launch a Dataflow job using the standard launch API.
   872  	DataflowLaunchTemplateRequest *GoogleCloudDatapipelinesV1LaunchTemplateRequest `json:"dataflowLaunchTemplateRequest,omitempty"`
   873  	// ForceSendFields is a list of field names (e.g.
   874  	// "DataflowFlexTemplateRequest") to unconditionally include in API requests.
   875  	// By default, fields with empty or default values are omitted from API
   876  	// requests. See https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields
   877  	// for more details.
   878  	ForceSendFields []string `json:"-"`
   879  	// NullFields is a list of field names (e.g. "DataflowFlexTemplateRequest") to
   880  	// include in API requests with the JSON null value. By default, fields with
   881  	// empty values are omitted from API requests. See
   882  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   883  	NullFields []string `json:"-"`
   884  }
   885  
   886  func (s *GoogleCloudDatapipelinesV1Workload) MarshalJSON() ([]byte, error) {
   887  	type NoMethod GoogleCloudDatapipelinesV1Workload
   888  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   889  }
   890  
   891  // GoogleProtobufEmpty: A generic empty message that you can re-use to avoid
   892  // defining duplicated empty messages in your APIs. A typical example is to use
   893  // it as the request or the response type of an API method. For instance:
   894  // service Foo { rpc Bar(google.protobuf.Empty) returns
   895  // (google.protobuf.Empty); }
   896  type GoogleProtobufEmpty struct {
   897  	// ServerResponse contains the HTTP response code and headers from the server.
   898  	googleapi.ServerResponse `json:"-"`
   899  }
   900  
   901  // GoogleRpcStatus: The `Status` type defines a logical error model that is
   902  // suitable for different programming environments, including REST APIs and RPC
   903  // APIs. It is used by gRPC (https://github.com/grpc). Each `Status` message
   904  // contains three pieces of data: error code, error message, and error details.
   905  // You can find out more about this error model and how to work with it in the
   906  // API Design Guide (https://cloud.google.com/apis/design/errors).
   907  type GoogleRpcStatus struct {
   908  	// Code: The status code, which should be an enum value of google.rpc.Code.
   909  	Code int64 `json:"code,omitempty"`
   910  	// Details: A list of messages that carry the error details. There is a common
   911  	// set of message types for APIs to use.
   912  	Details []googleapi.RawMessage `json:"details,omitempty"`
   913  	// Message: A developer-facing error message, which should be in English. Any
   914  	// user-facing error message should be localized and sent in the
   915  	// google.rpc.Status.details field, or localized by the client.
   916  	Message string `json:"message,omitempty"`
   917  	// ForceSendFields is a list of field names (e.g. "Code") to unconditionally
   918  	// include in API requests. By default, fields with empty or default values are
   919  	// omitted from API requests. See
   920  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   921  	// details.
   922  	ForceSendFields []string `json:"-"`
   923  	// NullFields is a list of field names (e.g. "Code") to include in API requests
   924  	// with the JSON null value. By default, fields with empty values are omitted
   925  	// from API requests. See
   926  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   927  	NullFields []string `json:"-"`
   928  }
   929  
   930  func (s *GoogleRpcStatus) MarshalJSON() ([]byte, error) {
   931  	type NoMethod GoogleRpcStatus
   932  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   933  }
   934  
   935  type ProjectsLocationsPipelinesCreateCall struct {
   936  	s                                  *Service
   937  	parent                             string
   938  	googleclouddatapipelinesv1pipeline *GoogleCloudDatapipelinesV1Pipeline
   939  	urlParams_                         gensupport.URLParams
   940  	ctx_                               context.Context
   941  	header_                            http.Header
   942  }
   943  
   944  // Create: Creates a pipeline. For a batch pipeline, you can pass scheduler
   945  // information. Data Pipelines uses the scheduler information to create an
   946  // internal scheduler that runs jobs periodically. If the internal scheduler is
   947  // not configured, you can use RunPipeline to run jobs.
   948  //
   949  //   - parent: The location name. For example:
   950  //     `projects/PROJECT_ID/locations/LOCATION_ID`.
   951  func (r *ProjectsLocationsPipelinesService) Create(parent string, googleclouddatapipelinesv1pipeline *GoogleCloudDatapipelinesV1Pipeline) *ProjectsLocationsPipelinesCreateCall {
   952  	c := &ProjectsLocationsPipelinesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
   953  	c.parent = parent
   954  	c.googleclouddatapipelinesv1pipeline = googleclouddatapipelinesv1pipeline
   955  	return c
   956  }
   957  
   958  // Fields allows partial responses to be retrieved. See
   959  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
   960  // details.
   961  func (c *ProjectsLocationsPipelinesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsPipelinesCreateCall {
   962  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
   963  	return c
   964  }
   965  
   966  // Context sets the context to be used in this call's Do method.
   967  func (c *ProjectsLocationsPipelinesCreateCall) Context(ctx context.Context) *ProjectsLocationsPipelinesCreateCall {
   968  	c.ctx_ = ctx
   969  	return c
   970  }
   971  
   972  // Header returns a http.Header that can be modified by the caller to add
   973  // headers to the request.
   974  func (c *ProjectsLocationsPipelinesCreateCall) Header() http.Header {
   975  	if c.header_ == nil {
   976  		c.header_ = make(http.Header)
   977  	}
   978  	return c.header_
   979  }
   980  
   981  func (c *ProjectsLocationsPipelinesCreateCall) doRequest(alt string) (*http.Response, error) {
   982  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
   983  	var body io.Reader = nil
   984  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddatapipelinesv1pipeline)
   985  	if err != nil {
   986  		return nil, err
   987  	}
   988  	c.urlParams_.Set("alt", alt)
   989  	c.urlParams_.Set("prettyPrint", "false")
   990  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/pipelines")
   991  	urls += "?" + c.urlParams_.Encode()
   992  	req, err := http.NewRequest("POST", urls, body)
   993  	if err != nil {
   994  		return nil, err
   995  	}
   996  	req.Header = reqHeaders
   997  	googleapi.Expand(req.URL, map[string]string{
   998  		"parent": c.parent,
   999  	})
  1000  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1001  }
  1002  
  1003  // Do executes the "datapipelines.projects.locations.pipelines.create" call.
  1004  // Any non-2xx status code is an error. Response headers are in either
  1005  // *GoogleCloudDatapipelinesV1Pipeline.ServerResponse.Header or (if a response
  1006  // was returned at all) in error.(*googleapi.Error).Header. Use
  1007  // googleapi.IsNotModified to check whether the returned error was because
  1008  // http.StatusNotModified was returned.
  1009  func (c *ProjectsLocationsPipelinesCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDatapipelinesV1Pipeline, error) {
  1010  	gensupport.SetOptions(c.urlParams_, opts...)
  1011  	res, err := c.doRequest("json")
  1012  	if res != nil && res.StatusCode == http.StatusNotModified {
  1013  		if res.Body != nil {
  1014  			res.Body.Close()
  1015  		}
  1016  		return nil, gensupport.WrapError(&googleapi.Error{
  1017  			Code:   res.StatusCode,
  1018  			Header: res.Header,
  1019  		})
  1020  	}
  1021  	if err != nil {
  1022  		return nil, err
  1023  	}
  1024  	defer googleapi.CloseBody(res)
  1025  	if err := googleapi.CheckResponse(res); err != nil {
  1026  		return nil, gensupport.WrapError(err)
  1027  	}
  1028  	ret := &GoogleCloudDatapipelinesV1Pipeline{
  1029  		ServerResponse: googleapi.ServerResponse{
  1030  			Header:         res.Header,
  1031  			HTTPStatusCode: res.StatusCode,
  1032  		},
  1033  	}
  1034  	target := &ret
  1035  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1036  		return nil, err
  1037  	}
  1038  	return ret, nil
  1039  }
  1040  
  1041  type ProjectsLocationsPipelinesDeleteCall struct {
  1042  	s          *Service
  1043  	name       string
  1044  	urlParams_ gensupport.URLParams
  1045  	ctx_       context.Context
  1046  	header_    http.Header
  1047  }
  1048  
  1049  // Delete: Deletes a pipeline. If a scheduler job is attached to the pipeline,
  1050  // it will be deleted.
  1051  //
  1052  //   - name: The pipeline name. For example:
  1053  //     `projects/PROJECT_ID/locations/LOCATION_ID/pipelines/PIPELINE_ID`.
  1054  func (r *ProjectsLocationsPipelinesService) Delete(name string) *ProjectsLocationsPipelinesDeleteCall {
  1055  	c := &ProjectsLocationsPipelinesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1056  	c.name = name
  1057  	return c
  1058  }
  1059  
  1060  // Fields allows partial responses to be retrieved. See
  1061  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1062  // details.
  1063  func (c *ProjectsLocationsPipelinesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsPipelinesDeleteCall {
  1064  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1065  	return c
  1066  }
  1067  
  1068  // Context sets the context to be used in this call's Do method.
  1069  func (c *ProjectsLocationsPipelinesDeleteCall) Context(ctx context.Context) *ProjectsLocationsPipelinesDeleteCall {
  1070  	c.ctx_ = ctx
  1071  	return c
  1072  }
  1073  
  1074  // Header returns a http.Header that can be modified by the caller to add
  1075  // headers to the request.
  1076  func (c *ProjectsLocationsPipelinesDeleteCall) Header() http.Header {
  1077  	if c.header_ == nil {
  1078  		c.header_ = make(http.Header)
  1079  	}
  1080  	return c.header_
  1081  }
  1082  
  1083  func (c *ProjectsLocationsPipelinesDeleteCall) doRequest(alt string) (*http.Response, error) {
  1084  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1085  	var body io.Reader = nil
  1086  	c.urlParams_.Set("alt", alt)
  1087  	c.urlParams_.Set("prettyPrint", "false")
  1088  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  1089  	urls += "?" + c.urlParams_.Encode()
  1090  	req, err := http.NewRequest("DELETE", urls, body)
  1091  	if err != nil {
  1092  		return nil, err
  1093  	}
  1094  	req.Header = reqHeaders
  1095  	googleapi.Expand(req.URL, map[string]string{
  1096  		"name": c.name,
  1097  	})
  1098  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1099  }
  1100  
  1101  // Do executes the "datapipelines.projects.locations.pipelines.delete" call.
  1102  // Any non-2xx status code is an error. Response headers are in either
  1103  // *GoogleProtobufEmpty.ServerResponse.Header or (if a response was returned at
  1104  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1105  // check whether the returned error was because http.StatusNotModified was
  1106  // returned.
  1107  func (c *ProjectsLocationsPipelinesDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) {
  1108  	gensupport.SetOptions(c.urlParams_, opts...)
  1109  	res, err := c.doRequest("json")
  1110  	if res != nil && res.StatusCode == http.StatusNotModified {
  1111  		if res.Body != nil {
  1112  			res.Body.Close()
  1113  		}
  1114  		return nil, gensupport.WrapError(&googleapi.Error{
  1115  			Code:   res.StatusCode,
  1116  			Header: res.Header,
  1117  		})
  1118  	}
  1119  	if err != nil {
  1120  		return nil, err
  1121  	}
  1122  	defer googleapi.CloseBody(res)
  1123  	if err := googleapi.CheckResponse(res); err != nil {
  1124  		return nil, gensupport.WrapError(err)
  1125  	}
  1126  	ret := &GoogleProtobufEmpty{
  1127  		ServerResponse: googleapi.ServerResponse{
  1128  			Header:         res.Header,
  1129  			HTTPStatusCode: res.StatusCode,
  1130  		},
  1131  	}
  1132  	target := &ret
  1133  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1134  		return nil, err
  1135  	}
  1136  	return ret, nil
  1137  }
  1138  
  1139  type ProjectsLocationsPipelinesGetCall struct {
  1140  	s            *Service
  1141  	name         string
  1142  	urlParams_   gensupport.URLParams
  1143  	ifNoneMatch_ string
  1144  	ctx_         context.Context
  1145  	header_      http.Header
  1146  }
  1147  
  1148  // Get: Looks up a single pipeline. Returns a "NOT_FOUND" error if no such
  1149  // pipeline exists. Returns a "FORBIDDEN" error if the caller doesn't have
  1150  // permission to access it.
  1151  //
  1152  //   - name: The pipeline name. For example:
  1153  //     `projects/PROJECT_ID/locations/LOCATION_ID/pipelines/PIPELINE_ID`.
  1154  func (r *ProjectsLocationsPipelinesService) Get(name string) *ProjectsLocationsPipelinesGetCall {
  1155  	c := &ProjectsLocationsPipelinesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1156  	c.name = name
  1157  	return c
  1158  }
  1159  
  1160  // Fields allows partial responses to be retrieved. See
  1161  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1162  // details.
  1163  func (c *ProjectsLocationsPipelinesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsPipelinesGetCall {
  1164  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1165  	return c
  1166  }
  1167  
  1168  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1169  // object's ETag matches the given value. This is useful for getting updates
  1170  // only after the object has changed since the last request.
  1171  func (c *ProjectsLocationsPipelinesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsPipelinesGetCall {
  1172  	c.ifNoneMatch_ = entityTag
  1173  	return c
  1174  }
  1175  
  1176  // Context sets the context to be used in this call's Do method.
  1177  func (c *ProjectsLocationsPipelinesGetCall) Context(ctx context.Context) *ProjectsLocationsPipelinesGetCall {
  1178  	c.ctx_ = ctx
  1179  	return c
  1180  }
  1181  
  1182  // Header returns a http.Header that can be modified by the caller to add
  1183  // headers to the request.
  1184  func (c *ProjectsLocationsPipelinesGetCall) Header() http.Header {
  1185  	if c.header_ == nil {
  1186  		c.header_ = make(http.Header)
  1187  	}
  1188  	return c.header_
  1189  }
  1190  
  1191  func (c *ProjectsLocationsPipelinesGetCall) doRequest(alt string) (*http.Response, error) {
  1192  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1193  	if c.ifNoneMatch_ != "" {
  1194  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1195  	}
  1196  	var body io.Reader = nil
  1197  	c.urlParams_.Set("alt", alt)
  1198  	c.urlParams_.Set("prettyPrint", "false")
  1199  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  1200  	urls += "?" + c.urlParams_.Encode()
  1201  	req, err := http.NewRequest("GET", urls, body)
  1202  	if err != nil {
  1203  		return nil, err
  1204  	}
  1205  	req.Header = reqHeaders
  1206  	googleapi.Expand(req.URL, map[string]string{
  1207  		"name": c.name,
  1208  	})
  1209  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1210  }
  1211  
  1212  // Do executes the "datapipelines.projects.locations.pipelines.get" call.
  1213  // Any non-2xx status code is an error. Response headers are in either
  1214  // *GoogleCloudDatapipelinesV1Pipeline.ServerResponse.Header or (if a response
  1215  // was returned at all) in error.(*googleapi.Error).Header. Use
  1216  // googleapi.IsNotModified to check whether the returned error was because
  1217  // http.StatusNotModified was returned.
  1218  func (c *ProjectsLocationsPipelinesGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDatapipelinesV1Pipeline, error) {
  1219  	gensupport.SetOptions(c.urlParams_, opts...)
  1220  	res, err := c.doRequest("json")
  1221  	if res != nil && res.StatusCode == http.StatusNotModified {
  1222  		if res.Body != nil {
  1223  			res.Body.Close()
  1224  		}
  1225  		return nil, gensupport.WrapError(&googleapi.Error{
  1226  			Code:   res.StatusCode,
  1227  			Header: res.Header,
  1228  		})
  1229  	}
  1230  	if err != nil {
  1231  		return nil, err
  1232  	}
  1233  	defer googleapi.CloseBody(res)
  1234  	if err := googleapi.CheckResponse(res); err != nil {
  1235  		return nil, gensupport.WrapError(err)
  1236  	}
  1237  	ret := &GoogleCloudDatapipelinesV1Pipeline{
  1238  		ServerResponse: googleapi.ServerResponse{
  1239  			Header:         res.Header,
  1240  			HTTPStatusCode: res.StatusCode,
  1241  		},
  1242  	}
  1243  	target := &ret
  1244  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1245  		return nil, err
  1246  	}
  1247  	return ret, nil
  1248  }
  1249  
  1250  type ProjectsLocationsPipelinesListCall struct {
  1251  	s            *Service
  1252  	parent       string
  1253  	urlParams_   gensupport.URLParams
  1254  	ifNoneMatch_ string
  1255  	ctx_         context.Context
  1256  	header_      http.Header
  1257  }
  1258  
  1259  // List: Lists pipelines. Returns a "FORBIDDEN" error if the caller doesn't
  1260  // have permission to access it.
  1261  //
  1262  //   - parent: The location name. For example:
  1263  //     `projects/PROJECT_ID/locations/LOCATION_ID`.
  1264  func (r *ProjectsLocationsPipelinesService) List(parent string) *ProjectsLocationsPipelinesListCall {
  1265  	c := &ProjectsLocationsPipelinesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1266  	c.parent = parent
  1267  	return c
  1268  }
  1269  
  1270  // Filter sets the optional parameter "filter": An expression for filtering the
  1271  // results of the request. If unspecified, all pipelines will be returned.
  1272  // Multiple filters can be applied and must be comma separated. Fields eligible
  1273  // for filtering are: + `type`: The type of the pipeline (streaming or batch).
  1274  // Allowed values are `ALL`, `BATCH`, and `STREAMING`. + `status`: The activity
  1275  // status of the pipeline. Allowed values are `ALL`, `ACTIVE`, `ARCHIVED`, and
  1276  // `PAUSED`. For example, to limit results to active batch processing
  1277  // pipelines: type:BATCH,status:ACTIVE
  1278  func (c *ProjectsLocationsPipelinesListCall) Filter(filter string) *ProjectsLocationsPipelinesListCall {
  1279  	c.urlParams_.Set("filter", filter)
  1280  	return c
  1281  }
  1282  
  1283  // PageSize sets the optional parameter "pageSize": The maximum number of
  1284  // entities to return. The service may return fewer than this value, even if
  1285  // there are additional pages. If unspecified, the max limit is yet to be
  1286  // determined by the backend implementation.
  1287  func (c *ProjectsLocationsPipelinesListCall) PageSize(pageSize int64) *ProjectsLocationsPipelinesListCall {
  1288  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  1289  	return c
  1290  }
  1291  
  1292  // PageToken sets the optional parameter "pageToken": A page token, received
  1293  // from a previous `ListPipelines` call. Provide this to retrieve the
  1294  // subsequent page. When paginating, all other parameters provided to
  1295  // `ListPipelines` must match the call that provided the page token.
  1296  func (c *ProjectsLocationsPipelinesListCall) PageToken(pageToken string) *ProjectsLocationsPipelinesListCall {
  1297  	c.urlParams_.Set("pageToken", pageToken)
  1298  	return c
  1299  }
  1300  
  1301  // Fields allows partial responses to be retrieved. See
  1302  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1303  // details.
  1304  func (c *ProjectsLocationsPipelinesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsPipelinesListCall {
  1305  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1306  	return c
  1307  }
  1308  
  1309  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1310  // object's ETag matches the given value. This is useful for getting updates
  1311  // only after the object has changed since the last request.
  1312  func (c *ProjectsLocationsPipelinesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsPipelinesListCall {
  1313  	c.ifNoneMatch_ = entityTag
  1314  	return c
  1315  }
  1316  
  1317  // Context sets the context to be used in this call's Do method.
  1318  func (c *ProjectsLocationsPipelinesListCall) Context(ctx context.Context) *ProjectsLocationsPipelinesListCall {
  1319  	c.ctx_ = ctx
  1320  	return c
  1321  }
  1322  
  1323  // Header returns a http.Header that can be modified by the caller to add
  1324  // headers to the request.
  1325  func (c *ProjectsLocationsPipelinesListCall) Header() http.Header {
  1326  	if c.header_ == nil {
  1327  		c.header_ = make(http.Header)
  1328  	}
  1329  	return c.header_
  1330  }
  1331  
  1332  func (c *ProjectsLocationsPipelinesListCall) doRequest(alt string) (*http.Response, error) {
  1333  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1334  	if c.ifNoneMatch_ != "" {
  1335  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1336  	}
  1337  	var body io.Reader = nil
  1338  	c.urlParams_.Set("alt", alt)
  1339  	c.urlParams_.Set("prettyPrint", "false")
  1340  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/pipelines")
  1341  	urls += "?" + c.urlParams_.Encode()
  1342  	req, err := http.NewRequest("GET", urls, body)
  1343  	if err != nil {
  1344  		return nil, err
  1345  	}
  1346  	req.Header = reqHeaders
  1347  	googleapi.Expand(req.URL, map[string]string{
  1348  		"parent": c.parent,
  1349  	})
  1350  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1351  }
  1352  
  1353  // Do executes the "datapipelines.projects.locations.pipelines.list" call.
  1354  // Any non-2xx status code is an error. Response headers are in either
  1355  // *GoogleCloudDatapipelinesV1ListPipelinesResponse.ServerResponse.Header or
  1356  // (if a response was returned at all) in error.(*googleapi.Error).Header. Use
  1357  // googleapi.IsNotModified to check whether the returned error was because
  1358  // http.StatusNotModified was returned.
  1359  func (c *ProjectsLocationsPipelinesListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDatapipelinesV1ListPipelinesResponse, error) {
  1360  	gensupport.SetOptions(c.urlParams_, opts...)
  1361  	res, err := c.doRequest("json")
  1362  	if res != nil && res.StatusCode == http.StatusNotModified {
  1363  		if res.Body != nil {
  1364  			res.Body.Close()
  1365  		}
  1366  		return nil, gensupport.WrapError(&googleapi.Error{
  1367  			Code:   res.StatusCode,
  1368  			Header: res.Header,
  1369  		})
  1370  	}
  1371  	if err != nil {
  1372  		return nil, err
  1373  	}
  1374  	defer googleapi.CloseBody(res)
  1375  	if err := googleapi.CheckResponse(res); err != nil {
  1376  		return nil, gensupport.WrapError(err)
  1377  	}
  1378  	ret := &GoogleCloudDatapipelinesV1ListPipelinesResponse{
  1379  		ServerResponse: googleapi.ServerResponse{
  1380  			Header:         res.Header,
  1381  			HTTPStatusCode: res.StatusCode,
  1382  		},
  1383  	}
  1384  	target := &ret
  1385  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1386  		return nil, err
  1387  	}
  1388  	return ret, nil
  1389  }
  1390  
  1391  // Pages invokes f for each page of results.
  1392  // A non-nil error returned from f will halt the iteration.
  1393  // The provided context supersedes any context provided to the Context method.
  1394  func (c *ProjectsLocationsPipelinesListCall) Pages(ctx context.Context, f func(*GoogleCloudDatapipelinesV1ListPipelinesResponse) error) error {
  1395  	c.ctx_ = ctx
  1396  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  1397  	for {
  1398  		x, err := c.Do()
  1399  		if err != nil {
  1400  			return err
  1401  		}
  1402  		if err := f(x); err != nil {
  1403  			return err
  1404  		}
  1405  		if x.NextPageToken == "" {
  1406  			return nil
  1407  		}
  1408  		c.PageToken(x.NextPageToken)
  1409  	}
  1410  }
  1411  
  1412  type ProjectsLocationsPipelinesPatchCall struct {
  1413  	s                                  *Service
  1414  	name                               string
  1415  	googleclouddatapipelinesv1pipeline *GoogleCloudDatapipelinesV1Pipeline
  1416  	urlParams_                         gensupport.URLParams
  1417  	ctx_                               context.Context
  1418  	header_                            http.Header
  1419  }
  1420  
  1421  // Patch: Updates a pipeline. If successful, the updated Pipeline is returned.
  1422  // Returns `NOT_FOUND` if the pipeline doesn't exist. If UpdatePipeline does
  1423  // not return successfully, you can retry the UpdatePipeline request until you
  1424  // receive a successful response.
  1425  //
  1426  //   - name: The pipeline name. For example:
  1427  //     `projects/PROJECT_ID/locations/LOCATION_ID/pipelines/PIPELINE_ID`. *
  1428  //     `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), hyphens (-),
  1429  //     colons (:), and periods (.). For more information, see Identifying
  1430  //     projects
  1431  //     (https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects).
  1432  //   - `LOCATION_ID` is the canonical ID for the pipeline's location. The list
  1433  //     of available locations can be obtained by calling
  1434  //     `google.cloud.location.Locations.ListLocations`. Note that the Data
  1435  //     Pipelines service is not available in all regions. It depends on Cloud
  1436  //     Scheduler, an App Engine application, so it's only available in App Engine
  1437  //     regions (https://cloud.google.com/about/locations#region). * `PIPELINE_ID`
  1438  //     is the ID of the pipeline. Must be unique for the selected project and
  1439  //     location.
  1440  func (r *ProjectsLocationsPipelinesService) Patch(name string, googleclouddatapipelinesv1pipeline *GoogleCloudDatapipelinesV1Pipeline) *ProjectsLocationsPipelinesPatchCall {
  1441  	c := &ProjectsLocationsPipelinesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1442  	c.name = name
  1443  	c.googleclouddatapipelinesv1pipeline = googleclouddatapipelinesv1pipeline
  1444  	return c
  1445  }
  1446  
  1447  // UpdateMask sets the optional parameter "updateMask": The list of fields to
  1448  // be updated.
  1449  func (c *ProjectsLocationsPipelinesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsPipelinesPatchCall {
  1450  	c.urlParams_.Set("updateMask", updateMask)
  1451  	return c
  1452  }
  1453  
  1454  // Fields allows partial responses to be retrieved. See
  1455  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1456  // details.
  1457  func (c *ProjectsLocationsPipelinesPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsPipelinesPatchCall {
  1458  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1459  	return c
  1460  }
  1461  
  1462  // Context sets the context to be used in this call's Do method.
  1463  func (c *ProjectsLocationsPipelinesPatchCall) Context(ctx context.Context) *ProjectsLocationsPipelinesPatchCall {
  1464  	c.ctx_ = ctx
  1465  	return c
  1466  }
  1467  
  1468  // Header returns a http.Header that can be modified by the caller to add
  1469  // headers to the request.
  1470  func (c *ProjectsLocationsPipelinesPatchCall) Header() http.Header {
  1471  	if c.header_ == nil {
  1472  		c.header_ = make(http.Header)
  1473  	}
  1474  	return c.header_
  1475  }
  1476  
  1477  func (c *ProjectsLocationsPipelinesPatchCall) doRequest(alt string) (*http.Response, error) {
  1478  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1479  	var body io.Reader = nil
  1480  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddatapipelinesv1pipeline)
  1481  	if err != nil {
  1482  		return nil, err
  1483  	}
  1484  	c.urlParams_.Set("alt", alt)
  1485  	c.urlParams_.Set("prettyPrint", "false")
  1486  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  1487  	urls += "?" + c.urlParams_.Encode()
  1488  	req, err := http.NewRequest("PATCH", urls, body)
  1489  	if err != nil {
  1490  		return nil, err
  1491  	}
  1492  	req.Header = reqHeaders
  1493  	googleapi.Expand(req.URL, map[string]string{
  1494  		"name": c.name,
  1495  	})
  1496  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1497  }
  1498  
  1499  // Do executes the "datapipelines.projects.locations.pipelines.patch" call.
  1500  // Any non-2xx status code is an error. Response headers are in either
  1501  // *GoogleCloudDatapipelinesV1Pipeline.ServerResponse.Header or (if a response
  1502  // was returned at all) in error.(*googleapi.Error).Header. Use
  1503  // googleapi.IsNotModified to check whether the returned error was because
  1504  // http.StatusNotModified was returned.
  1505  func (c *ProjectsLocationsPipelinesPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDatapipelinesV1Pipeline, error) {
  1506  	gensupport.SetOptions(c.urlParams_, opts...)
  1507  	res, err := c.doRequest("json")
  1508  	if res != nil && res.StatusCode == http.StatusNotModified {
  1509  		if res.Body != nil {
  1510  			res.Body.Close()
  1511  		}
  1512  		return nil, gensupport.WrapError(&googleapi.Error{
  1513  			Code:   res.StatusCode,
  1514  			Header: res.Header,
  1515  		})
  1516  	}
  1517  	if err != nil {
  1518  		return nil, err
  1519  	}
  1520  	defer googleapi.CloseBody(res)
  1521  	if err := googleapi.CheckResponse(res); err != nil {
  1522  		return nil, gensupport.WrapError(err)
  1523  	}
  1524  	ret := &GoogleCloudDatapipelinesV1Pipeline{
  1525  		ServerResponse: googleapi.ServerResponse{
  1526  			Header:         res.Header,
  1527  			HTTPStatusCode: res.StatusCode,
  1528  		},
  1529  	}
  1530  	target := &ret
  1531  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1532  		return nil, err
  1533  	}
  1534  	return ret, nil
  1535  }
  1536  
  1537  type ProjectsLocationsPipelinesRunCall struct {
  1538  	s                                            *Service
  1539  	name                                         string
  1540  	googleclouddatapipelinesv1runpipelinerequest *GoogleCloudDatapipelinesV1RunPipelineRequest
  1541  	urlParams_                                   gensupport.URLParams
  1542  	ctx_                                         context.Context
  1543  	header_                                      http.Header
  1544  }
  1545  
  1546  // Run: Creates a job for the specified pipeline directly. You can use this
  1547  // method when the internal scheduler is not configured and you want to trigger
  1548  // the job directly or through an external system. Returns a "NOT_FOUND" error
  1549  // if the pipeline doesn't exist. Returns a "FORBIDDEN" error if the user
  1550  // doesn't have permission to access the pipeline or run jobs for the pipeline.
  1551  //
  1552  //   - name: The pipeline name. For example:
  1553  //     `projects/PROJECT_ID/locations/LOCATION_ID/pipelines/PIPELINE_ID`.
  1554  func (r *ProjectsLocationsPipelinesService) Run(name string, googleclouddatapipelinesv1runpipelinerequest *GoogleCloudDatapipelinesV1RunPipelineRequest) *ProjectsLocationsPipelinesRunCall {
  1555  	c := &ProjectsLocationsPipelinesRunCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1556  	c.name = name
  1557  	c.googleclouddatapipelinesv1runpipelinerequest = googleclouddatapipelinesv1runpipelinerequest
  1558  	return c
  1559  }
  1560  
  1561  // Fields allows partial responses to be retrieved. See
  1562  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1563  // details.
  1564  func (c *ProjectsLocationsPipelinesRunCall) Fields(s ...googleapi.Field) *ProjectsLocationsPipelinesRunCall {
  1565  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1566  	return c
  1567  }
  1568  
  1569  // Context sets the context to be used in this call's Do method.
  1570  func (c *ProjectsLocationsPipelinesRunCall) Context(ctx context.Context) *ProjectsLocationsPipelinesRunCall {
  1571  	c.ctx_ = ctx
  1572  	return c
  1573  }
  1574  
  1575  // Header returns a http.Header that can be modified by the caller to add
  1576  // headers to the request.
  1577  func (c *ProjectsLocationsPipelinesRunCall) Header() http.Header {
  1578  	if c.header_ == nil {
  1579  		c.header_ = make(http.Header)
  1580  	}
  1581  	return c.header_
  1582  }
  1583  
  1584  func (c *ProjectsLocationsPipelinesRunCall) doRequest(alt string) (*http.Response, error) {
  1585  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1586  	var body io.Reader = nil
  1587  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddatapipelinesv1runpipelinerequest)
  1588  	if err != nil {
  1589  		return nil, err
  1590  	}
  1591  	c.urlParams_.Set("alt", alt)
  1592  	c.urlParams_.Set("prettyPrint", "false")
  1593  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:run")
  1594  	urls += "?" + c.urlParams_.Encode()
  1595  	req, err := http.NewRequest("POST", urls, body)
  1596  	if err != nil {
  1597  		return nil, err
  1598  	}
  1599  	req.Header = reqHeaders
  1600  	googleapi.Expand(req.URL, map[string]string{
  1601  		"name": c.name,
  1602  	})
  1603  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1604  }
  1605  
  1606  // Do executes the "datapipelines.projects.locations.pipelines.run" call.
  1607  // Any non-2xx status code is an error. Response headers are in either
  1608  // *GoogleCloudDatapipelinesV1RunPipelineResponse.ServerResponse.Header or (if
  1609  // a response was returned at all) in error.(*googleapi.Error).Header. Use
  1610  // googleapi.IsNotModified to check whether the returned error was because
  1611  // http.StatusNotModified was returned.
  1612  func (c *ProjectsLocationsPipelinesRunCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDatapipelinesV1RunPipelineResponse, error) {
  1613  	gensupport.SetOptions(c.urlParams_, opts...)
  1614  	res, err := c.doRequest("json")
  1615  	if res != nil && res.StatusCode == http.StatusNotModified {
  1616  		if res.Body != nil {
  1617  			res.Body.Close()
  1618  		}
  1619  		return nil, gensupport.WrapError(&googleapi.Error{
  1620  			Code:   res.StatusCode,
  1621  			Header: res.Header,
  1622  		})
  1623  	}
  1624  	if err != nil {
  1625  		return nil, err
  1626  	}
  1627  	defer googleapi.CloseBody(res)
  1628  	if err := googleapi.CheckResponse(res); err != nil {
  1629  		return nil, gensupport.WrapError(err)
  1630  	}
  1631  	ret := &GoogleCloudDatapipelinesV1RunPipelineResponse{
  1632  		ServerResponse: googleapi.ServerResponse{
  1633  			Header:         res.Header,
  1634  			HTTPStatusCode: res.StatusCode,
  1635  		},
  1636  	}
  1637  	target := &ret
  1638  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1639  		return nil, err
  1640  	}
  1641  	return ret, nil
  1642  }
  1643  
  1644  type ProjectsLocationsPipelinesStopCall struct {
  1645  	s                                             *Service
  1646  	name                                          string
  1647  	googleclouddatapipelinesv1stoppipelinerequest *GoogleCloudDatapipelinesV1StopPipelineRequest
  1648  	urlParams_                                    gensupport.URLParams
  1649  	ctx_                                          context.Context
  1650  	header_                                       http.Header
  1651  }
  1652  
  1653  // Stop: Freezes pipeline execution permanently. If there's a corresponding
  1654  // scheduler entry, it's deleted, and the pipeline state is changed to
  1655  // "ARCHIVED". However, pipeline metadata is retained.
  1656  //
  1657  //   - name: The pipeline name. For example:
  1658  //     `projects/PROJECT_ID/locations/LOCATION_ID/pipelines/PIPELINE_ID`.
  1659  func (r *ProjectsLocationsPipelinesService) Stop(name string, googleclouddatapipelinesv1stoppipelinerequest *GoogleCloudDatapipelinesV1StopPipelineRequest) *ProjectsLocationsPipelinesStopCall {
  1660  	c := &ProjectsLocationsPipelinesStopCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1661  	c.name = name
  1662  	c.googleclouddatapipelinesv1stoppipelinerequest = googleclouddatapipelinesv1stoppipelinerequest
  1663  	return c
  1664  }
  1665  
  1666  // Fields allows partial responses to be retrieved. See
  1667  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1668  // details.
  1669  func (c *ProjectsLocationsPipelinesStopCall) Fields(s ...googleapi.Field) *ProjectsLocationsPipelinesStopCall {
  1670  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1671  	return c
  1672  }
  1673  
  1674  // Context sets the context to be used in this call's Do method.
  1675  func (c *ProjectsLocationsPipelinesStopCall) Context(ctx context.Context) *ProjectsLocationsPipelinesStopCall {
  1676  	c.ctx_ = ctx
  1677  	return c
  1678  }
  1679  
  1680  // Header returns a http.Header that can be modified by the caller to add
  1681  // headers to the request.
  1682  func (c *ProjectsLocationsPipelinesStopCall) Header() http.Header {
  1683  	if c.header_ == nil {
  1684  		c.header_ = make(http.Header)
  1685  	}
  1686  	return c.header_
  1687  }
  1688  
  1689  func (c *ProjectsLocationsPipelinesStopCall) doRequest(alt string) (*http.Response, error) {
  1690  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1691  	var body io.Reader = nil
  1692  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddatapipelinesv1stoppipelinerequest)
  1693  	if err != nil {
  1694  		return nil, err
  1695  	}
  1696  	c.urlParams_.Set("alt", alt)
  1697  	c.urlParams_.Set("prettyPrint", "false")
  1698  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:stop")
  1699  	urls += "?" + c.urlParams_.Encode()
  1700  	req, err := http.NewRequest("POST", urls, body)
  1701  	if err != nil {
  1702  		return nil, err
  1703  	}
  1704  	req.Header = reqHeaders
  1705  	googleapi.Expand(req.URL, map[string]string{
  1706  		"name": c.name,
  1707  	})
  1708  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1709  }
  1710  
  1711  // Do executes the "datapipelines.projects.locations.pipelines.stop" call.
  1712  // Any non-2xx status code is an error. Response headers are in either
  1713  // *GoogleCloudDatapipelinesV1Pipeline.ServerResponse.Header or (if a response
  1714  // was returned at all) in error.(*googleapi.Error).Header. Use
  1715  // googleapi.IsNotModified to check whether the returned error was because
  1716  // http.StatusNotModified was returned.
  1717  func (c *ProjectsLocationsPipelinesStopCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDatapipelinesV1Pipeline, error) {
  1718  	gensupport.SetOptions(c.urlParams_, opts...)
  1719  	res, err := c.doRequest("json")
  1720  	if res != nil && res.StatusCode == http.StatusNotModified {
  1721  		if res.Body != nil {
  1722  			res.Body.Close()
  1723  		}
  1724  		return nil, gensupport.WrapError(&googleapi.Error{
  1725  			Code:   res.StatusCode,
  1726  			Header: res.Header,
  1727  		})
  1728  	}
  1729  	if err != nil {
  1730  		return nil, err
  1731  	}
  1732  	defer googleapi.CloseBody(res)
  1733  	if err := googleapi.CheckResponse(res); err != nil {
  1734  		return nil, gensupport.WrapError(err)
  1735  	}
  1736  	ret := &GoogleCloudDatapipelinesV1Pipeline{
  1737  		ServerResponse: googleapi.ServerResponse{
  1738  			Header:         res.Header,
  1739  			HTTPStatusCode: res.StatusCode,
  1740  		},
  1741  	}
  1742  	target := &ret
  1743  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1744  		return nil, err
  1745  	}
  1746  	return ret, nil
  1747  }
  1748  
  1749  type ProjectsLocationsPipelinesJobsListCall struct {
  1750  	s            *Service
  1751  	parent       string
  1752  	urlParams_   gensupport.URLParams
  1753  	ifNoneMatch_ string
  1754  	ctx_         context.Context
  1755  	header_      http.Header
  1756  }
  1757  
  1758  // List: Lists jobs for a given pipeline. Throws a "FORBIDDEN" error if the
  1759  // caller doesn't have permission to access it.
  1760  //
  1761  //   - parent: The pipeline name. For example:
  1762  //     `projects/PROJECT_ID/locations/LOCATION_ID/pipelines/PIPELINE_ID`.
  1763  func (r *ProjectsLocationsPipelinesJobsService) List(parent string) *ProjectsLocationsPipelinesJobsListCall {
  1764  	c := &ProjectsLocationsPipelinesJobsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1765  	c.parent = parent
  1766  	return c
  1767  }
  1768  
  1769  // PageSize sets the optional parameter "pageSize": The maximum number of
  1770  // entities to return. The service may return fewer than this value, even if
  1771  // there are additional pages. If unspecified, the max limit will be determined
  1772  // by the backend implementation.
  1773  func (c *ProjectsLocationsPipelinesJobsListCall) PageSize(pageSize int64) *ProjectsLocationsPipelinesJobsListCall {
  1774  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  1775  	return c
  1776  }
  1777  
  1778  // PageToken sets the optional parameter "pageToken": A page token, received
  1779  // from a previous `ListJobs` call. Provide this to retrieve the subsequent
  1780  // page. When paginating, all other parameters provided to `ListJobs` must
  1781  // match the call that provided the page token.
  1782  func (c *ProjectsLocationsPipelinesJobsListCall) PageToken(pageToken string) *ProjectsLocationsPipelinesJobsListCall {
  1783  	c.urlParams_.Set("pageToken", pageToken)
  1784  	return c
  1785  }
  1786  
  1787  // Fields allows partial responses to be retrieved. See
  1788  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1789  // details.
  1790  func (c *ProjectsLocationsPipelinesJobsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsPipelinesJobsListCall {
  1791  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1792  	return c
  1793  }
  1794  
  1795  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1796  // object's ETag matches the given value. This is useful for getting updates
  1797  // only after the object has changed since the last request.
  1798  func (c *ProjectsLocationsPipelinesJobsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsPipelinesJobsListCall {
  1799  	c.ifNoneMatch_ = entityTag
  1800  	return c
  1801  }
  1802  
  1803  // Context sets the context to be used in this call's Do method.
  1804  func (c *ProjectsLocationsPipelinesJobsListCall) Context(ctx context.Context) *ProjectsLocationsPipelinesJobsListCall {
  1805  	c.ctx_ = ctx
  1806  	return c
  1807  }
  1808  
  1809  // Header returns a http.Header that can be modified by the caller to add
  1810  // headers to the request.
  1811  func (c *ProjectsLocationsPipelinesJobsListCall) Header() http.Header {
  1812  	if c.header_ == nil {
  1813  		c.header_ = make(http.Header)
  1814  	}
  1815  	return c.header_
  1816  }
  1817  
  1818  func (c *ProjectsLocationsPipelinesJobsListCall) doRequest(alt string) (*http.Response, error) {
  1819  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1820  	if c.ifNoneMatch_ != "" {
  1821  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1822  	}
  1823  	var body io.Reader = nil
  1824  	c.urlParams_.Set("alt", alt)
  1825  	c.urlParams_.Set("prettyPrint", "false")
  1826  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/jobs")
  1827  	urls += "?" + c.urlParams_.Encode()
  1828  	req, err := http.NewRequest("GET", urls, body)
  1829  	if err != nil {
  1830  		return nil, err
  1831  	}
  1832  	req.Header = reqHeaders
  1833  	googleapi.Expand(req.URL, map[string]string{
  1834  		"parent": c.parent,
  1835  	})
  1836  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1837  }
  1838  
  1839  // Do executes the "datapipelines.projects.locations.pipelines.jobs.list" call.
  1840  // Any non-2xx status code is an error. Response headers are in either
  1841  // *GoogleCloudDatapipelinesV1ListJobsResponse.ServerResponse.Header or (if a
  1842  // response was returned at all) in error.(*googleapi.Error).Header. Use
  1843  // googleapi.IsNotModified to check whether the returned error was because
  1844  // http.StatusNotModified was returned.
  1845  func (c *ProjectsLocationsPipelinesJobsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDatapipelinesV1ListJobsResponse, error) {
  1846  	gensupport.SetOptions(c.urlParams_, opts...)
  1847  	res, err := c.doRequest("json")
  1848  	if res != nil && res.StatusCode == http.StatusNotModified {
  1849  		if res.Body != nil {
  1850  			res.Body.Close()
  1851  		}
  1852  		return nil, gensupport.WrapError(&googleapi.Error{
  1853  			Code:   res.StatusCode,
  1854  			Header: res.Header,
  1855  		})
  1856  	}
  1857  	if err != nil {
  1858  		return nil, err
  1859  	}
  1860  	defer googleapi.CloseBody(res)
  1861  	if err := googleapi.CheckResponse(res); err != nil {
  1862  		return nil, gensupport.WrapError(err)
  1863  	}
  1864  	ret := &GoogleCloudDatapipelinesV1ListJobsResponse{
  1865  		ServerResponse: googleapi.ServerResponse{
  1866  			Header:         res.Header,
  1867  			HTTPStatusCode: res.StatusCode,
  1868  		},
  1869  	}
  1870  	target := &ret
  1871  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1872  		return nil, err
  1873  	}
  1874  	return ret, nil
  1875  }
  1876  
  1877  // Pages invokes f for each page of results.
  1878  // A non-nil error returned from f will halt the iteration.
  1879  // The provided context supersedes any context provided to the Context method.
  1880  func (c *ProjectsLocationsPipelinesJobsListCall) Pages(ctx context.Context, f func(*GoogleCloudDatapipelinesV1ListJobsResponse) error) error {
  1881  	c.ctx_ = ctx
  1882  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  1883  	for {
  1884  		x, err := c.Do()
  1885  		if err != nil {
  1886  			return err
  1887  		}
  1888  		if err := f(x); err != nil {
  1889  			return err
  1890  		}
  1891  		if x.NextPageToken == "" {
  1892  			return nil
  1893  		}
  1894  		c.PageToken(x.NextPageToken)
  1895  	}
  1896  }
  1897  

View as plain text