campaign_experiment_service.proto 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374
  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/enums/response_content_type.proto";
  17. import "google/ads/googleads/v11/resources/campaign_experiment.proto";
  18. import "google/api/annotations.proto";
  19. import "google/api/client.proto";
  20. import "google/api/field_behavior.proto";
  21. import "google/api/resource.proto";
  22. import "google/longrunning/operations.proto";
  23. import "google/protobuf/empty.proto";
  24. import "google/protobuf/field_mask.proto";
  25. import "google/rpc/status.proto";
  26. option csharp_namespace = "Google.Ads.GoogleAds.V11.Services";
  27. option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v11/services;services";
  28. option java_multiple_files = true;
  29. option java_outer_classname = "CampaignExperimentServiceProto";
  30. option java_package = "com.google.ads.googleads.v11.services";
  31. option objc_class_prefix = "GAA";
  32. option php_namespace = "Google\\Ads\\GoogleAds\\V11\\Services";
  33. option ruby_package = "Google::Ads::GoogleAds::V11::Services";
  34. // Proto file describing the Campaign Experiment service.
  35. // CampaignExperimentService manages the life cycle of campaign experiments.
  36. // It is used to create new experiments from drafts, modify experiment
  37. // properties, promote changes in an experiment back to its base campaign,
  38. // graduate experiments into new stand-alone campaigns, and to remove an
  39. // experiment.
  40. //
  41. // An experiment consists of two variants or arms - the base campaign and the
  42. // experiment campaign, directing a fixed share of traffic to each arm.
  43. // A campaign experiment is created from a draft of changes to the base campaign
  44. // and will be a snapshot of changes in the draft at the time of creation.
  45. service CampaignExperimentService {
  46. option (google.api.default_host) = "googleads.googleapis.com";
  47. option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/adwords";
  48. // Creates a campaign experiment based on a campaign draft. The draft campaign
  49. // will be forked into a real campaign (called the experiment campaign) that
  50. // will begin serving ads if successfully created.
  51. //
  52. // The campaign experiment is created immediately with status INITIALIZING.
  53. // This method return a long running operation that tracks the forking of the
  54. // draft campaign. If the forking fails, a list of errors can be retrieved
  55. // using the ListCampaignExperimentAsyncErrors method. The operation's
  56. // metadata will be a StringValue containing the resource name of the created
  57. // campaign experiment.
  58. //
  59. // List of thrown errors:
  60. // [AuthenticationError]()
  61. // [AuthorizationError]()
  62. // [CampaignExperimentError]()
  63. // [DatabaseError]()
  64. // [DateError]()
  65. // [DateRangeError]()
  66. // [FieldError]()
  67. // [HeaderError]()
  68. // [InternalError]()
  69. // [QuotaError]()
  70. // [RangeError]()
  71. // [RequestError]()
  72. rpc CreateCampaignExperiment(CreateCampaignExperimentRequest) returns (google.longrunning.Operation) {
  73. option (google.api.http) = {
  74. post: "/v11/customers/{customer_id=*}/campaignExperiments:create"
  75. body: "*"
  76. };
  77. option (google.api.method_signature) = "customer_id,campaign_experiment";
  78. option (google.longrunning.operation_info) = {
  79. response_type: "google.protobuf.Empty"
  80. metadata_type: "google.ads.googleads.v11.services.CreateCampaignExperimentMetadata"
  81. };
  82. }
  83. // Updates campaign experiments. Operation statuses are returned.
  84. //
  85. // List of thrown errors:
  86. // [AuthenticationError]()
  87. // [AuthorizationError]()
  88. // [CampaignExperimentError]()
  89. // [HeaderError]()
  90. // [InternalError]()
  91. // [QuotaError]()
  92. // [RequestError]()
  93. rpc MutateCampaignExperiments(MutateCampaignExperimentsRequest) returns (MutateCampaignExperimentsResponse) {
  94. option (google.api.http) = {
  95. post: "/v11/customers/{customer_id=*}/campaignExperiments:mutate"
  96. body: "*"
  97. };
  98. option (google.api.method_signature) = "customer_id,operations";
  99. }
  100. // Graduates a campaign experiment to a full campaign. The base and experiment
  101. // campaigns will start running independently with their own budgets.
  102. //
  103. // List of thrown errors:
  104. // [AuthenticationError]()
  105. // [AuthorizationError]()
  106. // [CampaignExperimentError]()
  107. // [HeaderError]()
  108. // [InternalError]()
  109. // [MutateError]()
  110. // [QuotaError]()
  111. // [RequestError]()
  112. rpc GraduateCampaignExperiment(GraduateCampaignExperimentRequest) returns (GraduateCampaignExperimentResponse) {
  113. option (google.api.http) = {
  114. post: "/v11/{campaign_experiment=customers/*/campaignExperiments/*}:graduate"
  115. body: "*"
  116. };
  117. option (google.api.method_signature) = "campaign_experiment,campaign_budget";
  118. }
  119. // Promotes the changes in a experiment campaign back to the base campaign.
  120. //
  121. // The campaign experiment is updated immediately with status PROMOTING.
  122. // This method return a long running operation that tracks the promoting of
  123. // the experiment campaign. If the promoting fails, a list of errors can be
  124. // retrieved using the ListCampaignExperimentAsyncErrors method.
  125. //
  126. // List of thrown errors:
  127. // [AuthenticationError]()
  128. // [AuthorizationError]()
  129. // [HeaderError]()
  130. // [InternalError]()
  131. // [QuotaError]()
  132. // [RequestError]()
  133. rpc PromoteCampaignExperiment(PromoteCampaignExperimentRequest) returns (google.longrunning.Operation) {
  134. option (google.api.http) = {
  135. post: "/v11/{campaign_experiment=customers/*/campaignExperiments/*}:promote"
  136. body: "*"
  137. };
  138. option (google.api.method_signature) = "campaign_experiment";
  139. option (google.longrunning.operation_info) = {
  140. response_type: "google.protobuf.Empty"
  141. metadata_type: "google.protobuf.Empty"
  142. };
  143. }
  144. // Immediately ends a campaign experiment, changing the experiment's scheduled
  145. // end date and without waiting for end of day. End date is updated to be the
  146. // time of the request.
  147. //
  148. // List of thrown errors:
  149. // [AuthenticationError]()
  150. // [AuthorizationError]()
  151. // [CampaignExperimentError]()
  152. // [HeaderError]()
  153. // [InternalError]()
  154. // [QuotaError]()
  155. // [RequestError]()
  156. rpc EndCampaignExperiment(EndCampaignExperimentRequest) returns (google.protobuf.Empty) {
  157. option (google.api.http) = {
  158. post: "/v11/{campaign_experiment=customers/*/campaignExperiments/*}:end"
  159. body: "*"
  160. };
  161. option (google.api.method_signature) = "campaign_experiment";
  162. }
  163. // Returns all errors that occurred during CampaignExperiment create or
  164. // promote (whichever occurred last).
  165. // Supports standard list paging.
  166. //
  167. // List of thrown errors:
  168. // [AuthenticationError]()
  169. // [AuthorizationError]()
  170. // [HeaderError]()
  171. // [InternalError]()
  172. // [QuotaError]()
  173. // [RequestError]()
  174. rpc ListCampaignExperimentAsyncErrors(ListCampaignExperimentAsyncErrorsRequest) returns (ListCampaignExperimentAsyncErrorsResponse) {
  175. option (google.api.http) = {
  176. get: "/v11/{resource_name=customers/*/campaignExperiments/*}:listAsyncErrors"
  177. };
  178. option (google.api.method_signature) = "resource_name";
  179. }
  180. }
  181. // Request message for [CampaignExperimentService.MutateCampaignExperiments][google.ads.googleads.v11.services.CampaignExperimentService.MutateCampaignExperiments].
  182. message MutateCampaignExperimentsRequest {
  183. // Required. The ID of the customer whose campaign experiments are being modified.
  184. string customer_id = 1 [(google.api.field_behavior) = REQUIRED];
  185. // Required. The list of operations to perform on individual campaign experiments.
  186. repeated CampaignExperimentOperation operations = 2 [(google.api.field_behavior) = REQUIRED];
  187. // If true, successful operations will be carried out and invalid
  188. // operations will return errors. If false, all operations will be carried
  189. // out in one transaction if and only if they are all valid.
  190. // Default is false.
  191. bool partial_failure = 3;
  192. // If true, the request is validated but not executed. Only errors are
  193. // returned, not results.
  194. bool validate_only = 4;
  195. // The response content type setting. Determines whether the mutable resource
  196. // or just the resource name should be returned post mutation.
  197. google.ads.googleads.v11.enums.ResponseContentTypeEnum.ResponseContentType response_content_type = 5;
  198. }
  199. // A single update operation on a campaign experiment.
  200. message CampaignExperimentOperation {
  201. // FieldMask that determines which resource fields are modified in an update.
  202. google.protobuf.FieldMask update_mask = 3;
  203. // The mutate operation.
  204. oneof operation {
  205. // Update operation: The campaign experiment is expected to have a valid
  206. // resource name.
  207. google.ads.googleads.v11.resources.CampaignExperiment update = 1;
  208. // Remove operation: The campaign experiment is expected to have a valid
  209. // resource name, in this format:
  210. //
  211. // `customers/{customer_id}/campaignExperiments/{campaign_experiment_id}`
  212. string remove = 2 [(google.api.resource_reference) = {
  213. type: "googleads.googleapis.com/CampaignExperiment"
  214. }];
  215. }
  216. }
  217. // Response message for campaign experiment mutate.
  218. message MutateCampaignExperimentsResponse {
  219. // Errors that pertain to operation failures in the partial failure mode.
  220. // Returned only when partial_failure = true and all errors occur inside the
  221. // operations. If any errors occur outside the operations (for example, auth
  222. // errors), we return an RPC level error.
  223. google.rpc.Status partial_failure_error = 3;
  224. // All results for the mutate.
  225. repeated MutateCampaignExperimentResult results = 2;
  226. }
  227. // The result for the campaign experiment mutate.
  228. message MutateCampaignExperimentResult {
  229. // Returned for successful operations.
  230. string resource_name = 1 [(google.api.resource_reference) = {
  231. type: "googleads.googleapis.com/CampaignExperiment"
  232. }];
  233. // The mutated campaign experiment with only mutable fields after mutate. The
  234. // field will only be returned when response_content_type is set to
  235. // "MUTABLE_RESOURCE".
  236. google.ads.googleads.v11.resources.CampaignExperiment campaign_experiment = 2;
  237. }
  238. // Request message for [CampaignExperimentService.CreateCampaignExperiment][google.ads.googleads.v11.services.CampaignExperimentService.CreateCampaignExperiment].
  239. message CreateCampaignExperimentRequest {
  240. // Required. The ID of the customer whose campaign experiment is being created.
  241. string customer_id = 1 [(google.api.field_behavior) = REQUIRED];
  242. // Required. The campaign experiment to be created.
  243. google.ads.googleads.v11.resources.CampaignExperiment campaign_experiment = 2 [(google.api.field_behavior) = REQUIRED];
  244. // If true, the request is validated but not executed. Only errors are
  245. // returned, not results.
  246. bool validate_only = 3;
  247. }
  248. // Message used as metadata returned in Long Running Operations for
  249. // CreateCampaignExperimentRequest
  250. message CreateCampaignExperimentMetadata {
  251. // Resource name of campaign experiment created.
  252. string campaign_experiment = 1;
  253. }
  254. // Request message for [CampaignExperimentService.GraduateCampaignExperiment][google.ads.googleads.v11.services.CampaignExperimentService.GraduateCampaignExperiment].
  255. message GraduateCampaignExperimentRequest {
  256. // Required. The resource name of the campaign experiment to graduate.
  257. string campaign_experiment = 1 [
  258. (google.api.field_behavior) = REQUIRED,
  259. (google.api.resource_reference) = {
  260. type: "googleads.googleapis.com/CampaignExperiment"
  261. }
  262. ];
  263. // Required. Resource name of the budget to attach to the campaign graduated from the
  264. // experiment.
  265. string campaign_budget = 2 [(google.api.field_behavior) = REQUIRED];
  266. // If true, the request is validated but not executed. Only errors are
  267. // returned, not results.
  268. bool validate_only = 3;
  269. }
  270. // Response message for campaign experiment graduate.
  271. message GraduateCampaignExperimentResponse {
  272. // The resource name of the campaign from the graduated experiment.
  273. // This campaign is the same one as CampaignExperiment.experiment_campaign.
  274. string graduated_campaign = 1;
  275. }
  276. // Request message for [CampaignExperimentService.PromoteCampaignExperiment][google.ads.googleads.v11.services.CampaignExperimentService.PromoteCampaignExperiment].
  277. message PromoteCampaignExperimentRequest {
  278. // Required. The resource name of the campaign experiment to promote.
  279. string campaign_experiment = 1 [
  280. (google.api.field_behavior) = REQUIRED,
  281. (google.api.resource_reference) = {
  282. type: "googleads.googleapis.com/CampaignExperiment"
  283. }
  284. ];
  285. // If true, the request is validated but no Long Running Operation is created.
  286. // Only errors are returned.
  287. bool validate_only = 2;
  288. }
  289. // Request message for [CampaignExperimentService.EndCampaignExperiment][google.ads.googleads.v11.services.CampaignExperimentService.EndCampaignExperiment].
  290. message EndCampaignExperimentRequest {
  291. // Required. The resource name of the campaign experiment to end.
  292. string campaign_experiment = 1 [
  293. (google.api.field_behavior) = REQUIRED,
  294. (google.api.resource_reference) = {
  295. type: "googleads.googleapis.com/CampaignExperiment"
  296. }
  297. ];
  298. // If true, the request is validated but not executed. Only errors are
  299. // returned, not results.
  300. bool validate_only = 2;
  301. }
  302. // Request message for
  303. // [CampaignExperimentService.ListCampaignExperimentAsyncErrors][google.ads.googleads.v11.services.CampaignExperimentService.ListCampaignExperimentAsyncErrors].
  304. message ListCampaignExperimentAsyncErrorsRequest {
  305. // Required. The name of the campaign experiment from which to retrieve the async
  306. // errors.
  307. string resource_name = 1 [
  308. (google.api.field_behavior) = REQUIRED,
  309. (google.api.resource_reference) = {
  310. type: "googleads.googleapis.com/CampaignExperiment"
  311. }
  312. ];
  313. // Token of the page to retrieve. If not specified, the first
  314. // page of results will be returned. Use the value obtained from
  315. // `next_page_token` in the previous response in order to request
  316. // the next page of results.
  317. string page_token = 2;
  318. // Number of elements to retrieve in a single page.
  319. // When a page request is too large, the server may decide to
  320. // further limit the number of returned resources.
  321. int32 page_size = 3;
  322. }
  323. // Response message for
  324. // [CampaignExperimentService.ListCampaignExperimentAsyncErrors][google.ads.googleads.v11.services.CampaignExperimentService.ListCampaignExperimentAsyncErrors].
  325. message ListCampaignExperimentAsyncErrorsResponse {
  326. // Details of the errors when performing the asynchronous operation.
  327. repeated google.rpc.Status errors = 1;
  328. // Pagination token used to retrieve the next page of results.
  329. // Pass the content of this string as the `page_token` attribute of
  330. // the next request. `next_page_token` is not returned for the last
  331. // page.
  332. string next_page_token = 2;
  333. }