experiment_service.proto 14 KB

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