xref: /aosp_15_r20/external/googleapis/google/ads/googleads/v14/resources/batch_job.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
1// Copyright 2023 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15syntax = "proto3";
16
17package google.ads.googleads.v14.resources;
18
19import "google/ads/googleads/v14/enums/batch_job_status.proto";
20import "google/api/field_behavior.proto";
21import "google/api/resource.proto";
22
23option csharp_namespace = "Google.Ads.GoogleAds.V14.Resources";
24option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v14/resources;resources";
25option java_multiple_files = true;
26option java_outer_classname = "BatchJobProto";
27option java_package = "com.google.ads.googleads.v14.resources";
28option objc_class_prefix = "GAA";
29option php_namespace = "Google\\Ads\\GoogleAds\\V14\\Resources";
30option ruby_package = "Google::Ads::GoogleAds::V14::Resources";
31
32// Proto file describing the batch job resource.
33
34// A list of mutates being processed asynchronously. The mutates are uploaded
35// by the user. The mutates themselves aren't readable and the results of the
36// job can only be read using BatchJobService.ListBatchJobResults.
37message BatchJob {
38  option (google.api.resource) = {
39    type: "googleads.googleapis.com/BatchJob"
40    pattern: "customers/{customer_id}/batchJobs/{batch_job_id}"
41  };
42
43  // Additional information about the batch job. This message is also used as
44  // metadata returned in batch job Long Running Operations.
45  message BatchJobMetadata {
46    // Output only. The time when this batch job was created.
47    // Formatted as yyyy-mm-dd hh:mm:ss. Example: "2018-03-05 09:15:00"
48    optional string creation_date_time = 8
49        [(google.api.field_behavior) = OUTPUT_ONLY];
50
51    // Output only. The time when this batch job started running.
52    // Formatted as yyyy-mm-dd hh:mm:ss. Example: "2018-03-05 09:15:30"
53    optional string start_date_time = 7
54        [(google.api.field_behavior) = OUTPUT_ONLY];
55
56    // Output only. The time when this batch job was completed.
57    // Formatted as yyyy-MM-dd HH:mm:ss. Example: "2018-03-05 09:16:00"
58    optional string completion_date_time = 9
59        [(google.api.field_behavior) = OUTPUT_ONLY];
60
61    // Output only. The fraction (between 0.0 and 1.0) of mutates that have been
62    // processed. This is empty if the job hasn't started running yet.
63    optional double estimated_completion_ratio = 10
64        [(google.api.field_behavior) = OUTPUT_ONLY];
65
66    // Output only. The number of mutate operations in the batch job.
67    optional int64 operation_count = 11
68        [(google.api.field_behavior) = OUTPUT_ONLY];
69
70    // Output only. The number of mutate operations executed by the batch job.
71    // Present only if the job has started running.
72    optional int64 executed_operation_count = 12
73        [(google.api.field_behavior) = OUTPUT_ONLY];
74
75    // Immutable. The approximate upper bound for how long a batch job can be
76    // executed, in seconds. If the job runs more than the given upper bound,
77    // the job will be canceled.
78    optional int32 execution_limit_seconds = 13
79        [(google.api.field_behavior) = IMMUTABLE];
80  }
81
82  // Immutable. The resource name of the batch job.
83  // Batch job resource names have the form:
84  //
85  // `customers/{customer_id}/batchJobs/{batch_job_id}`
86  string resource_name = 1 [
87    (google.api.field_behavior) = IMMUTABLE,
88    (google.api.resource_reference) = {
89      type: "googleads.googleapis.com/BatchJob"
90    }
91  ];
92
93  // Output only. ID of this batch job.
94  optional int64 id = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
95
96  // Output only. The next sequence token to use when adding operations. Only
97  // set when the batch job status is PENDING.
98  optional string next_add_sequence_token = 8
99      [(google.api.field_behavior) = OUTPUT_ONLY];
100
101  // Output only. Contains additional information about this batch job.
102  BatchJobMetadata metadata = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
103
104  // Output only. Status of this batch job.
105  google.ads.googleads.v14.enums.BatchJobStatusEnum.BatchJobStatus status = 5
106      [(google.api.field_behavior) = OUTPUT_ONLY];
107
108  // Output only. The resource name of the long-running operation that can be
109  // used to poll for completion. Only set when the batch job status is RUNNING
110  // or DONE.
111  optional string long_running_operation = 9
112      [(google.api.field_behavior) = OUTPUT_ONLY];
113}
114