xref: /aosp_15_r20/external/googleapis/google/ads/googleads/v16/services/experiment_service.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.v16.services;
18
19import "google/ads/googleads/v16/resources/experiment.proto";
20import "google/api/annotations.proto";
21import "google/api/client.proto";
22import "google/api/field_behavior.proto";
23import "google/api/resource.proto";
24import "google/longrunning/operations.proto";
25import "google/protobuf/empty.proto";
26import "google/protobuf/field_mask.proto";
27import "google/rpc/status.proto";
28
29option csharp_namespace = "Google.Ads.GoogleAds.V16.Services";
30option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v16/services;services";
31option java_multiple_files = true;
32option java_outer_classname = "ExperimentServiceProto";
33option java_package = "com.google.ads.googleads.v16.services";
34option objc_class_prefix = "GAA";
35option php_namespace = "Google\\Ads\\GoogleAds\\V16\\Services";
36option ruby_package = "Google::Ads::GoogleAds::V16::Services";
37
38// Proto file describing the Experiment service.
39
40// Service to manage experiments.
41service ExperimentService {
42  option (google.api.default_host) = "googleads.googleapis.com";
43  option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/adwords";
44
45  // Creates, updates, or removes experiments. Operation statuses are returned.
46  //
47  // List of thrown errors:
48  //   [AuthenticationError]()
49  //   [AuthorizationError]()
50  //   [ExperimentError]()
51  //   [HeaderError]()
52  //   [InternalError]()
53  //   [QuotaError]()
54  //   [RequestError]()
55  rpc MutateExperiments(MutateExperimentsRequest)
56      returns (MutateExperimentsResponse) {
57    option (google.api.http) = {
58      post: "/v16/customers/{customer_id=*}/experiments:mutate"
59      body: "*"
60    };
61    option (google.api.method_signature) = "customer_id,operations";
62  }
63
64  // Immediately ends an experiment, changing the experiment's scheduled
65  // end date and without waiting for end of day. End date is updated to be the
66  // time of the request.
67  //
68  // List of thrown errors:
69  //   [AuthenticationError]()
70  //   [AuthorizationError]()
71  //   [ExperimentError]()
72  //   [HeaderError]()
73  //   [InternalError]()
74  //   [QuotaError]()
75  //   [RequestError]()
76  rpc EndExperiment(EndExperimentRequest) returns (google.protobuf.Empty) {
77    option (google.api.http) = {
78      post: "/v16/{experiment=customers/*/experiments/*}:endExperiment"
79      body: "*"
80    };
81    option (google.api.method_signature) = "experiment";
82  }
83
84  // Returns all errors that occurred during the last Experiment update (either
85  // scheduling or promotion).
86  // Supports standard list paging.
87  //
88  // List of thrown errors:
89  //   [AuthenticationError]()
90  //   [AuthorizationError]()
91  //   [HeaderError]()
92  //   [InternalError]()
93  //   [QuotaError]()
94  //   [RequestError]()
95  rpc ListExperimentAsyncErrors(ListExperimentAsyncErrorsRequest)
96      returns (ListExperimentAsyncErrorsResponse) {
97    option (google.api.http) = {
98      get: "/v16/{resource_name=customers/*/experiments/*}:listExperimentAsyncErrors"
99    };
100    option (google.api.method_signature) = "resource_name";
101  }
102
103  // Graduates an experiment to a full campaign.
104  //
105  // List of thrown errors:
106  //   [AuthenticationError]()
107  //   [AuthorizationError]()
108  //   [ExperimentError]()
109  //   [HeaderError]()
110  //   [InternalError]()
111  //   [MutateError]()
112  //   [QuotaError]()
113  //   [RequestError]()
114  rpc GraduateExperiment(GraduateExperimentRequest)
115      returns (google.protobuf.Empty) {
116    option (google.api.http) = {
117      post: "/v16/{experiment=customers/*/experiments/*}:graduateExperiment"
118      body: "*"
119    };
120    option (google.api.method_signature) =
121        "experiment,campaign_budget_mappings";
122  }
123
124  // Schedule an experiment. The in design campaign
125  // will be converted into a real campaign (called the experiment campaign)
126  // that will begin serving ads if successfully created.
127  //
128  // The experiment is scheduled immediately with status INITIALIZING.
129  // This method returns a long running operation that tracks the forking of the
130  // in design campaign. If the forking fails, a list of errors can be retrieved
131  // using the ListExperimentAsyncErrors method. The operation's
132  // metadata will be a string containing the resource name of the created
133  // experiment.
134  //
135  // List of thrown errors:
136  //   [AuthenticationError]()
137  //   [AuthorizationError]()
138  //   [ExperimentError]()
139  //   [DatabaseError]()
140  //   [DateError]()
141  //   [DateRangeError]()
142  //   [FieldError]()
143  //   [HeaderError]()
144  //   [InternalError]()
145  //   [QuotaError]()
146  //   [RangeError]()
147  //   [RequestError]()
148  rpc ScheduleExperiment(ScheduleExperimentRequest)
149      returns (google.longrunning.Operation) {
150    option (google.api.http) = {
151      post: "/v16/{resource_name=customers/*/experiments/*}:scheduleExperiment"
152      body: "*"
153    };
154    option (google.api.method_signature) = "resource_name";
155    option (google.longrunning.operation_info) = {
156      response_type: "google.protobuf.Empty"
157      metadata_type: "google.ads.googleads.v16.services.ScheduleExperimentMetadata"
158    };
159  }
160
161  // Promotes the trial campaign thus applying changes in the trial campaign
162  // to the base campaign.
163  // This method returns a long running operation that tracks the promotion of
164  // the experiment campaign. If it fails, a list of errors can be retrieved
165  // using the ListExperimentAsyncErrors method. The operation's
166  // metadata will be a string containing the resource name of the created
167  // experiment.
168  //
169  // List of thrown errors:
170  //   [AuthenticationError]()
171  //   [AuthorizationError]()
172  //   [ExperimentError]()
173  //   [HeaderError]()
174  //   [InternalError]()
175  //   [QuotaError]()
176  //   [RequestError]()
177  rpc PromoteExperiment(PromoteExperimentRequest)
178      returns (google.longrunning.Operation) {
179    option (google.api.http) = {
180      post: "/v16/{resource_name=customers/*/experiments/*}:promoteExperiment"
181      body: "*"
182    };
183    option (google.api.method_signature) = "resource_name";
184    option (google.longrunning.operation_info) = {
185      response_type: "google.protobuf.Empty"
186      metadata_type: "google.ads.googleads.v16.services.PromoteExperimentMetadata"
187    };
188  }
189}
190
191// Request message for
192// [ExperimentService.MutateExperiments][google.ads.googleads.v16.services.ExperimentService.MutateExperiments].
193message MutateExperimentsRequest {
194  // Required. The ID of the customer whose experiments are being modified.
195  string customer_id = 1 [(google.api.field_behavior) = REQUIRED];
196
197  // Required. The list of operations to perform on individual experiments.
198  repeated ExperimentOperation operations = 2
199      [(google.api.field_behavior) = REQUIRED];
200
201  // If true, successful operations will be carried out and invalid
202  // operations will return errors. If false, all operations will be carried
203  // out in one transaction if and only if they are all valid.
204  // Default is false.
205  bool partial_failure = 3;
206
207  // If true, the request is validated but not executed. Only errors are
208  // returned, not results.
209  bool validate_only = 4;
210}
211
212// A single operation on an experiment.
213message ExperimentOperation {
214  // FieldMask that determines which resource fields are modified in an update.
215  google.protobuf.FieldMask update_mask = 4;
216
217  // The mutate operation.
218  oneof operation {
219    // Create operation
220    google.ads.googleads.v16.resources.Experiment create = 1;
221
222    // Update operation: The experiment is expected to have a valid
223    // resource name.
224    google.ads.googleads.v16.resources.Experiment update = 2;
225
226    // Remove operation: The experiment is expected to have a valid
227    // resource name, in this format:
228    //
229    // `customers/{customer_id}/experiments/{campaign_experiment_id}`
230    string remove = 3 [(google.api.resource_reference) = {
231      type: "googleads.googleapis.com/Experiment"
232    }];
233  }
234}
235
236// Response message for experiment mutate.
237message MutateExperimentsResponse {
238  // Errors that pertain to operation failures in the partial failure mode.
239  // Returned only when partial_failure = true and all errors occur inside the
240  // operations. If any errors occur outside the operations (for example, auth
241  // errors), we return an RPC level error.
242  google.rpc.Status partial_failure_error = 1;
243
244  // All results for the mutate.
245  repeated MutateExperimentResult results = 2;
246}
247
248// The result for the campaign experiment mutate.
249message MutateExperimentResult {
250  // Returned for successful operations.
251  string resource_name = 1 [(google.api.resource_reference) = {
252    type: "googleads.googleapis.com/Experiment"
253  }];
254}
255
256// Request message for
257// [ExperimentService.EndExperiment][google.ads.googleads.v16.services.ExperimentService.EndExperiment].
258message EndExperimentRequest {
259  // Required. The resource name of the campaign experiment to end.
260  string experiment = 1 [
261    (google.api.field_behavior) = REQUIRED,
262    (google.api.resource_reference) = {
263      type: "googleads.googleapis.com/Experiment"
264    }
265  ];
266
267  // If true, the request is validated but not executed. Only errors are
268  // returned, not results.
269  bool validate_only = 2;
270}
271
272// Request message for
273// [ExperimentService.ListExperimentAsyncErrors][google.ads.googleads.v16.services.ExperimentService.ListExperimentAsyncErrors].
274message ListExperimentAsyncErrorsRequest {
275  // Required. The name of the experiment from which to retrieve the async
276  // errors.
277  string resource_name = 1 [
278    (google.api.field_behavior) = REQUIRED,
279    (google.api.resource_reference) = {
280      type: "googleads.googleapis.com/Experiment"
281    }
282  ];
283
284  // Token of the page to retrieve. If not specified, the first
285  // page of results will be returned. Use the value obtained from
286  // `next_page_token` in the previous response in order to request
287  // the next page of results.
288  string page_token = 2;
289
290  // Number of elements to retrieve in a single page.
291  // When a page request is too large, the server may decide to
292  // further limit the number of returned resources.
293  // The maximum page size is 1000.
294  int32 page_size = 3;
295}
296
297// Response message for
298// [ExperimentService.ListExperimentAsyncErrors][google.ads.googleads.v16.services.ExperimentService.ListExperimentAsyncErrors].
299message ListExperimentAsyncErrorsResponse {
300  // details of the errors when performing the asynchronous operation.
301  repeated google.rpc.Status errors = 1;
302
303  // Pagination token used to retrieve the next page of results.
304  // Pass the content of this string as the `page_token` attribute of
305  // the next request. `next_page_token` is not returned for the last
306  // page.
307  string next_page_token = 2;
308}
309
310// Request message for
311// [ExperimentService.GraduateExperiment][google.ads.googleads.v16.services.ExperimentService.GraduateExperiment].
312message GraduateExperimentRequest {
313  // Required. The experiment to be graduated.
314  string experiment = 1 [
315    (google.api.field_behavior) = REQUIRED,
316    (google.api.resource_reference) = {
317      type: "googleads.googleapis.com/Experiment"
318    }
319  ];
320
321  // Required. List of campaign budget mappings for graduation. Each campaign
322  // that appears here will graduate, and will be assigned a new budget that is
323  // paired with it in the mapping. The maximum size is one.
324  repeated CampaignBudgetMapping campaign_budget_mappings = 2
325      [(google.api.field_behavior) = REQUIRED];
326
327  // If true, the request is validated but not executed. Only errors are
328  // returned, not results.
329  bool validate_only = 3;
330}
331
332// The mapping of experiment campaign and budget to be graduated.
333message CampaignBudgetMapping {
334  // Required. The experiment campaign to graduate.
335  string experiment_campaign = 1 [
336    (google.api.field_behavior) = REQUIRED,
337    (google.api.resource_reference) = {
338      type: "googleads.googleapis.com/Campaign"
339    }
340  ];
341
342  // Required. The budget that should be attached to the graduating experiment
343  // campaign.
344  string campaign_budget = 2 [
345    (google.api.field_behavior) = REQUIRED,
346    (google.api.resource_reference) = {
347      type: "googleads.googleapis.com/CampaignBudget"
348    }
349  ];
350}
351
352// Request message for
353// [ExperimentService.ScheduleExperiment][google.ads.googleads.v16.services.ExperimentService.ScheduleExperiment].
354message ScheduleExperimentRequest {
355  // Required. The scheduled experiment.
356  string resource_name = 1 [
357    (google.api.field_behavior) = REQUIRED,
358    (google.api.resource_reference) = {
359      type: "googleads.googleapis.com/Experiment"
360    }
361  ];
362
363  // If true, the request is validated but not executed. Only errors are
364  // returned, not results.
365  bool validate_only = 2;
366}
367
368// The metadata of the scheduled experiment.
369message ScheduleExperimentMetadata {
370  // Required. The scheduled experiment.
371  string experiment = 1 [
372    (google.api.field_behavior) = REQUIRED,
373    (google.api.resource_reference) = {
374      type: "googleads.googleapis.com/Experiment"
375    }
376  ];
377}
378
379// Request message for
380// [ExperimentService.PromoteExperiment][google.ads.googleads.v16.services.ExperimentService.PromoteExperiment].
381message PromoteExperimentRequest {
382  // Required. The resource name of the experiment to promote.
383  string resource_name = 1 [
384    (google.api.field_behavior) = REQUIRED,
385    (google.api.resource_reference) = {
386      type: "googleads.googleapis.com/Experiment"
387    }
388  ];
389
390  // If true, the request is validated but not executed. Only errors are
391  // returned, not results.
392  bool validate_only = 2;
393}
394
395// The metadata of the promoted experiment.
396message PromoteExperimentMetadata {
397  // Required. The promoted experiment.
398  string experiment = 1 [
399    (google.api.field_behavior) = REQUIRED,
400    (google.api.resource_reference) = {
401      type: "googleads.googleapis.com/Experiment"
402    }
403  ];
404}
405