| // Copyright 2026 Google LLC. | |
| // Use of this source code is governed by a BSD-style | |
| // license that can be found in the LICENSE file. | |
| // Code generated file. DO NOT EDIT. | |
| // Package cloudscheduler provides access to the Cloud Scheduler API. | |
| // | |
| // For product documentation, see: https://cloud.google.com/scheduler/ | |
| // | |
| // # Library status | |
| // | |
| // These client libraries are officially supported by Google. However, this | |
| // library is considered complete and is in maintenance mode. This means | |
| // that we will address critical bugs and security issues but will not add | |
| // any new features. | |
| // | |
| // When possible, we recommend using our newer | |
| // [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go) | |
| // that are still actively being worked and iterated on. | |
| // | |
| // # Creating a client | |
| // | |
| // Usage example: | |
| // | |
| // import "google.golang.org/api/cloudscheduler/v1" | |
| // ... | |
| // ctx := context.Background() | |
| // cloudschedulerService, err := cloudscheduler.NewService(ctx) | |
| // | |
| // In this example, Google Application Default Credentials are used for | |
| // authentication. For information on how to create and obtain Application | |
| // Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. | |
| // | |
| // # Other authentication options | |
| // | |
| // To use an API key for authentication (note: some APIs do not support API | |
| // keys), use [google.golang.org/api/option.WithAPIKey]: | |
| // | |
| // cloudschedulerService, err := cloudscheduler.NewService(ctx, option.WithAPIKey("AIza...")) | |
| // | |
| // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth | |
| // flow, use [google.golang.org/api/option.WithTokenSource]: | |
| // | |
| // config := &oauth2.Config{...} | |
| // // ... | |
| // token, err := config.Exchange(ctx, ...) | |
| // cloudschedulerService, err := cloudscheduler.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) | |
| // | |
| // See [google.golang.org/api/option.ClientOption] for details on options. | |
| package cloudscheduler // import "google.golang.org/api/cloudscheduler/v1" | |
| import ( | |
| "bytes" | |
| "context" | |
| "encoding/json" | |
| "errors" | |
| "fmt" | |
| "io" | |
| "log/slog" | |
| "net/http" | |
| "net/url" | |
| "strconv" | |
| "strings" | |
| "github.com/googleapis/gax-go/v2/internallog" | |
| googleapi "google.golang.org/api/googleapi" | |
| internal "google.golang.org/api/internal" | |
| gensupport "google.golang.org/api/internal/gensupport" | |
| option "google.golang.org/api/option" | |
| internaloption "google.golang.org/api/option/internaloption" | |
| htransport "google.golang.org/api/transport/http" | |
| ) | |
| // Always reference these packages, just in case the auto-generated code | |
| // below doesn't. | |
| var _ = bytes.NewBuffer | |
| var _ = strconv.Itoa | |
| var _ = fmt.Sprintf | |
| var _ = json.NewDecoder | |
| var _ = io.Copy | |
| var _ = url.Parse | |
| var _ = gensupport.MarshalJSON | |
| var _ = googleapi.Version | |
| var _ = errors.New | |
| var _ = strings.Replace | |
| var _ = context.Canceled | |
| var _ = internaloption.WithDefaultEndpoint | |
| var _ = internal.Version | |
| var _ = internallog.New | |
| const apiId = "cloudscheduler:v1" | |
| const apiName = "cloudscheduler" | |
| const apiVersion = "v1" | |
| const basePath = "https://cloudscheduler.googleapis.com/" | |
| const basePathTemplate = "https://cloudscheduler.UNIVERSE_DOMAIN/" | |
| const mtlsBasePath = "https://cloudscheduler.mtls.googleapis.com/" | |
| // OAuth2 scopes used by this API. | |
| const ( | |
| // See, edit, configure, and delete your Google Cloud data and see the email | |
| // address for your Google Account. | |
| CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" | |
| ) | |
| // NewService creates a new Service. | |
| func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { | |
| scopesOption := internaloption.WithDefaultScopes( | |
| "https://www.googleapis.com/auth/cloud-platform", | |
| ) | |
| // NOTE: prepend, so we don't override user-specified scopes. | |
| opts = append([]option.ClientOption{scopesOption}, opts...) | |
| opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) | |
| opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate)) | |
| opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) | |
| opts = append(opts, internaloption.EnableNewAuthLibrary()) | |
| client, endpoint, err := htransport.NewClient(ctx, opts...) | |
| if err != nil { | |
| return nil, err | |
| } | |
| s := &Service{client: client, BasePath: basePath, logger: internaloption.GetLogger(opts)} | |
| s.Projects = NewProjectsService(s) | |
| if endpoint != "" { | |
| s.BasePath = endpoint | |
| } | |
| return s, nil | |
| } | |
| // New creates a new Service. It uses the provided http.Client for requests. | |
| // | |
| // Deprecated: please use NewService instead. | |
| // To provide a custom HTTP client, use option.WithHTTPClient. | |
| // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. | |
| func New(client *http.Client) (*Service, error) { | |
| if client == nil { | |
| return nil, errors.New("client is nil") | |
| } | |
| return NewService(context.TODO(), option.WithHTTPClient(client)) | |
| } | |
| type Service struct { | |
| client *http.Client | |
| logger *slog.Logger | |
| BasePath string // API endpoint base URL | |
| UserAgent string // optional additional User-Agent fragment | |
| Projects *ProjectsService | |
| } | |
| func (s *Service) userAgent() string { | |
| if s.UserAgent == "" { | |
| return googleapi.UserAgent | |
| } | |
| return googleapi.UserAgent + " " + s.UserAgent | |
| } | |
| func NewProjectsService(s *Service) *ProjectsService { | |
| rs := &ProjectsService{s: s} | |
| rs.Locations = NewProjectsLocationsService(s) | |
| return rs | |
| } | |
| type ProjectsService struct { | |
| s *Service | |
| Locations *ProjectsLocationsService | |
| } | |
| func NewProjectsLocationsService(s *Service) *ProjectsLocationsService { | |
| rs := &ProjectsLocationsService{s: s} | |
| rs.Jobs = NewProjectsLocationsJobsService(s) | |
| rs.Operations = NewProjectsLocationsOperationsService(s) | |
| return rs | |
| } | |
| type ProjectsLocationsService struct { | |
| s *Service | |
| Jobs *ProjectsLocationsJobsService | |
| Operations *ProjectsLocationsOperationsService | |
| } | |
| func NewProjectsLocationsJobsService(s *Service) *ProjectsLocationsJobsService { | |
| rs := &ProjectsLocationsJobsService{s: s} | |
| return rs | |
| } | |
| type ProjectsLocationsJobsService struct { | |
| s *Service | |
| } | |
| func NewProjectsLocationsOperationsService(s *Service) *ProjectsLocationsOperationsService { | |
| rs := &ProjectsLocationsOperationsService{s: s} | |
| return rs | |
| } | |
| type ProjectsLocationsOperationsService struct { | |
| s *Service | |
| } | |
| // AppEngineHttpTarget: App Engine target. The job will be pushed to a job | |
| // handler by means of an HTTP request via an http_method such as HTTP POST, | |
| // HTTP GET, etc. The job is acknowledged by means of an HTTP response code in | |
| // the range [200 - 299]. Error 503 is considered an App Engine system error | |
| // instead of an application error. Requests returning error 503 will be | |
| // retried regardless of retry configuration and not counted against retry | |
| // counts. Any other response code, or a failure to receive a response before | |
| // the deadline, constitutes a failed attempt. | |
| type AppEngineHttpTarget struct { | |
| // AppEngineRouting: App Engine Routing setting for the job. | |
| AppEngineRouting *AppEngineRouting `json:"appEngineRouting,omitempty"` | |
| // Body: Body. HTTP request body. A request body is allowed only if the HTTP | |
| // method is POST or PUT. It will result in invalid argument error to set a | |
| // body on a job with an incompatible HttpMethod. | |
| Body string `json:"body,omitempty"` | |
| // Headers: HTTP request headers. This map contains the header field names and | |
| // values. Headers can be set when the job is created. Cloud Scheduler sets | |
| // some headers to default values: * `User-Agent`: By default, this header is | |
| // "AppEngine-Google; (+http://code.google.com/appengine)". This header can | |
| // be modified, but Cloud Scheduler will append "AppEngine-Google; | |
| // (+http://code.google.com/appengine)" to the modified `User-Agent`. * | |
| // `X-CloudScheduler`: This header will be set to true. * | |
| // `X-CloudScheduler-JobName`: This header will contain the job name. * | |
| // `X-CloudScheduler-ScheduleTime`: For Cloud Scheduler jobs specified in the | |
| // unix-cron format, this header will contain the job schedule as an offset of | |
| // UTC parsed according to RFC3339. Remains constant across retries and can be | |
| // used for job request deduplication | |
| // (https://docs.cloud.google.com/scheduler/docs/overview#job-deduplication). | |
| // If the job has a body and the following headers are not set by the user, | |
| // Cloud Scheduler sets default values: * `Content-Type`: This will be set to | |
| // "application/octet-stream". You can override this default by explicitly | |
| // setting `Content-Type` to a particular media type when creating the job. For | |
| // example, you can set `Content-Type` to "application/json". The headers | |
| // below are output only. They cannot be set or overridden: * `Content-Length`: | |
| // This is computed by Cloud Scheduler. * `X-Google-*`: For Google internal use | |
| // only. * `X-AppEngine-*`: For Google internal use only. In addition, some App | |
| // Engine headers, which contain job-specific information, are also be sent to | |
| // the job handler. | |
| Headers map[string]string `json:"headers,omitempty"` | |
| // HttpMethod: The HTTP method to use for the request. PATCH and OPTIONS are | |
| // not permitted. | |
| // | |
| // Possible values: | |
| // "HTTP_METHOD_UNSPECIFIED" - HTTP method unspecified. Defaults to POST. | |
| // "POST" - HTTP POST | |
| // "GET" - HTTP GET | |
| // "HEAD" - HTTP HEAD | |
| // "PUT" - HTTP PUT | |
| // "DELETE" - HTTP DELETE | |
| // "PATCH" - HTTP PATCH | |
| // "OPTIONS" - HTTP OPTIONS | |
| HttpMethod string `json:"httpMethod,omitempty"` | |
| // RelativeUri: The relative URI. The relative URL must begin with "/" and must | |
| // be a valid HTTP relative URL. It can contain a path, query string arguments, | |
| // and `#` fragments. If the relative URL is empty, then the root path "/" will | |
| // be used. No spaces are allowed, and the maximum length allowed is 2083 | |
| // characters. | |
| RelativeUri string `json:"relativeUri,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "AppEngineRouting") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "AppEngineRouting") to include in | |
| // API requests with the JSON null value. By default, fields with empty values | |
| // are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s AppEngineHttpTarget) MarshalJSON() ([]byte, error) { | |
| type NoMethod AppEngineHttpTarget | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // AppEngineRouting: App Engine Routing. For more information about services, | |
| // versions, and instances see An Overview of App Engine | |
| // (https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine), | |
| // Microservices Architecture on Google App Engine | |
| // (https://cloud.google.com/appengine/docs/python/microservices-on-app-engine), | |
| // App Engine Standard request routing | |
| // (https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed), | |
| // and App Engine Flex request routing | |
| // (https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). | |
| type AppEngineRouting struct { | |
| // Host: Output only. The host that the job is sent to. For more information | |
| // about how App Engine requests are routed, see here | |
| // (https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed). | |
| // The host is constructed as: * `host = [application_domain_name]` `| | |
| // [service] + '.' + [application_domain_name]` `| [version] + '.' + | |
| // [application_domain_name]` `| [version_dot_service]+ '.' + | |
| // [application_domain_name]` `| [instance] + '.' + [application_domain_name]` | |
| // `| [instance_dot_service] + '.' + [application_domain_name]` `| | |
| // [instance_dot_version] + '.' + [application_domain_name]` `| | |
| // [instance_dot_version_dot_service] + '.' + [application_domain_name]` * | |
| // `application_domain_name` = The domain name of the app, for example | |
| // .appspot.com, which is associated with the job's project ID. * `service =` | |
| // service * `version =` version * `version_dot_service =` version `+ '.' +` | |
| // service * `instance =` instance * `instance_dot_service =` instance `+ '.' | |
| // +` service * `instance_dot_version =` instance `+ '.' +` version * | |
| // `instance_dot_version_dot_service =` instance `+ '.' +` version `+ '.' +` | |
| // service If service is empty, then the job will be sent to the service which | |
| // is the default service when the job is attempted. If version is empty, then | |
| // the job will be sent to the version which is the default version when the | |
| // job is attempted. If instance is empty, then the job will be sent to an | |
| // instance which is available when the job is attempted. If service, version, | |
| // or instance is invalid, then the job will be sent to the default version of | |
| // the default service when the job is attempted. | |
| Host string `json:"host,omitempty"` | |
| // Instance: App instance. By default, the job is sent to an instance which is | |
| // available when the job is attempted. Requests can only be sent to a specific | |
| // instance if manual scaling is used in App Engine Standard | |
| // (https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?#scaling_types_and_instance_classes). | |
| // App Engine Flex does not support instances. For more information, see App | |
| // Engine Standard request routing | |
| // (https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) | |
| // and App Engine Flex request routing | |
| // (https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). | |
| Instance string `json:"instance,omitempty"` | |
| // Service: App service. By default, the job is sent to the service which is | |
| // the default service when the job is attempted. | |
| Service string `json:"service,omitempty"` | |
| // Version: App version. By default, the job is sent to the version which is | |
| // the default version when the job is attempted. | |
| Version string `json:"version,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "Host") to unconditionally | |
| // include in API requests. By default, fields with empty or default values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "Host") to include in API requests | |
| // with the JSON null value. By default, fields with empty values are omitted | |
| // from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s AppEngineRouting) MarshalJSON() ([]byte, error) { | |
| type NoMethod AppEngineRouting | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // CancelOperationRequest: The request message for Operations.CancelOperation. | |
| type CancelOperationRequest struct { | |
| } | |
| // CmekConfig: Describes the project/location configuration of Cloud Scheduler | |
| // Resources. | |
| type CmekConfig struct { | |
| // KmsKeyName: Optional. Resource name of the Cloud KMS key, of the form | |
| // `projects/PROJECT_ID/locations/LOCATION_ID/keyRings/KEY_RING_ID/cryptoKeys/KE | |
| // Y_ID`, that will be used to encrypt Jobs in the region. Setting this as | |
| // blank will turn off CMEK encryption. | |
| KmsKeyName string `json:"kmsKeyName,omitempty"` | |
| // Name: Identifier. The config resource name which includes the project and | |
| // location and must end in 'cmekConfig', in the format | |
| // projects/PROJECT_ID/locations/LOCATION_ID/cmekConfig` | |
| Name string `json:"name,omitempty"` | |
| // ServerResponse contains the HTTP response code and headers from the server. | |
| googleapi.ServerResponse `json:"-"` | |
| // ForceSendFields is a list of field names (e.g. "KmsKeyName") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "KmsKeyName") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s CmekConfig) MarshalJSON() ([]byte, error) { | |
| type NoMethod CmekConfig | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // Empty: A generic empty message that you can re-use to avoid defining | |
| // duplicated empty messages in your APIs. A typical example is to use it as | |
| // the request or the response type of an API method. For instance: service Foo | |
| // { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } | |
| type Empty struct { | |
| // ServerResponse contains the HTTP response code and headers from the server. | |
| googleapi.ServerResponse `json:"-"` | |
| } | |
| // HttpTarget: Http target. The job will be pushed to the job handler by means | |
| // of an HTTP request via an http_method such as HTTP POST, HTTP GET, etc. The | |
| // job is acknowledged by means of an HTTP response code in the range [200 - | |
| // 299]. A failure to receive a response constitutes a failed execution. For a | |
| // redirected request, the response returned by the redirected request is | |
| // considered. | |
| type HttpTarget struct { | |
| // Body: HTTP request body. A request body is allowed only if the HTTP method | |
| // is POST, PUT, or PATCH. It is an error to set body on a job with an | |
| // incompatible HttpMethod. | |
| Body string `json:"body,omitempty"` | |
| // Headers: HTTP request headers. This map contains the header field names and | |
| // values. The user can specify HTTP request headers to send with the job's | |
| // HTTP request. Repeated headers are not supported, but a header value can | |
| // contain commas. The following headers represent a subset of the headers that | |
| // accompany the job's HTTP request. Some HTTP request headers are ignored or | |
| // replaced. A partial list of headers that are ignored or replaced is below: * | |
| // Host: This will be computed by Cloud Scheduler and derived from uri. * | |
| // `Content-Length`: This will be computed by Cloud Scheduler. * `User-Agent`: | |
| // This will be set to "Google-Cloud-Scheduler". * `X-Google-*`: Used | |
| // internally by Google. If present in an external user request, it is replaced | |
| // by the internal header. * `X-AppEngine-*`: Used internally by Google. If | |
| // present in an external user request, it is replaced by the internal header. | |
| // * `X-CloudScheduler`: This header will be set to true. * | |
| // `X-CloudScheduler-JobName`: This header will contain the job name. * | |
| // `X-CloudScheduler-ScheduleTime`: For Cloud Scheduler jobs specified in the | |
| // unix-cron format, this header will contain the job schedule as an offset of | |
| // UTC parsed according to RFC3339. Remains constant across retries and can be | |
| // used for job request deduplication | |
| // (https://docs.cloud.google.com/scheduler/docs/overview#job-deduplication). | |
| // If the job has a body and the following headers are not set by the user, | |
| // Cloud Scheduler sets default values: * `Content-Type`: This will be set to | |
| // "application/octet-stream". You can override this default by explicitly | |
| // setting `Content-Type` to a particular media type when creating the job. For | |
| // example, you can set `Content-Type` to "application/json". The total size | |
| // of headers must be less than 80KB. | |
| Headers map[string]string `json:"headers,omitempty"` | |
| // HttpMethod: Which HTTP method to use for the request. | |
| // | |
| // Possible values: | |
| // "HTTP_METHOD_UNSPECIFIED" - HTTP method unspecified. Defaults to POST. | |
| // "POST" - HTTP POST | |
| // "GET" - HTTP GET | |
| // "HEAD" - HTTP HEAD | |
| // "PUT" - HTTP PUT | |
| // "DELETE" - HTTP DELETE | |
| // "PATCH" - HTTP PATCH | |
| // "OPTIONS" - HTTP OPTIONS | |
| HttpMethod string `json:"httpMethod,omitempty"` | |
| // OauthToken: If specified, an OAuth token | |
| // (https://developers.google.com/identity/protocols/OAuth2) will be generated | |
| // and attached as an `Authorization` header in the HTTP request. This type of | |
| // authorization should generally only be used when calling Google APIs hosted | |
| // on *.googleapis.com. | |
| OauthToken *OAuthToken `json:"oauthToken,omitempty"` | |
| // OidcToken: If specified, an OIDC | |
| // (https://developers.google.com/identity/protocols/OpenIDConnect) token will | |
| // be generated and attached as an `Authorization` header in the HTTP request. | |
| // This type of authorization can be used for many scenarios, including calling | |
| // Cloud Run, or endpoints where you intend to validate the token yourself. | |
| OidcToken *OidcToken `json:"oidcToken,omitempty"` | |
| // Uri: Required. The full URI path that the request will be sent to. This | |
| // string must begin with either "http://" or "https://". Some examples of | |
| // valid values for uri are: `http://acme.com` and | |
| // `https://acme.com/sales:8080`. Cloud Scheduler will encode some characters | |
| // for safety and compatibility. The maximum allowed URL length is 2083 | |
| // characters after encoding. | |
| Uri string `json:"uri,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "Body") to unconditionally | |
| // include in API requests. By default, fields with empty or default values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "Body") to include in API requests | |
| // with the JSON null value. By default, fields with empty values are omitted | |
| // from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s HttpTarget) MarshalJSON() ([]byte, error) { | |
| type NoMethod HttpTarget | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // Job: Configuration for a job. The maximum allowed size for a job is 1MB. | |
| type Job struct { | |
| // AppEngineHttpTarget: App Engine HTTP target. | |
| AppEngineHttpTarget *AppEngineHttpTarget `json:"appEngineHttpTarget,omitempty"` | |
| // AttemptDeadline: The deadline for job attempts. If the request handler does | |
| // not respond by this deadline then the request is cancelled and the attempt | |
| // is marked as a `DEADLINE_EXCEEDED` failure. The failed attempt can be viewed | |
| // in execution logs. Cloud Scheduler will retry the job according to the | |
| // RetryConfig. The default and the allowed values depend on the type of | |
| // target: * For HTTP targets, the default is 3 minutes. The deadline must be | |
| // in the interval [15 seconds, 30 minutes]. * For App Engine HTTP targets, 0 | |
| // indicates that the request has the default deadline. The default deadline | |
| // depends on the scaling type of the service: 10 minutes for standard apps | |
| // with automatic scaling, 24 hours for standard apps with manual and basic | |
| // scaling, and 60 minutes for flex apps. If the request deadline is set, it | |
| // must be in the interval [15 seconds, 24 hours 15 seconds]. * For Pub/Sub | |
| // targets, this field is ignored. | |
| AttemptDeadline string `json:"attemptDeadline,omitempty"` | |
| // Description: Optionally caller-specified in CreateJob or UpdateJob. A | |
| // human-readable description for the job. This string must not contain more | |
| // than 500 characters. | |
| Description string `json:"description,omitempty"` | |
| // HttpTarget: HTTP target. | |
| HttpTarget *HttpTarget `json:"httpTarget,omitempty"` | |
| // LastAttemptTime: Output only. The time the last job attempt started. | |
| LastAttemptTime string `json:"lastAttemptTime,omitempty"` | |
| // Name: Optionally caller-specified in CreateJob, after which it becomes | |
| // output only. The job name. For example: | |
| // `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. * `PROJECT_ID` can | |
| // contain letters ([A-Za-z]), numbers ([0-9]), hyphens (-), colons (:), or | |
| // periods (.). For more information, see Identifying projects | |
| // (/resource-manager/docs/creating-managing-projects#identifying_projects) * | |
| // `LOCATION_ID` is the canonical ID for the job's location. The list of | |
| // available locations can be obtained by calling locations.list | |
| // (/scheduler/docs/reference/rest/v1/projects.locations/list). For more | |
| // information, see Cloud Scheduler locations (/scheduler/docs/locations). * | |
| // `JOB_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), hyphens (-), | |
| // or underscores (_). The maximum length is 500 characters. | |
| Name string `json:"name,omitempty"` | |
| // PubsubTarget: Pub/Sub target. | |
| PubsubTarget *PubsubTarget `json:"pubsubTarget,omitempty"` | |
| // RetryConfig: Settings that determine the retry behavior. | |
| RetryConfig *RetryConfig `json:"retryConfig,omitempty"` | |
| // SatisfiesPzs: Output only. Whether or not this Job satisfies the | |
| // requirements of physical zone separation | |
| SatisfiesPzs bool `json:"satisfiesPzs,omitempty"` | |
| // Schedule: Required, except when used with UpdateJob. Describes the schedule | |
| // on which the job will be executed. The schedule can be either of the | |
| // following types: * Crontab (https://en.wikipedia.org/wiki/Cron#Overview) * | |
| // English-like schedule (/scheduler/docs/configuring/cron-job-schedules) As a | |
| // general rule, execution `n + 1` of a job will not begin until execution `n` | |
| // has finished. Cloud Scheduler will never allow two simultaneously | |
| // outstanding executions. For example, this implies that if the `n+1`th | |
| // execution is scheduled to run at 16:00 but the `n`th execution takes until | |
| // 16:15, the `n+1`th execution will not start until `16:15`. A scheduled start | |
| // time will be delayed if the previous execution has not ended when its | |
| // scheduled time occurs. If retry_count > 0 and a job attempt fails, the job | |
| // will be tried a total of retry_count times, with exponential backoff, until | |
| // the next scheduled start time. If retry_count is 0, a job attempt will not | |
| // be retried if it fails. Instead the Cloud Scheduler system will wait for the | |
| // next scheduled execution time. Setting retry_count to 0 does not prevent | |
| // failed jobs from running according to schedule after the failure. | |
| Schedule string `json:"schedule,omitempty"` | |
| // ScheduleTime: Output only. The next time the job is scheduled. Note that | |
| // this may be a retry of a previously failed attempt or the next execution | |
| // time according to the schedule. | |
| ScheduleTime string `json:"scheduleTime,omitempty"` | |
| // State: Output only. State of the job. | |
| // | |
| // Possible values: | |
| // "STATE_UNSPECIFIED" - Unspecified state. | |
| // "ENABLED" - The job is executing normally. | |
| // "PAUSED" - The job is paused by the user. It will not execute. A user can | |
| // intentionally pause the job using PauseJobRequest. | |
| // "DISABLED" - The job is disabled by the system due to error. The user | |
| // cannot directly set a job to be disabled. | |
| // "UPDATE_FAILED" - The job state resulting from a failed | |
| // CloudScheduler.UpdateJob operation. To recover a job from this state, retry | |
| // CloudScheduler.UpdateJob until a successful response is received. | |
| State string `json:"state,omitempty"` | |
| // Status: Output only. The response from the target for the last attempted | |
| // execution. | |
| Status *Status `json:"status,omitempty"` | |
| // TimeZone: Specifies the time zone to be used in interpreting schedule. The | |
| // value of this field must be a time zone name from the tz database | |
| // (http://en.wikipedia.org/wiki/Tz_database). Note that some time zones | |
| // include a provision for daylight savings time. The rules for daylight saving | |
| // time are determined by the chosen tz. For UTC use the string "utc". If a | |
| // time zone is not specified, the default will be in UTC (also known as GMT). | |
| TimeZone string `json:"timeZone,omitempty"` | |
| // UserUpdateTime: Output only. The creation time of the job. | |
| UserUpdateTime string `json:"userUpdateTime,omitempty"` | |
| // ServerResponse contains the HTTP response code and headers from the server. | |
| googleapi.ServerResponse `json:"-"` | |
| // ForceSendFields is a list of field names (e.g. "AppEngineHttpTarget") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "AppEngineHttpTarget") to include | |
| // in API requests with the JSON null value. By default, fields with empty | |
| // values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s Job) MarshalJSON() ([]byte, error) { | |
| type NoMethod Job | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // ListJobsResponse: Response message for listing jobs using ListJobs. | |
| type ListJobsResponse struct { | |
| // Jobs: The list of jobs. | |
| Jobs []*Job `json:"jobs,omitempty"` | |
| // NextPageToken: A token to retrieve next page of results. Pass this value in | |
| // the page_token field in the subsequent call to ListJobs to retrieve the next | |
| // page of results. If this is empty it indicates that there are no more | |
| // results through which to paginate. The page token is valid for only 2 hours. | |
| NextPageToken string `json:"nextPageToken,omitempty"` | |
| // ServerResponse contains the HTTP response code and headers from the server. | |
| googleapi.ServerResponse `json:"-"` | |
| // ForceSendFields is a list of field names (e.g. "Jobs") to unconditionally | |
| // include in API requests. By default, fields with empty or default values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "Jobs") to include in API requests | |
| // with the JSON null value. By default, fields with empty values are omitted | |
| // from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s ListJobsResponse) MarshalJSON() ([]byte, error) { | |
| type NoMethod ListJobsResponse | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // ListLocationsResponse: The response message for Locations.ListLocations. | |
| type ListLocationsResponse struct { | |
| // Locations: A list of locations that matches the specified filter in the | |
| // request. | |
| Locations []*Location `json:"locations,omitempty"` | |
| // NextPageToken: The standard List next-page token. | |
| NextPageToken string `json:"nextPageToken,omitempty"` | |
| // ServerResponse contains the HTTP response code and headers from the server. | |
| googleapi.ServerResponse `json:"-"` | |
| // ForceSendFields is a list of field names (e.g. "Locations") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "Locations") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s ListLocationsResponse) MarshalJSON() ([]byte, error) { | |
| type NoMethod ListLocationsResponse | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // ListOperationsResponse: The response message for Operations.ListOperations. | |
| type ListOperationsResponse struct { | |
| // NextPageToken: The standard List next-page token. | |
| NextPageToken string `json:"nextPageToken,omitempty"` | |
| // Operations: A list of operations that matches the specified filter in the | |
| // request. | |
| Operations []*Operation `json:"operations,omitempty"` | |
| // Unreachable: Unordered list. Unreachable resources. Populated when the | |
| // request sets `ListOperationsRequest.return_partial_success` and reads across | |
| // collections. For example, when attempting to list all resources across all | |
| // supported locations. | |
| Unreachable []string `json:"unreachable,omitempty"` | |
| // ServerResponse contains the HTTP response code and headers from the server. | |
| googleapi.ServerResponse `json:"-"` | |
| // ForceSendFields is a list of field names (e.g. "NextPageToken") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "NextPageToken") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s ListOperationsResponse) MarshalJSON() ([]byte, error) { | |
| type NoMethod ListOperationsResponse | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // Location: A resource that represents a Google Cloud location. | |
| type Location struct { | |
| // DisplayName: The friendly name for this location, typically a nearby city | |
| // name. For example, "Tokyo". | |
| DisplayName string `json:"displayName,omitempty"` | |
| // Labels: Cross-service attributes for the location. For example | |
| // {"cloud.googleapis.com/region": "us-east1"} | |
| Labels map[string]string `json:"labels,omitempty"` | |
| // LocationId: The canonical id for this location. For example: "us-east1". | |
| LocationId string `json:"locationId,omitempty"` | |
| // Metadata: Service-specific metadata. For example the available capacity at | |
| // the given location. | |
| Metadata googleapi.RawMessage `json:"metadata,omitempty"` | |
| // Name: Resource name for the location, which may vary between | |
| // implementations. For example: | |
| // "projects/example-project/locations/us-east1" | |
| Name string `json:"name,omitempty"` | |
| // ServerResponse contains the HTTP response code and headers from the server. | |
| googleapi.ServerResponse `json:"-"` | |
| // ForceSendFields is a list of field names (e.g. "DisplayName") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "DisplayName") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s Location) MarshalJSON() ([]byte, error) { | |
| type NoMethod Location | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // OAuthToken: Contains information needed for generating an OAuth token | |
| // (https://developers.google.com/identity/protocols/OAuth2). This type of | |
| // authorization should generally only be used when calling Google APIs hosted | |
| // on *.googleapis.com. | |
| type OAuthToken struct { | |
| // Scope: OAuth scope to be used for generating OAuth access token. If not | |
| // specified, "https://www.googleapis.com/auth/cloud-platform" will be used. | |
| Scope string `json:"scope,omitempty"` | |
| // ServiceAccountEmail: Service account email | |
| // (https://cloud.google.com/iam/docs/service-accounts) to be used for | |
| // generating OAuth token. The service account must be within the same project | |
| // as the job. The caller must have iam.serviceAccounts.actAs permission for | |
| // the service account. | |
| ServiceAccountEmail string `json:"serviceAccountEmail,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "Scope") to unconditionally | |
| // include in API requests. By default, fields with empty or default values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "Scope") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s OAuthToken) MarshalJSON() ([]byte, error) { | |
| type NoMethod OAuthToken | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // OidcToken: Contains information needed for generating an OpenID Connect | |
| // token (https://developers.google.com/identity/protocols/OpenIDConnect). This | |
| // type of authorization can be used for many scenarios, including calling | |
| // Cloud Run, or endpoints where you intend to validate the token yourself. | |
| type OidcToken struct { | |
| // Audience: Audience to be used when generating OIDC token. If not specified, | |
| // the URI specified in target will be used. | |
| Audience string `json:"audience,omitempty"` | |
| // ServiceAccountEmail: Service account email | |
| // (https://cloud.google.com/iam/docs/service-accounts) to be used for | |
| // generating OIDC token. The service account must be within the same project | |
| // as the job. The caller must have iam.serviceAccounts.actAs permission for | |
| // the service account. | |
| ServiceAccountEmail string `json:"serviceAccountEmail,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "Audience") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "Audience") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s OidcToken) MarshalJSON() ([]byte, error) { | |
| type NoMethod OidcToken | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // Operation: This resource represents a long-running operation that is the | |
| // result of a network API call. | |
| type Operation struct { | |
| // Done: If the value is `false`, it means the operation is still in progress. | |
| // If `true`, the operation is completed, and either `error` or `response` is | |
| // available. | |
| Done bool `json:"done,omitempty"` | |
| // Error: The error result of the operation in case of failure or cancellation. | |
| Error *Status `json:"error,omitempty"` | |
| // Metadata: Service-specific metadata associated with the operation. It | |
| // typically contains progress information and common metadata such as create | |
| // time. Some services might not provide such metadata. Any method that returns | |
| // a long-running operation should document the metadata type, if any. | |
| Metadata googleapi.RawMessage `json:"metadata,omitempty"` | |
| // Name: The server-assigned name, which is only unique within the same service | |
| // that originally returns it. If you use the default HTTP mapping, the `name` | |
| // should be a resource name ending with `operations/{unique_id}`. | |
| Name string `json:"name,omitempty"` | |
| // Response: The normal, successful response of the operation. If the original | |
| // method returns no data on success, such as `Delete`, the response is | |
| // `google.protobuf.Empty`. If the original method is standard | |
| // `Get`/`Create`/`Update`, the response should be the resource. For other | |
| // methods, the response should have the type `XxxResponse`, where `Xxx` is the | |
| // original method name. For example, if the original method name is | |
| // `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. | |
| Response googleapi.RawMessage `json:"response,omitempty"` | |
| // ServerResponse contains the HTTP response code and headers from the server. | |
| googleapi.ServerResponse `json:"-"` | |
| // ForceSendFields is a list of field names (e.g. "Done") to unconditionally | |
| // include in API requests. By default, fields with empty or default values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "Done") to include in API requests | |
| // with the JSON null value. By default, fields with empty values are omitted | |
| // from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s Operation) MarshalJSON() ([]byte, error) { | |
| type NoMethod Operation | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // OperationMetadata: Represents the metadata of the long-running operation. | |
| type OperationMetadata struct { | |
| // ApiVersion: Output only. API version used to start the operation. | |
| ApiVersion string `json:"apiVersion,omitempty"` | |
| // CancelRequested: Output only. Identifies whether the user has requested | |
| // cancellation of the operation. Operations that have been cancelled | |
| // successfully have google.longrunning.Operation.error value with a | |
| // google.rpc.Status.code of `1`, corresponding to `Code.CANCELLED`. | |
| CancelRequested bool `json:"cancelRequested,omitempty"` | |
| // CreateTime: Output only. The time the operation was created. | |
| CreateTime string `json:"createTime,omitempty"` | |
| // EndTime: Output only. The time the operation finished running. | |
| EndTime string `json:"endTime,omitempty"` | |
| // StatusDetail: Output only. Human-readable status of the operation, if any. | |
| StatusDetail string `json:"statusDetail,omitempty"` | |
| // Target: Output only. Server-defined resource path for the target of the | |
| // operation. | |
| Target string `json:"target,omitempty"` | |
| // Verb: Output only. Name of the verb executed by the operation. | |
| Verb string `json:"verb,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "ApiVersion") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "ApiVersion") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s OperationMetadata) MarshalJSON() ([]byte, error) { | |
| type NoMethod OperationMetadata | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // PauseJobRequest: Request message for PauseJob. | |
| type PauseJobRequest struct { | |
| } | |
| // PubsubMessage: A message that is published by publishers and consumed by | |
| // subscribers. The message must contain either a non-empty data field or at | |
| // least one attribute. Note that client libraries represent this object | |
| // differently depending on the language. See the corresponding client library | |
| // documentation (https://cloud.google.com/pubsub/docs/reference/libraries) for | |
| // more information. See [quotas and limits] | |
| // (https://cloud.google.com/pubsub/quotas) for more information about message | |
| // limits. | |
| type PubsubMessage struct { | |
| // Attributes: Optional. Attributes for this message. If this field is empty, | |
| // the message must contain non-empty data. This can be used to filter messages | |
| // on the subscription. | |
| Attributes map[string]string `json:"attributes,omitempty"` | |
| // Data: Optional. The message data field. If this field is empty, the message | |
| // must contain at least one attribute. | |
| Data string `json:"data,omitempty"` | |
| // MessageId: ID of this message, assigned by the server when the message is | |
| // published. Guaranteed to be unique within the topic. This value may be read | |
| // by a subscriber that receives a `PubsubMessage` via a `Pull` call or a push | |
| // delivery. It must not be populated by the publisher in a `Publish` call. | |
| MessageId string `json:"messageId,omitempty"` | |
| // OrderingKey: Optional. If non-empty, identifies related messages for which | |
| // publish order should be respected. If a `Subscription` has | |
| // `enable_message_ordering` set to `true`, messages published with the same | |
| // non-empty `ordering_key` value will be delivered to subscribers in the order | |
| // in which they are received by the Pub/Sub system. All `PubsubMessage`s | |
| // published in a given `PublishRequest` must specify the same `ordering_key` | |
| // value. For more information, see ordering messages | |
| // (https://cloud.google.com/pubsub/docs/ordering). | |
| OrderingKey string `json:"orderingKey,omitempty"` | |
| // PublishTime: The time at which the message was published, populated by the | |
| // server when it receives the `Publish` call. It must not be populated by the | |
| // publisher in a `Publish` call. | |
| PublishTime string `json:"publishTime,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "Attributes") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "Attributes") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s PubsubMessage) MarshalJSON() ([]byte, error) { | |
| type NoMethod PubsubMessage | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // PubsubTarget: Pub/Sub target. The job will be delivered by publishing a | |
| // message to the given Pub/Sub topic. | |
| type PubsubTarget struct { | |
| // Attributes: Attributes for PubsubMessage. Pubsub message must contain either | |
| // non-empty data, or at least one attribute. | |
| Attributes map[string]string `json:"attributes,omitempty"` | |
| // Data: The message payload for PubsubMessage. Pubsub message must contain | |
| // either non-empty data, or at least one attribute. | |
| Data string `json:"data,omitempty"` | |
| // TopicName: Required. The name of the Cloud Pub/Sub topic to which messages | |
| // will be published when a job is delivered. The topic name must be in the | |
| // same format as required by Pub/Sub's PublishRequest.name | |
| // (https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#publishrequest), | |
| // for example `projects/PROJECT_ID/topics/TOPIC_ID`. The topic must be in the | |
| // same project as the Cloud Scheduler job. | |
| TopicName string `json:"topicName,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "Attributes") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "Attributes") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s PubsubTarget) MarshalJSON() ([]byte, error) { | |
| type NoMethod PubsubTarget | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // ResumeJobRequest: Request message for ResumeJob. | |
| type ResumeJobRequest struct { | |
| } | |
| // RetryConfig: Settings that determine the retry behavior. For more | |
| // information, see Retry jobs (/scheduler/docs/configuring/retry-jobs). By | |
| // default, if a job does not complete successfully (meaning that an | |
| // acknowledgement is not received from the handler, then it will be retried | |
| // with exponential backoff according to the settings in RetryConfig. | |
| type RetryConfig struct { | |
| // MaxBackoffDuration: The maximum amount of time to wait before retrying a job | |
| // after it fails. The default value of this field is 1 hour. | |
| MaxBackoffDuration string `json:"maxBackoffDuration,omitempty"` | |
| // MaxDoublings: The time between retries will double `max_doublings` times. A | |
| // job's retry interval starts at min_backoff_duration, then doubles | |
| // `max_doublings` times, then increases linearly, and finally retries at | |
| // intervals of max_backoff_duration up to retry_count times. For examples, see | |
| // Retry jobs (/scheduler/docs/configuring/retry-jobs#max-doublings). The | |
| // default value of this field is 5. | |
| MaxDoublings int64 `json:"maxDoublings,omitempty"` | |
| // MaxRetryDuration: The time limit for retrying a failed job, measured from | |
| // the time when an execution was first attempted. If specified with | |
| // retry_count, the job will be retried until both limits are reached. The | |
| // default value for max_retry_duration is zero, which means retry duration is | |
| // unlimited. However, if retry_count is also 0, a job attempt won't be retried | |
| // if it fails. | |
| MaxRetryDuration string `json:"maxRetryDuration,omitempty"` | |
| // MinBackoffDuration: The minimum amount of time to wait before retrying a job | |
| // after it fails. The default value of this field is 5 seconds. | |
| MinBackoffDuration string `json:"minBackoffDuration,omitempty"` | |
| // RetryCount: The number of attempts that the system will make to run a job | |
| // using the exponential backoff procedure described by max_doublings. The | |
| // default value of retry_count is zero. If retry_count is 0 (and if | |
| // max_retry_duration is also 0), a job attempt won't be retried if it fails. | |
| // Instead, Cloud Scheduler system will wait for the next scheduled execution | |
| // time. Setting retry_count to 0 doesn't prevent failed jobs from running | |
| // according to schedule after the failure. If retry_count is set to a non-zero | |
| // number, Cloud Scheduler will retry the failed job, using exponential | |
| // backoff, for retry_count times until the job succeeds or the number of | |
| // retries is exhausted. Note that the next scheduled execution time might be | |
| // skipped if the retries continue through that time. Values greater than 5 and | |
| // negative values are not allowed. | |
| RetryCount int64 `json:"retryCount,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "MaxBackoffDuration") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "MaxBackoffDuration") to include | |
| // in API requests with the JSON null value. By default, fields with empty | |
| // values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s RetryConfig) MarshalJSON() ([]byte, error) { | |
| type NoMethod RetryConfig | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // RunJobRequest: Request message for forcing a job to run now using RunJob. | |
| type RunJobRequest struct { | |
| } | |
| // Status: The `Status` type defines a logical error model that is suitable for | |
| // different programming environments, including REST APIs and RPC APIs. It is | |
| // used by gRPC (https://github.com/grpc). Each `Status` message contains three | |
| // pieces of data: error code, error message, and error details. You can find | |
| // out more about this error model and how to work with it in the API Design | |
| // Guide (https://cloud.google.com/apis/design/errors). | |
| type Status struct { | |
| // Code: The status code, which should be an enum value of google.rpc.Code. | |
| Code int64 `json:"code,omitempty"` | |
| // Details: A list of messages that carry the error details. There is a common | |
| // set of message types for APIs to use. | |
| Details []googleapi.RawMessage `json:"details,omitempty"` | |
| // Message: A developer-facing error message, which should be in English. Any | |
| // user-facing error message should be localized and sent in the | |
| // google.rpc.Status.details field, or localized by the client. | |
| Message string `json:"message,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "Code") to unconditionally | |
| // include in API requests. By default, fields with empty or default values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "Code") to include in API requests | |
| // with the JSON null value. By default, fields with empty values are omitted | |
| // from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s Status) MarshalJSON() ([]byte, error) { | |
| type NoMethod Status | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| type ProjectsLocationsGetCall struct { | |
| s *Service | |
| name string | |
| urlParams_ gensupport.URLParams | |
| ifNoneMatch_ string | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Get: Gets information about a location. | |
| // | |
| // - name: Resource name for the location. | |
| func (r *ProjectsLocationsService) Get(name string) *ProjectsLocationsGetCall { | |
| c := &ProjectsLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGetCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // IfNoneMatch sets an optional parameter which makes the operation fail if the | |
| // object's ETag matches the given value. This is useful for getting updates | |
| // only after the object has changed since the last request. | |
| func (c *ProjectsLocationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGetCall { | |
| c.ifNoneMatch_ = entityTag | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsGetCall) Context(ctx context.Context) *ProjectsLocationsGetCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsGetCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| if c.ifNoneMatch_ != "" { | |
| reqHeaders.Set("If-None-Match", c.ifNoneMatch_) | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("GET", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "cloudscheduler.projects.locations.get", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "cloudscheduler.projects.locations.get" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Location.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Location{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "cloudscheduler.projects.locations.get", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsGetCmekConfigCall struct { | |
| s *Service | |
| name string | |
| urlParams_ gensupport.URLParams | |
| ifNoneMatch_ string | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // GetCmekConfig: Gets the Scheduler config in the project/region. | |
| // | |
| // - name: The config name. For example: | |
| // projects/PROJECT_ID/locations/LOCATION_ID/cmekConfig. | |
| func (r *ProjectsLocationsService) GetCmekConfig(name string) *ProjectsLocationsGetCmekConfigCall { | |
| c := &ProjectsLocationsGetCmekConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsGetCmekConfigCall) Fields(s ...googleapi.Field) *ProjectsLocationsGetCmekConfigCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // IfNoneMatch sets an optional parameter which makes the operation fail if the | |
| // object's ETag matches the given value. This is useful for getting updates | |
| // only after the object has changed since the last request. | |
| func (c *ProjectsLocationsGetCmekConfigCall) IfNoneMatch(entityTag string) *ProjectsLocationsGetCmekConfigCall { | |
| c.ifNoneMatch_ = entityTag | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsGetCmekConfigCall) Context(ctx context.Context) *ProjectsLocationsGetCmekConfigCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsGetCmekConfigCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsGetCmekConfigCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| if c.ifNoneMatch_ != "" { | |
| reqHeaders.Set("If-None-Match", c.ifNoneMatch_) | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("GET", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "cloudscheduler.projects.locations.getCmekConfig", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "cloudscheduler.projects.locations.getCmekConfig" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *CmekConfig.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsGetCmekConfigCall) Do(opts ...googleapi.CallOption) (*CmekConfig, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &CmekConfig{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "cloudscheduler.projects.locations.getCmekConfig", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsListCall struct { | |
| s *Service | |
| name string | |
| urlParams_ gensupport.URLParams | |
| ifNoneMatch_ string | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // List: Lists information about the supported locations for this service. This | |
| // method lists locations based on the resource scope provided in the | |
| // ListLocationsRequest.name field: * **Global locations**: If `name` is empty, | |
| // the method lists the public locations available to all projects. * | |
| // **Project-specific locations**: If `name` follows the format | |
| // `projects/{project}`, the method lists locations visible to that specific | |
| // project. This includes public, private, or other project-specific locations | |
| // enabled for the project. For gRPC and client library implementations, the | |
| // resource name is passed as the `name` field. For direct service calls, the | |
| // resource name is incorporated into the request path based on the specific | |
| // service implementation and version. | |
| // | |
| // - name: The resource that owns the locations collection, if applicable. | |
| func (r *ProjectsLocationsService) List(name string) *ProjectsLocationsListCall { | |
| c := &ProjectsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| return c | |
| } | |
| // ExtraLocationTypes sets the optional parameter "extraLocationTypes": Do not | |
| // use this field unless explicitly documented otherwise. This is primarily for | |
| // internal usage. | |
| func (c *ProjectsLocationsListCall) ExtraLocationTypes(extraLocationTypes ...string) *ProjectsLocationsListCall { | |
| c.urlParams_.SetMulti("extraLocationTypes", append([]string{}, extraLocationTypes...)) | |
| return c | |
| } | |
| // Filter sets the optional parameter "filter": A filter to narrow down results | |
| // to a preferred subset. The filtering language accepts strings like | |
| // "displayName=tokyo", and is documented in more detail in AIP-160 | |
| // (https://google.aip.dev/160). | |
| func (c *ProjectsLocationsListCall) Filter(filter string) *ProjectsLocationsListCall { | |
| c.urlParams_.Set("filter", filter) | |
| return c | |
| } | |
| // PageSize sets the optional parameter "pageSize": The maximum number of | |
| // results to return. If not set, the service selects a default. | |
| func (c *ProjectsLocationsListCall) PageSize(pageSize int64) *ProjectsLocationsListCall { | |
| c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) | |
| return c | |
| } | |
| // PageToken sets the optional parameter "pageToken": A page token received | |
| // from the `next_page_token` field in the response. Send that page token to | |
| // receive the subsequent page. | |
| func (c *ProjectsLocationsListCall) PageToken(pageToken string) *ProjectsLocationsListCall { | |
| c.urlParams_.Set("pageToken", pageToken) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsListCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // IfNoneMatch sets an optional parameter which makes the operation fail if the | |
| // object's ETag matches the given value. This is useful for getting updates | |
| // only after the object has changed since the last request. | |
| func (c *ProjectsLocationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsListCall { | |
| c.ifNoneMatch_ = entityTag | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsListCall) Context(ctx context.Context) *ProjectsLocationsListCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsListCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| if c.ifNoneMatch_ != "" { | |
| reqHeaders.Set("If-None-Match", c.ifNoneMatch_) | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("GET", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "cloudscheduler.projects.locations.list", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "cloudscheduler.projects.locations.list" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *ListLocationsResponse.ServerResponse.Header or (if a response was returned | |
| // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to | |
| // check whether the returned error was because http.StatusNotModified was | |
| // returned. | |
| func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &ListLocationsResponse{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "cloudscheduler.projects.locations.list", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| // Pages invokes f for each page of results. | |
| // A non-nil error returned from f will halt the iteration. | |
| // The provided context supersedes any context provided to the Context method. | |
| func (c *ProjectsLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error { | |
| c.ctx_ = ctx | |
| defer c.PageToken(c.urlParams_.Get("pageToken")) | |
| for { | |
| x, err := c.Do() | |
| if err != nil { | |
| return err | |
| } | |
| if err := f(x); err != nil { | |
| return err | |
| } | |
| if x.NextPageToken == "" { | |
| return nil | |
| } | |
| c.PageToken(x.NextPageToken) | |
| } | |
| } | |
| type ProjectsLocationsUpdateCmekConfigCall struct { | |
| s *Service | |
| name string | |
| cmekconfig *CmekConfig | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // UpdateCmekConfig: Initializes or Updates the a scheduler config. | |
| // | |
| // - name: Identifier. The config resource name which includes the project and | |
| // location and must end in 'cmekConfig', in the format | |
| // projects/PROJECT_ID/locations/LOCATION_ID/cmekConfig`. | |
| func (r *ProjectsLocationsService) UpdateCmekConfig(name string, cmekconfig *CmekConfig) *ProjectsLocationsUpdateCmekConfigCall { | |
| c := &ProjectsLocationsUpdateCmekConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| c.cmekconfig = cmekconfig | |
| return c | |
| } | |
| // UpdateMask sets the optional parameter "updateMask": List of fields to be | |
| // updated in this request. | |
| func (c *ProjectsLocationsUpdateCmekConfigCall) UpdateMask(updateMask string) *ProjectsLocationsUpdateCmekConfigCall { | |
| c.urlParams_.Set("updateMask", updateMask) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsUpdateCmekConfigCall) Fields(s ...googleapi.Field) *ProjectsLocationsUpdateCmekConfigCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsUpdateCmekConfigCall) Context(ctx context.Context) *ProjectsLocationsUpdateCmekConfigCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsUpdateCmekConfigCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsUpdateCmekConfigCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) | |
| body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cmekconfig) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("PATCH", urls, body) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "cloudscheduler.projects.locations.updateCmekConfig", "request", internallog.HTTPRequest(req, body.Bytes())) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "cloudscheduler.projects.locations.updateCmekConfig" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Operation.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsUpdateCmekConfigCall) Do(opts ...googleapi.CallOption) (*Operation, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Operation{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "cloudscheduler.projects.locations.updateCmekConfig", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsJobsCreateCall struct { | |
| s *Service | |
| parent string | |
| job *Job | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Create: Creates a job. | |
| // | |
| // - parent: The location name. For example: | |
| // `projects/PROJECT_ID/locations/LOCATION_ID`. | |
| func (r *ProjectsLocationsJobsService) Create(parent string, job *Job) *ProjectsLocationsJobsCreateCall { | |
| c := &ProjectsLocationsJobsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.parent = parent | |
| c.job = job | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsJobsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsJobsCreateCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsJobsCreateCall) Context(ctx context.Context) *ProjectsLocationsJobsCreateCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsJobsCreateCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsJobsCreateCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) | |
| body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.job) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/jobs") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("POST", urls, body) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "parent": c.parent, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "cloudscheduler.projects.locations.jobs.create", "request", internallog.HTTPRequest(req, body.Bytes())) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "cloudscheduler.projects.locations.jobs.create" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Job.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsJobsCreateCall) Do(opts ...googleapi.CallOption) (*Job, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Job{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "cloudscheduler.projects.locations.jobs.create", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsJobsDeleteCall struct { | |
| s *Service | |
| name string | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Delete: Deletes a job. | |
| // | |
| // - name: The job name. For example: | |
| // `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. | |
| func (r *ProjectsLocationsJobsService) Delete(name string) *ProjectsLocationsJobsDeleteCall { | |
| c := &ProjectsLocationsJobsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsJobsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsJobsDeleteCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsJobsDeleteCall) Context(ctx context.Context) *ProjectsLocationsJobsDeleteCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsJobsDeleteCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsJobsDeleteCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("DELETE", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "cloudscheduler.projects.locations.jobs.delete", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "cloudscheduler.projects.locations.jobs.delete" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Empty.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsJobsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Empty{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "cloudscheduler.projects.locations.jobs.delete", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsJobsGetCall struct { | |
| s *Service | |
| name string | |
| urlParams_ gensupport.URLParams | |
| ifNoneMatch_ string | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Get: Gets a job. | |
| // | |
| // - name: The job name. For example: | |
| // `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. | |
| func (r *ProjectsLocationsJobsService) Get(name string) *ProjectsLocationsJobsGetCall { | |
| c := &ProjectsLocationsJobsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsJobsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsJobsGetCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // IfNoneMatch sets an optional parameter which makes the operation fail if the | |
| // object's ETag matches the given value. This is useful for getting updates | |
| // only after the object has changed since the last request. | |
| func (c *ProjectsLocationsJobsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsJobsGetCall { | |
| c.ifNoneMatch_ = entityTag | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsJobsGetCall) Context(ctx context.Context) *ProjectsLocationsJobsGetCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsJobsGetCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsJobsGetCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| if c.ifNoneMatch_ != "" { | |
| reqHeaders.Set("If-None-Match", c.ifNoneMatch_) | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("GET", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "cloudscheduler.projects.locations.jobs.get", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "cloudscheduler.projects.locations.jobs.get" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Job.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsJobsGetCall) Do(opts ...googleapi.CallOption) (*Job, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Job{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "cloudscheduler.projects.locations.jobs.get", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsJobsListCall struct { | |
| s *Service | |
| parent string | |
| urlParams_ gensupport.URLParams | |
| ifNoneMatch_ string | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // List: Lists jobs. | |
| // | |
| // - parent: The location name. For example: | |
| // `projects/PROJECT_ID/locations/LOCATION_ID`. | |
| func (r *ProjectsLocationsJobsService) List(parent string) *ProjectsLocationsJobsListCall { | |
| c := &ProjectsLocationsJobsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.parent = parent | |
| return c | |
| } | |
| // PageSize sets the optional parameter "pageSize": Requested page size. The | |
| // maximum page size is 500. If unspecified, the page size will be the maximum. | |
| // Fewer jobs than requested might be returned, even if more jobs exist; use | |
| // next_page_token to determine if more jobs exist. | |
| func (c *ProjectsLocationsJobsListCall) PageSize(pageSize int64) *ProjectsLocationsJobsListCall { | |
| c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) | |
| return c | |
| } | |
| // PageToken sets the optional parameter "pageToken": A token identifying a | |
| // page of results the server will return. To request the first page results, | |
| // page_token must be empty. To request the next page of results, page_token | |
| // must be the value of next_page_token returned from the previous call to | |
| // ListJobs. | |
| func (c *ProjectsLocationsJobsListCall) PageToken(pageToken string) *ProjectsLocationsJobsListCall { | |
| c.urlParams_.Set("pageToken", pageToken) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsJobsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsJobsListCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // IfNoneMatch sets an optional parameter which makes the operation fail if the | |
| // object's ETag matches the given value. This is useful for getting updates | |
| // only after the object has changed since the last request. | |
| func (c *ProjectsLocationsJobsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsJobsListCall { | |
| c.ifNoneMatch_ = entityTag | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsJobsListCall) Context(ctx context.Context) *ProjectsLocationsJobsListCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsJobsListCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsJobsListCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| if c.ifNoneMatch_ != "" { | |
| reqHeaders.Set("If-None-Match", c.ifNoneMatch_) | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/jobs") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("GET", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "parent": c.parent, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "cloudscheduler.projects.locations.jobs.list", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "cloudscheduler.projects.locations.jobs.list" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *ListJobsResponse.ServerResponse.Header or (if a response was returned at | |
| // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to | |
| // check whether the returned error was because http.StatusNotModified was | |
| // returned. | |
| func (c *ProjectsLocationsJobsListCall) Do(opts ...googleapi.CallOption) (*ListJobsResponse, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &ListJobsResponse{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "cloudscheduler.projects.locations.jobs.list", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| // Pages invokes f for each page of results. | |
| // A non-nil error returned from f will halt the iteration. | |
| // The provided context supersedes any context provided to the Context method. | |
| func (c *ProjectsLocationsJobsListCall) Pages(ctx context.Context, f func(*ListJobsResponse) error) error { | |
| c.ctx_ = ctx | |
| defer c.PageToken(c.urlParams_.Get("pageToken")) | |
| for { | |
| x, err := c.Do() | |
| if err != nil { | |
| return err | |
| } | |
| if err := f(x); err != nil { | |
| return err | |
| } | |
| if x.NextPageToken == "" { | |
| return nil | |
| } | |
| c.PageToken(x.NextPageToken) | |
| } | |
| } | |
| type ProjectsLocationsJobsPatchCall struct { | |
| s *Service | |
| name string | |
| job *Job | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Patch: Updates a job. If successful, the updated Job is returned. If the job | |
| // does not exist, `NOT_FOUND` is returned. If UpdateJob does not successfully | |
| // return, it is possible for the job to be in an Job.State.UPDATE_FAILED | |
| // state. A job in this state may not be executed. If this happens, retry the | |
| // UpdateJob request until a successful response is received. | |
| // | |
| // - name: Optionally caller-specified in CreateJob, after which it becomes | |
| // output only. The job name. For example: | |
| // `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. * `PROJECT_ID` | |
| // can contain letters ([A-Za-z]), numbers ([0-9]), hyphens (-), colons (:), | |
| // or periods (.). For more information, see Identifying projects | |
| // (/resource-manager/docs/creating-managing-projects#identifying_projects) * | |
| // `LOCATION_ID` is the canonical ID for the job's location. The list of | |
| // available locations can be obtained by calling locations.list | |
| // (/scheduler/docs/reference/rest/v1/projects.locations/list). For more | |
| // information, see Cloud Scheduler locations (/scheduler/docs/locations). * | |
| // `JOB_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), hyphens | |
| // (-), or underscores (_). The maximum length is 500 characters. | |
| func (r *ProjectsLocationsJobsService) Patch(name string, job *Job) *ProjectsLocationsJobsPatchCall { | |
| c := &ProjectsLocationsJobsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| c.job = job | |
| return c | |
| } | |
| // UpdateMask sets the optional parameter "updateMask": A mask used to specify | |
| // which fields of the job are being updated. | |
| func (c *ProjectsLocationsJobsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsJobsPatchCall { | |
| c.urlParams_.Set("updateMask", updateMask) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsJobsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsJobsPatchCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsJobsPatchCall) Context(ctx context.Context) *ProjectsLocationsJobsPatchCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsJobsPatchCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsJobsPatchCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) | |
| body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.job) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("PATCH", urls, body) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "cloudscheduler.projects.locations.jobs.patch", "request", internallog.HTTPRequest(req, body.Bytes())) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "cloudscheduler.projects.locations.jobs.patch" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Job.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsJobsPatchCall) Do(opts ...googleapi.CallOption) (*Job, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Job{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "cloudscheduler.projects.locations.jobs.patch", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsJobsPauseCall struct { | |
| s *Service | |
| name string | |
| pausejobrequest *PauseJobRequest | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Pause: Pauses a job. If a job is paused then the system will stop executing | |
| // the job until it is re-enabled via ResumeJob. The state of the job is stored | |
| // in state; if paused it will be set to Job.State.PAUSED. A job must be in | |
| // Job.State.ENABLED to be paused. | |
| // | |
| // - name: The job name. For example: | |
| // `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. | |
| func (r *ProjectsLocationsJobsService) Pause(name string, pausejobrequest *PauseJobRequest) *ProjectsLocationsJobsPauseCall { | |
| c := &ProjectsLocationsJobsPauseCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| c.pausejobrequest = pausejobrequest | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsJobsPauseCall) Fields(s ...googleapi.Field) *ProjectsLocationsJobsPauseCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsJobsPauseCall) Context(ctx context.Context) *ProjectsLocationsJobsPauseCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsJobsPauseCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsJobsPauseCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) | |
| body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.pausejobrequest) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:pause") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("POST", urls, body) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "cloudscheduler.projects.locations.jobs.pause", "request", internallog.HTTPRequest(req, body.Bytes())) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "cloudscheduler.projects.locations.jobs.pause" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Job.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsJobsPauseCall) Do(opts ...googleapi.CallOption) (*Job, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Job{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "cloudscheduler.projects.locations.jobs.pause", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsJobsResumeCall struct { | |
| s *Service | |
| name string | |
| resumejobrequest *ResumeJobRequest | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Resume: Resume a job. This method reenables a job after it has been | |
| // Job.State.PAUSED. The state of a job is stored in Job.state; after calling | |
| // this method it will be set to Job.State.ENABLED. A job must be in | |
| // Job.State.PAUSED to be resumed. | |
| // | |
| // - name: The job name. For example: | |
| // `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. | |
| func (r *ProjectsLocationsJobsService) Resume(name string, resumejobrequest *ResumeJobRequest) *ProjectsLocationsJobsResumeCall { | |
| c := &ProjectsLocationsJobsResumeCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| c.resumejobrequest = resumejobrequest | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsJobsResumeCall) Fields(s ...googleapi.Field) *ProjectsLocationsJobsResumeCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsJobsResumeCall) Context(ctx context.Context) *ProjectsLocationsJobsResumeCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsJobsResumeCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsJobsResumeCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) | |
| body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.resumejobrequest) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:resume") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("POST", urls, body) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "cloudscheduler.projects.locations.jobs.resume", "request", internallog.HTTPRequest(req, body.Bytes())) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "cloudscheduler.projects.locations.jobs.resume" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Job.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsJobsResumeCall) Do(opts ...googleapi.CallOption) (*Job, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Job{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "cloudscheduler.projects.locations.jobs.resume", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsJobsRunCall struct { | |
| s *Service | |
| name string | |
| runjobrequest *RunJobRequest | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Run: Forces a job to run now. When this method is called, Cloud Scheduler | |
| // will dispatch the job, even if the job is already running. | |
| // | |
| // - name: The job name. For example: | |
| // `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. | |
| func (r *ProjectsLocationsJobsService) Run(name string, runjobrequest *RunJobRequest) *ProjectsLocationsJobsRunCall { | |
| c := &ProjectsLocationsJobsRunCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| c.runjobrequest = runjobrequest | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsJobsRunCall) Fields(s ...googleapi.Field) *ProjectsLocationsJobsRunCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsJobsRunCall) Context(ctx context.Context) *ProjectsLocationsJobsRunCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsJobsRunCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsJobsRunCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) | |
| body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.runjobrequest) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:run") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("POST", urls, body) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "cloudscheduler.projects.locations.jobs.run", "request", internallog.HTTPRequest(req, body.Bytes())) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "cloudscheduler.projects.locations.jobs.run" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Job.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsJobsRunCall) Do(opts ...googleapi.CallOption) (*Job, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Job{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "cloudscheduler.projects.locations.jobs.run", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsOperationsCancelCall struct { | |
| s *Service | |
| name string | |
| canceloperationrequest *CancelOperationRequest | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Cancel: Starts asynchronous cancellation on a long-running operation. The | |
| // server makes a best effort to cancel the operation, but success is not | |
| // guaranteed. If the server doesn't support this method, it returns | |
| // `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or | |
| // other methods to check whether the cancellation succeeded or whether the | |
| // operation completed despite cancellation. On successful cancellation, the | |
| // operation is not deleted; instead, it becomes an operation with an | |
| // Operation.error value with a google.rpc.Status.code of `1`, corresponding to | |
| // `Code.CANCELLED`. | |
| // | |
| // - name: The name of the operation resource to be cancelled. | |
| func (r *ProjectsLocationsOperationsService) Cancel(name string, canceloperationrequest *CancelOperationRequest) *ProjectsLocationsOperationsCancelCall { | |
| c := &ProjectsLocationsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| c.canceloperationrequest = canceloperationrequest | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsOperationsCancelCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsCancelCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsOperationsCancelCall) Context(ctx context.Context) *ProjectsLocationsOperationsCancelCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) | |
| body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("POST", urls, body) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "cloudscheduler.projects.locations.operations.cancel", "request", internallog.HTTPRequest(req, body.Bytes())) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "cloudscheduler.projects.locations.operations.cancel" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Empty.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Empty{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "cloudscheduler.projects.locations.operations.cancel", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsOperationsDeleteCall struct { | |
| s *Service | |
| name string | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Delete: Deletes a long-running operation. This method indicates that the | |
| // client is no longer interested in the operation result. It does not cancel | |
| // the operation. If the server doesn't support this method, it returns | |
| // `google.rpc.Code.UNIMPLEMENTED`. | |
| // | |
| // - name: The name of the operation resource to be deleted. | |
| func (r *ProjectsLocationsOperationsService) Delete(name string) *ProjectsLocationsOperationsDeleteCall { | |
| c := &ProjectsLocationsOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsOperationsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsDeleteCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsOperationsDeleteCall) Context(ctx context.Context) *ProjectsLocationsOperationsDeleteCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("DELETE", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "cloudscheduler.projects.locations.operations.delete", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "cloudscheduler.projects.locations.operations.delete" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Empty.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Empty{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "cloudscheduler.projects.locations.operations.delete", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsOperationsGetCall struct { | |
| s *Service | |
| name string | |
| urlParams_ gensupport.URLParams | |
| ifNoneMatch_ string | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Get: Gets the latest state of a long-running operation. Clients can use this | |
| // method to poll the operation result at intervals as recommended by the API | |
| // service. | |
| // | |
| // - name: The name of the operation resource. | |
| func (r *ProjectsLocationsOperationsService) Get(name string) *ProjectsLocationsOperationsGetCall { | |
| c := &ProjectsLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsGetCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // IfNoneMatch sets an optional parameter which makes the operation fail if the | |
| // object's ETag matches the given value. This is useful for getting updates | |
| // only after the object has changed since the last request. | |
| func (c *ProjectsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsGetCall { | |
| c.ifNoneMatch_ = entityTag | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsOperationsGetCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsOperationsGetCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| if c.ifNoneMatch_ != "" { | |
| reqHeaders.Set("If-None-Match", c.ifNoneMatch_) | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("GET", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "cloudscheduler.projects.locations.operations.get", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "cloudscheduler.projects.locations.operations.get" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Operation.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Operation{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "cloudscheduler.projects.locations.operations.get", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsOperationsListCall struct { | |
| s *Service | |
| name string | |
| urlParams_ gensupport.URLParams | |
| ifNoneMatch_ string | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // List: Lists operations that match the specified filter in the request. If | |
| // the server doesn't support this method, it returns `UNIMPLEMENTED`. | |
| // | |
| // - name: The name of the operation's parent resource. | |
| func (r *ProjectsLocationsOperationsService) List(name string) *ProjectsLocationsOperationsListCall { | |
| c := &ProjectsLocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| return c | |
| } | |
| // Filter sets the optional parameter "filter": The standard list filter. | |
| func (c *ProjectsLocationsOperationsListCall) Filter(filter string) *ProjectsLocationsOperationsListCall { | |
| c.urlParams_.Set("filter", filter) | |
| return c | |
| } | |
| // PageSize sets the optional parameter "pageSize": The standard list page | |
| // size. | |
| func (c *ProjectsLocationsOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsOperationsListCall { | |
| c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) | |
| return c | |
| } | |
| // PageToken sets the optional parameter "pageToken": The standard list page | |
| // token. | |
| func (c *ProjectsLocationsOperationsListCall) PageToken(pageToken string) *ProjectsLocationsOperationsListCall { | |
| c.urlParams_.Set("pageToken", pageToken) | |
| return c | |
| } | |
| // ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": | |
| // When set to `true`, operations that are reachable are returned as normal, | |
| // and those that are unreachable are returned in the | |
| // ListOperationsResponse.unreachable field. This can only be `true` when | |
| // reading across collections. For example, when `parent` is set to | |
| // "projects/example/locations/-". This field is not supported by default and | |
| // will result in an `UNIMPLEMENTED` error if set unless explicitly documented | |
| // otherwise in service or product specific documentation. | |
| func (c *ProjectsLocationsOperationsListCall) ReturnPartialSuccess(returnPartialSuccess bool) *ProjectsLocationsOperationsListCall { | |
| c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsListCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // IfNoneMatch sets an optional parameter which makes the operation fail if the | |
| // object's ETag matches the given value. This is useful for getting updates | |
| // only after the object has changed since the last request. | |
| func (c *ProjectsLocationsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsListCall { | |
| c.ifNoneMatch_ = entityTag | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsOperationsListCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsOperationsListCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| if c.ifNoneMatch_ != "" { | |
| reqHeaders.Set("If-None-Match", c.ifNoneMatch_) | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("GET", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "cloudscheduler.projects.locations.operations.list", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "cloudscheduler.projects.locations.operations.list" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *ListOperationsResponse.ServerResponse.Header or (if a response was returned | |
| // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to | |
| // check whether the returned error was because http.StatusNotModified was | |
| // returned. | |
| func (c *ProjectsLocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &ListOperationsResponse{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "cloudscheduler.projects.locations.operations.list", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| // Pages invokes f for each page of results. | |
| // A non-nil error returned from f will halt the iteration. | |
| // The provided context supersedes any context provided to the Context method. | |
| func (c *ProjectsLocationsOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error { | |
| c.ctx_ = ctx | |
| defer c.PageToken(c.urlParams_.Get("pageToken")) | |
| for { | |
| x, err := c.Do() | |
| if err != nil { | |
| return err | |
| } | |
| if err := f(x); err != nil { | |
| return err | |
| } | |
| if x.NextPageToken == "" { | |
| return nil | |
| } | |
| c.PageToken(x.NextPageToken) | |
| } | |
| } |