ad_service.proto 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. // Copyright 2021 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.v6.services;
  16. import "google/ads/googleads/v6/common/policy.proto";
  17. import "google/ads/googleads/v6/enums/response_content_type.proto";
  18. import "google/ads/googleads/v6/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. option csharp_namespace = "Google.Ads.GoogleAds.V6.Services";
  25. option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v6/services;services";
  26. option java_multiple_files = true;
  27. option java_outer_classname = "AdServiceProto";
  28. option java_package = "com.google.ads.googleads.v6.services";
  29. option objc_class_prefix = "GAA";
  30. option php_namespace = "Google\\Ads\\GoogleAds\\V6\\Services";
  31. option ruby_package = "Google::Ads::GoogleAds::V6::Services";
  32. // Proto file describing the Ad service.
  33. // Service to manage ads.
  34. service AdService {
  35. option (google.api.default_host) = "googleads.googleapis.com";
  36. option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/adwords";
  37. // Returns the requested ad in full detail.
  38. rpc GetAd(GetAdRequest) returns (google.ads.googleads.v6.resources.Ad) {
  39. option (google.api.http) = {
  40. get: "/v6/{resource_name=customers/*/ads/*}"
  41. };
  42. option (google.api.method_signature) = "resource_name";
  43. }
  44. // Updates ads. Operation statuses are returned. Updating ads is not supported
  45. // for TextAd, ExpandedDynamicSearchAd, GmailAd and ImageAd.
  46. rpc MutateAds(MutateAdsRequest) returns (MutateAdsResponse) {
  47. option (google.api.http) = {
  48. post: "/v6/customers/{customer_id=*}/ads:mutate"
  49. body: "*"
  50. };
  51. option (google.api.method_signature) = "customer_id,operations";
  52. }
  53. }
  54. // Request message for [AdService.GetAd][google.ads.googleads.v6.services.AdService.GetAd].
  55. message GetAdRequest {
  56. // Required. The resource name of the ad to fetch.
  57. string resource_name = 1 [
  58. (google.api.field_behavior) = REQUIRED,
  59. (google.api.resource_reference) = {
  60. type: "googleads.googleapis.com/Ad"
  61. }
  62. ];
  63. }
  64. // Request message for [AdService.MutateAds][google.ads.googleads.v6.services.AdService.MutateAds].
  65. message MutateAdsRequest {
  66. // Required. The ID of the customer whose ads are being modified.
  67. string customer_id = 1 [(google.api.field_behavior) = REQUIRED];
  68. // Required. The list of operations to perform on individual ads.
  69. repeated AdOperation operations = 2 [(google.api.field_behavior) = REQUIRED];
  70. // The response content type setting. Determines whether the mutable resource
  71. // or just the resource name should be returned post mutation.
  72. google.ads.googleads.v6.enums.ResponseContentTypeEnum.ResponseContentType response_content_type = 5;
  73. }
  74. // A single update operation on an ad.
  75. message AdOperation {
  76. // FieldMask that determines which resource fields are modified in an update.
  77. google.protobuf.FieldMask update_mask = 2;
  78. // Configuration for how policies are validated.
  79. google.ads.googleads.v6.common.PolicyValidationParameter policy_validation_parameter = 3;
  80. // The mutate operation.
  81. oneof operation {
  82. // Update operation: The ad is expected to have a valid resource name
  83. // in this format:
  84. //
  85. // `customers/{customer_id}/ads/{ad_id}`
  86. google.ads.googleads.v6.resources.Ad update = 1;
  87. }
  88. }
  89. // Response message for an ad mutate.
  90. message MutateAdsResponse {
  91. // All results for the mutate.
  92. repeated MutateAdResult results = 2;
  93. }
  94. // The result for the ad mutate.
  95. message MutateAdResult {
  96. // The resource name returned for successful operations.
  97. string resource_name = 1;
  98. // The mutated ad with only mutable fields after mutate. The field will only
  99. // be returned when response_content_type is set to "MUTABLE_RESOURCE".
  100. google.ads.googleads.v6.resources.Ad ad = 2;
  101. }