ad_group_ad_service.proto 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  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.v12.services;
  16. import "google/ads/googleads/v12/common/policy.proto";
  17. import "google/ads/googleads/v12/enums/response_content_type.proto";
  18. import "google/ads/googleads/v12/resources/ad_group_ad.proto";
  19. import "google/api/annotations.proto";
  20. import "google/api/client.proto";
  21. import "google/api/field_behavior.proto";
  22. import "google/api/resource.proto";
  23. import "google/protobuf/field_mask.proto";
  24. import "google/rpc/status.proto";
  25. option csharp_namespace = "Google.Ads.GoogleAds.V12.Services";
  26. option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v12/services;services";
  27. option java_multiple_files = true;
  28. option java_outer_classname = "AdGroupAdServiceProto";
  29. option java_package = "com.google.ads.googleads.v12.services";
  30. option objc_class_prefix = "GAA";
  31. option php_namespace = "Google\\Ads\\GoogleAds\\V12\\Services";
  32. option ruby_package = "Google::Ads::GoogleAds::V12::Services";
  33. // Proto file describing the Ad Group Ad service.
  34. // Service to manage ads in an ad group.
  35. service AdGroupAdService {
  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 ads. Operation statuses are returned.
  39. //
  40. // List of thrown errors:
  41. // [AdCustomizerError]()
  42. // [AdError]()
  43. // [AdGroupAdError]()
  44. // [AdSharingError]()
  45. // [AdxError]()
  46. // [AssetError]()
  47. // [AssetLinkError]()
  48. // [AuthenticationError]()
  49. // [AuthorizationError]()
  50. // [CollectionSizeError]()
  51. // [ContextError]()
  52. // [DatabaseError]()
  53. // [DateError]()
  54. // [DistinctError]()
  55. // [FeedAttributeReferenceError]()
  56. // [FieldError]()
  57. // [FieldMaskError]()
  58. // [FunctionError]()
  59. // [FunctionParsingError]()
  60. // [HeaderError]()
  61. // [IdError]()
  62. // [ImageError]()
  63. // [InternalError]()
  64. // [ListOperationError]()
  65. // [MediaBundleError]()
  66. // [MediaFileError]()
  67. // [MutateError]()
  68. // [NewResourceCreationError]()
  69. // [NotEmptyError]()
  70. // [NullError]()
  71. // [OperationAccessDeniedError]()
  72. // [OperatorError]()
  73. // [PolicyFindingError]()
  74. // [PolicyValidationParameterError]()
  75. // [PolicyViolationError]()
  76. // [QuotaError]()
  77. // [RangeError]()
  78. // [RequestError]()
  79. // [ResourceCountLimitExceededError]()
  80. // [SizeLimitError]()
  81. // [StringFormatError]()
  82. // [StringLengthError]()
  83. // [UrlFieldError]()
  84. rpc MutateAdGroupAds(MutateAdGroupAdsRequest) returns (MutateAdGroupAdsResponse) {
  85. option (google.api.http) = {
  86. post: "/v12/customers/{customer_id=*}/adGroupAds:mutate"
  87. body: "*"
  88. };
  89. option (google.api.method_signature) = "customer_id,operations";
  90. }
  91. }
  92. // Request message for [AdGroupAdService.MutateAdGroupAds][google.ads.googleads.v12.services.AdGroupAdService.MutateAdGroupAds].
  93. message MutateAdGroupAdsRequest {
  94. // Required. The ID of the customer whose ads are being modified.
  95. string customer_id = 1 [(google.api.field_behavior) = REQUIRED];
  96. // Required. The list of operations to perform on individual ads.
  97. repeated AdGroupAdOperation operations = 2 [(google.api.field_behavior) = REQUIRED];
  98. // If true, successful operations will be carried out and invalid
  99. // operations will return errors. If false, all operations will be carried
  100. // out in one transaction if and only if they are all valid.
  101. // Default is false.
  102. bool partial_failure = 3;
  103. // If true, the request is validated but not executed. Only errors are
  104. // returned, not results.
  105. bool validate_only = 4;
  106. // The response content type setting. Determines whether the mutable resource
  107. // or just the resource name should be returned post mutation.
  108. google.ads.googleads.v12.enums.ResponseContentTypeEnum.ResponseContentType response_content_type = 5;
  109. }
  110. // A single operation (create, update, remove) on an ad group ad.
  111. message AdGroupAdOperation {
  112. // FieldMask that determines which resource fields are modified in an update.
  113. google.protobuf.FieldMask update_mask = 4;
  114. // Configuration for how policies are validated.
  115. google.ads.googleads.v12.common.PolicyValidationParameter policy_validation_parameter = 5;
  116. // The mutate operation.
  117. oneof operation {
  118. // Create operation: No resource name is expected for the new ad.
  119. google.ads.googleads.v12.resources.AdGroupAd create = 1;
  120. // Update operation: The ad is expected to have a valid resource name.
  121. google.ads.googleads.v12.resources.AdGroupAd update = 2;
  122. // Remove operation: A resource name for the removed ad is expected,
  123. // in this format:
  124. //
  125. // `customers/{customer_id}/adGroupAds/{ad_group_id}~{ad_id}`
  126. string remove = 3 [(google.api.resource_reference) = {
  127. type: "googleads.googleapis.com/AdGroupAd"
  128. }];
  129. }
  130. }
  131. // Response message for an ad group ad mutate.
  132. message MutateAdGroupAdsResponse {
  133. // Errors that pertain to operation failures in the partial failure mode.
  134. // Returned only when partial_failure = true and all errors occur inside the
  135. // operations. If any errors occur outside the operations (for example, auth
  136. // errors), we return an RPC level error.
  137. google.rpc.Status partial_failure_error = 3;
  138. // All results for the mutate.
  139. repeated MutateAdGroupAdResult results = 2;
  140. }
  141. // The result for the ad mutate.
  142. message MutateAdGroupAdResult {
  143. // The resource name returned for successful operations.
  144. string resource_name = 1 [(google.api.resource_reference) = {
  145. type: "googleads.googleapis.com/AdGroupAd"
  146. }];
  147. // The mutated ad group ad with only mutable fields after mutate. The field
  148. // will only be returned when response_content_type is set to
  149. // "MUTABLE_RESOURCE".
  150. google.ads.googleads.v12.resources.AdGroupAd ad_group_ad = 2;
  151. }