campaign_draft_service.proto 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  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_draft.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/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 = "CampaignDraftServiceProto";
  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 Campaign Draft service.
  34. // Service to manage campaign drafts.
  35. service CampaignDraftService {
  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 campaign drafts. Operation statuses are
  39. // returned.
  40. //
  41. // List of thrown errors:
  42. // [AuthenticationError]()
  43. // [AuthorizationError]()
  44. // [CampaignDraftError]()
  45. // [DatabaseError]()
  46. // [FieldError]()
  47. // [HeaderError]()
  48. // [InternalError]()
  49. // [MutateError]()
  50. // [QuotaError]()
  51. // [RequestError]()
  52. rpc MutateCampaignDrafts(MutateCampaignDraftsRequest) returns (MutateCampaignDraftsResponse) {
  53. option (google.api.http) = {
  54. post: "/v11/customers/{customer_id=*}/campaignDrafts:mutate"
  55. body: "*"
  56. };
  57. option (google.api.method_signature) = "customer_id,operations";
  58. }
  59. // Promotes the changes in a draft back to the base campaign.
  60. //
  61. // This method returns a Long Running Operation (LRO) indicating if the
  62. // Promote is done. Use [Operations.GetOperation] to poll the LRO until it
  63. // is done. Only a done status is returned in the response. See the status
  64. // in the Campaign Draft resource to determine if the promotion was
  65. // successful. If the LRO failed, use
  66. // [CampaignDraftService.ListCampaignDraftAsyncErrors][google.ads.googleads.v11.services.CampaignDraftService.ListCampaignDraftAsyncErrors] to view the list of
  67. // error reasons.
  68. //
  69. // List of thrown errors:
  70. // [AuthenticationError]()
  71. // [AuthorizationError]()
  72. // [CampaignDraftError]()
  73. // [HeaderError]()
  74. // [InternalError]()
  75. // [QuotaError]()
  76. // [RequestError]()
  77. rpc PromoteCampaignDraft(PromoteCampaignDraftRequest) returns (google.longrunning.Operation) {
  78. option (google.api.http) = {
  79. post: "/v11/{campaign_draft=customers/*/campaignDrafts/*}:promote"
  80. body: "*"
  81. };
  82. option (google.api.method_signature) = "campaign_draft";
  83. option (google.longrunning.operation_info) = {
  84. response_type: "google.protobuf.Empty"
  85. metadata_type: "google.protobuf.Empty"
  86. };
  87. }
  88. // Returns all errors that occurred during CampaignDraft promote. Throws an
  89. // error if called before campaign draft is promoted.
  90. // Supports standard list paging.
  91. //
  92. // List of thrown errors:
  93. // [AuthenticationError]()
  94. // [AuthorizationError]()
  95. // [HeaderError]()
  96. // [InternalError]()
  97. // [QuotaError]()
  98. // [RequestError]()
  99. rpc ListCampaignDraftAsyncErrors(ListCampaignDraftAsyncErrorsRequest) returns (ListCampaignDraftAsyncErrorsResponse) {
  100. option (google.api.http) = {
  101. get: "/v11/{resource_name=customers/*/campaignDrafts/*}:listAsyncErrors"
  102. };
  103. option (google.api.method_signature) = "resource_name";
  104. }
  105. }
  106. // Request message for [CampaignDraftService.MutateCampaignDrafts][google.ads.googleads.v11.services.CampaignDraftService.MutateCampaignDrafts].
  107. message MutateCampaignDraftsRequest {
  108. // Required. The ID of the customer whose campaign drafts are being modified.
  109. string customer_id = 1 [(google.api.field_behavior) = REQUIRED];
  110. // Required. The list of operations to perform on individual campaign drafts.
  111. repeated CampaignDraftOperation operations = 2 [(google.api.field_behavior) = REQUIRED];
  112. // If true, successful operations will be carried out and invalid
  113. // operations will return errors. If false, all operations will be carried
  114. // out in one transaction if and only if they are all valid.
  115. // Default is false.
  116. bool partial_failure = 3;
  117. // If true, the request is validated but not executed. Only errors are
  118. // returned, not results.
  119. bool validate_only = 4;
  120. // The response content type setting. Determines whether the mutable resource
  121. // or just the resource name should be returned post mutation.
  122. google.ads.googleads.v11.enums.ResponseContentTypeEnum.ResponseContentType response_content_type = 5;
  123. }
  124. // Request message for [CampaignDraftService.PromoteCampaignDraft][google.ads.googleads.v11.services.CampaignDraftService.PromoteCampaignDraft].
  125. message PromoteCampaignDraftRequest {
  126. // Required. The resource name of the campaign draft to promote.
  127. string campaign_draft = 1 [
  128. (google.api.field_behavior) = REQUIRED,
  129. (google.api.resource_reference) = {
  130. type: "googleads.googleapis.com/CampaignDraft"
  131. }
  132. ];
  133. // If true, the request is validated but no Long Running Operation is created.
  134. // Only errors are returned.
  135. bool validate_only = 2;
  136. }
  137. // A single operation (create, update, remove) on a campaign draft.
  138. message CampaignDraftOperation {
  139. // FieldMask that determines which resource fields are modified in an update.
  140. google.protobuf.FieldMask update_mask = 4;
  141. // The mutate operation.
  142. oneof operation {
  143. // Create operation: No resource name is expected for the new campaign
  144. // draft.
  145. google.ads.googleads.v11.resources.CampaignDraft create = 1;
  146. // Update operation: The campaign draft is expected to have a valid
  147. // resource name.
  148. google.ads.googleads.v11.resources.CampaignDraft update = 2;
  149. // Remove operation: The campaign draft is expected to have a valid
  150. // resource name, in this format:
  151. //
  152. // `customers/{customer_id}/campaignDrafts/{base_campaign_id}~{draft_id}`
  153. string remove = 3 [(google.api.resource_reference) = {
  154. type: "googleads.googleapis.com/CampaignDraft"
  155. }];
  156. }
  157. }
  158. // Response message for campaign draft mutate.
  159. message MutateCampaignDraftsResponse {
  160. // Errors that pertain to operation failures in the partial failure mode.
  161. // Returned only when partial_failure = true and all errors occur inside the
  162. // operations. If any errors occur outside the operations (for example, auth
  163. // errors), we return an RPC level error.
  164. google.rpc.Status partial_failure_error = 3;
  165. // All results for the mutate.
  166. repeated MutateCampaignDraftResult results = 2;
  167. }
  168. // The result for the campaign draft mutate.
  169. message MutateCampaignDraftResult {
  170. // Returned for successful operations.
  171. string resource_name = 1 [(google.api.resource_reference) = {
  172. type: "googleads.googleapis.com/CampaignDraft"
  173. }];
  174. // The mutated campaign draft with only mutable fields after mutate. The field
  175. // will only be returned when response_content_type is set to
  176. // "MUTABLE_RESOURCE".
  177. google.ads.googleads.v11.resources.CampaignDraft campaign_draft = 2;
  178. }
  179. // Request message for [CampaignDraftService.ListCampaignDraftAsyncErrors][google.ads.googleads.v11.services.CampaignDraftService.ListCampaignDraftAsyncErrors].
  180. message ListCampaignDraftAsyncErrorsRequest {
  181. // Required. The name of the campaign draft from which to retrieve the async errors.
  182. string resource_name = 1 [
  183. (google.api.field_behavior) = REQUIRED,
  184. (google.api.resource_reference) = {
  185. type: "googleads.googleapis.com/CampaignDraft"
  186. }
  187. ];
  188. // Token of the page to retrieve. If not specified, the first
  189. // page of results will be returned. Use the value obtained from
  190. // `next_page_token` in the previous response in order to request
  191. // the next page of results.
  192. string page_token = 2;
  193. // Number of elements to retrieve in a single page.
  194. // When a page request is too large, the server may decide to
  195. // further limit the number of returned resources.
  196. int32 page_size = 3;
  197. }
  198. // Response message for [CampaignDraftService.ListCampaignDraftAsyncErrors][google.ads.googleads.v11.services.CampaignDraftService.ListCampaignDraftAsyncErrors].
  199. message ListCampaignDraftAsyncErrorsResponse {
  200. // Details of the errors when performing the asynchronous operation.
  201. repeated google.rpc.Status errors = 1;
  202. // Pagination token used to retrieve the next page of results.
  203. // Pass the content of this string as the `page_token` attribute of
  204. // the next request. `next_page_token` is not returned for the last
  205. // page.
  206. string next_page_token = 2;
  207. }