aboutsummaryrefslogtreecommitdiff
path: root/google/ads/googleads/v1/services/mutate_job_service.proto
blob: 42e1fec24eb8de1a50b05293eb25a0f7ecd1fb8c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
// Copyright 2019 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

syntax = "proto3";

package google.ads.googleads.v1.services;

import "google/ads/googleads/v1/resources/mutate_job.proto";
import "google/ads/googleads/v1/services/google_ads_service.proto";
import "google/api/annotations.proto";
import "google/longrunning/operations.proto";
import "google/rpc/status.proto";

option csharp_namespace = "Google.Ads.GoogleAds.V1.Services";
option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v1/services;services";
option java_multiple_files = true;
option java_outer_classname = "MutateJobServiceProto";
option java_package = "com.google.ads.googleads.v1.services";
option objc_class_prefix = "GAA";
option php_namespace = "Google\\Ads\\GoogleAds\\V1\\Services";
option ruby_package = "Google::Ads::GoogleAds::V1::Services";

// Proto file describing the MutateJobService.

// Service to manage mutate jobs.
service MutateJobService {
  // Creates a mutate job.
  rpc CreateMutateJob(CreateMutateJobRequest) returns (CreateMutateJobResponse) {
    option (google.api.http) = {
      post: "/v1/customers/{customer_id=*}/mutateJobs:create"
      body: "*"
    };
  }

  // Returns the mutate job.
  rpc GetMutateJob(GetMutateJobRequest) returns (google.ads.googleads.v1.resources.MutateJob) {
    option (google.api.http) = {
      get: "/v1/{resource_name=customers/*/mutateJobs/*}"
    };
  }

  // Returns the results of the mutate job. The job must be done.
  // Supports standard list paging.
  rpc ListMutateJobResults(ListMutateJobResultsRequest) returns (ListMutateJobResultsResponse) {
    option (google.api.http) = {
      get: "/v1/{resource_name=customers/*/mutateJobs/*}:listResults"
    };
  }

  // Runs the mutate job.
  //
  // The Operation.metadata field type is MutateJobMetadata. When finished, the
  // long running operation will not contain errors or a response. Instead, use
  // ListMutateJobResults to get the results of the job.
  rpc RunMutateJob(RunMutateJobRequest) returns (google.longrunning.Operation) {
    option (google.api.http) = {
      post: "/v1/{resource_name=customers/*/mutateJobs/*}:run"
      body: "*"
    };
  }

  // Add operations to the mutate job.
  rpc AddMutateJobOperations(AddMutateJobOperationsRequest) returns (AddMutateJobOperationsResponse) {
    option (google.api.http) = {
      post: "/v1/{resource_name=customers/*/mutateJobs/*}:addOperations"
      body: "*"
    };
  }
}

// Request message for [MutateJobService.CreateMutateJobRequest][]
message CreateMutateJobRequest {
  // The ID of the customer for which to create a mutate job.
  string customer_id = 1;
}

// Response message for [MutateJobService.CreateMutateJobResponse][]
message CreateMutateJobResponse {
  // The resource name of the MutateJob.
  string resource_name = 1;
}

// Request message for [MutateJobService.GetMutateJob][google.ads.googleads.v1.services.MutateJobService.GetMutateJob]
message GetMutateJobRequest {
  // The resource name of the MutateJob to get.
  string resource_name = 1;
}

// Request message for [MutateJobService.RunMutateJob][google.ads.googleads.v1.services.MutateJobService.RunMutateJob]
message RunMutateJobRequest {
  // The resource name of the MutateJob to run.
  string resource_name = 1;
}

// Request message for [MutateJobService.AddMutateJobOperations][google.ads.googleads.v1.services.MutateJobService.AddMutateJobOperations]
message AddMutateJobOperationsRequest {
  // The resource name of the MutateJob.
  string resource_name = 1;

  // A token used to enforce sequencing.
  //
  // The first AddMutateJobOperations request for a MutateJob should not set
  // sequence_token. Subsequent requests must set sequence_token to the value of
  // next_sequence_token received in the previous AddMutateJobOperations
  // response.
  string sequence_token = 2;

  // The list of mutates being added.
  //
  // Operations can use negative integers as temp ids to signify dependencies
  // between entities created in this MutateJob. For example, a customer with
  // id = 1234 can create a campaign and an ad group in that same campaign by
  // creating a campaign in the first operation with the resource name
  // explicitly set to "customers/1234/campaigns/-1", and creating an ad group
  // in the second operation with the campaign field also set to
  // "customers/1234/campaigns/-1".
  repeated MutateOperation mutate_operations = 3;
}

// Response message for [MutateJobService.AddMutateJobOperations][google.ads.googleads.v1.services.MutateJobService.AddMutateJobOperations]
message AddMutateJobOperationsResponse {
  // The total number of operations added so far for this job.
  int64 total_operations = 1;

  // The sequence token to be used when calling AddMutateJobOperations again if
  // more operations need to be added. The next AddMutateJobOperations request
  // must set the sequence_token field to the value of this field.
  string next_sequence_token = 2;
}

// Request message for [MutateJobService.ListMutateJobResults][google.ads.googleads.v1.services.MutateJobService.ListMutateJobResults].
message ListMutateJobResultsRequest {
  // The resource name of the MutateJob whose results are being listed.
  string resource_name = 1;

  // Token of the page to retrieve. If not specified, the first
  // page of results will be returned. Use the value obtained from
  // `next_page_token` in the previous response in order to request
  // the next page of results.
  string page_token = 2;

  // Number of elements to retrieve in a single page.
  // When a page request is too large, the server may decide to
  // further limit the number of returned resources.
  int32 page_size = 3;
}

// Response message for [MutateJobService.ListMutateJobResults][google.ads.googleads.v1.services.MutateJobService.ListMutateJobResults].
message ListMutateJobResultsResponse {
  // The list of rows that matched the query.
  repeated MutateJobResult results = 1;

  // Pagination token used to retrieve the next page of results.
  // Pass the content of this string as the `page_token` attribute of
  // the next request. `next_page_token` is not returned for the last
  // page.
  string next_page_token = 2;
}

// MutateJob result.
message MutateJobResult {
  // Index of the mutate operation.
  int64 operation_index = 1;

  // Response for the mutate.
  // May be empty if errors occurred.
  MutateOperationResponse mutate_operation_response = 2;

  // Details of the errors when processing the operation.
  google.rpc.Status status = 3;
}