ad_service.proto 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  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.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 = "AdServiceProto";
  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 service.
  34. // Service to manage ads.
  35. service AdService {
  36. option (google.api.default_host) = "googleads.googleapis.com";
  37. option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/adwords";
  38. // Returns the requested ad in full detail.
  39. //
  40. // List of thrown errors:
  41. // [AuthenticationError]()
  42. // [AuthorizationError]()
  43. // [HeaderError]()
  44. // [InternalError]()
  45. // [QuotaError]()
  46. // [RequestError]()
  47. rpc GetAd(GetAdRequest) returns (google.ads.googleads.v12.resources.Ad) {
  48. option (google.api.http) = {
  49. get: "/v12/{resource_name=customers/*/ads/*}"
  50. };
  51. option (google.api.method_signature) = "resource_name";
  52. }
  53. // Updates ads. Operation statuses are returned. Updating ads is not supported
  54. // for TextAd, ExpandedDynamicSearchAd, GmailAd and ImageAd.
  55. //
  56. // List of thrown errors:
  57. // [AdCustomizerError]()
  58. // [AdError]()
  59. // [AdSharingError]()
  60. // [AdxError]()
  61. // [AssetError]()
  62. // [AssetLinkError]()
  63. // [AuthenticationError]()
  64. // [AuthorizationError]()
  65. // [CollectionSizeError]()
  66. // [DatabaseError]()
  67. // [DateError]()
  68. // [DistinctError]()
  69. // [FeedAttributeReferenceError]()
  70. // [FieldError]()
  71. // [FieldMaskError]()
  72. // [FunctionError]()
  73. // [FunctionParsingError]()
  74. // [HeaderError]()
  75. // [IdError]()
  76. // [ImageError]()
  77. // [InternalError]()
  78. // [ListOperationError]()
  79. // [MediaBundleError]()
  80. // [MediaFileError]()
  81. // [MutateError]()
  82. // [NewResourceCreationError]()
  83. // [NotEmptyError]()
  84. // [NullError]()
  85. // [OperatorError]()
  86. // [PolicyFindingError]()
  87. // [PolicyViolationError]()
  88. // [QuotaError]()
  89. // [RangeError]()
  90. // [RequestError]()
  91. // [SizeLimitError]()
  92. // [StringFormatError]()
  93. // [StringLengthError]()
  94. // [UrlFieldError]()
  95. rpc MutateAds(MutateAdsRequest) returns (MutateAdsResponse) {
  96. option (google.api.http) = {
  97. post: "/v12/customers/{customer_id=*}/ads:mutate"
  98. body: "*"
  99. };
  100. option (google.api.method_signature) = "customer_id,operations";
  101. }
  102. }
  103. // Request message for [AdService.GetAd][google.ads.googleads.v12.services.AdService.GetAd].
  104. message GetAdRequest {
  105. // Required. The resource name of the ad to fetch.
  106. string resource_name = 1 [
  107. (google.api.field_behavior) = REQUIRED,
  108. (google.api.resource_reference) = {
  109. type: "googleads.googleapis.com/Ad"
  110. }
  111. ];
  112. }
  113. // Request message for [AdService.MutateAds][google.ads.googleads.v12.services.AdService.MutateAds].
  114. message MutateAdsRequest {
  115. // Required. The ID of the customer whose ads are being modified.
  116. string customer_id = 1 [(google.api.field_behavior) = REQUIRED];
  117. // Required. The list of operations to perform on individual ads.
  118. repeated AdOperation operations = 2 [(google.api.field_behavior) = REQUIRED];
  119. // If true, successful operations will be carried out and invalid
  120. // operations will return errors. If false, all operations will be carried
  121. // out in one transaction if and only if they are all valid.
  122. // Default is false.
  123. bool partial_failure = 4;
  124. // The response content type setting. Determines whether the mutable resource
  125. // or just the resource name should be returned post mutation.
  126. google.ads.googleads.v12.enums.ResponseContentTypeEnum.ResponseContentType response_content_type = 5;
  127. // If true, the request is validated but not executed. Only errors are
  128. // returned, not results.
  129. bool validate_only = 3;
  130. }
  131. // A single update operation on an ad.
  132. message AdOperation {
  133. // FieldMask that determines which resource fields are modified in an update.
  134. google.protobuf.FieldMask update_mask = 2;
  135. // Configuration for how policies are validated.
  136. google.ads.googleads.v12.common.PolicyValidationParameter policy_validation_parameter = 3;
  137. // The mutate operation.
  138. oneof operation {
  139. // Update operation: The ad is expected to have a valid resource name
  140. // in this format:
  141. //
  142. // `customers/{customer_id}/ads/{ad_id}`
  143. google.ads.googleads.v12.resources.Ad update = 1;
  144. }
  145. }
  146. // Response message for an ad mutate.
  147. message MutateAdsResponse {
  148. // Errors that pertain to operation failures in the partial failure mode.
  149. // Returned only when partial_failure = true and all errors occur inside the
  150. // operations. If any errors occur outside the operations (for example, auth
  151. // errors), we return an RPC level error.
  152. google.rpc.Status partial_failure_error = 3;
  153. // All results for the mutate.
  154. repeated MutateAdResult results = 2;
  155. }
  156. // The result for the ad mutate.
  157. message MutateAdResult {
  158. // The resource name returned for successful operations.
  159. string resource_name = 1 [(google.api.resource_reference) = {
  160. type: "googleads.googleapis.com/Ad"
  161. }];
  162. // The mutated ad with only mutable fields after mutate. The field will only
  163. // be returned when response_content_type is set to "MUTABLE_RESOURCE".
  164. google.ads.googleads.v12.resources.Ad ad = 2;
  165. }