recommendation_service.proto 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  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/extensions.proto";
  17. import "google/ads/googleads/v6/enums/keyword_match_type.proto";
  18. import "google/ads/googleads/v6/resources/ad.proto";
  19. import "google/ads/googleads/v6/resources/recommendation.proto";
  20. import "google/api/annotations.proto";
  21. import "google/api/client.proto";
  22. import "google/api/field_behavior.proto";
  23. import "google/api/resource.proto";
  24. import "google/rpc/status.proto";
  25. option csharp_namespace = "Google.Ads.GoogleAds.V6.Services";
  26. option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v6/services;services";
  27. option java_multiple_files = true;
  28. option java_outer_classname = "RecommendationServiceProto";
  29. option java_package = "com.google.ads.googleads.v6.services";
  30. option objc_class_prefix = "GAA";
  31. option php_namespace = "Google\\Ads\\GoogleAds\\V6\\Services";
  32. option ruby_package = "Google::Ads::GoogleAds::V6::Services";
  33. // Proto file describing the Recommendation service.
  34. // Service to manage recommendations.
  35. service RecommendationService {
  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 recommendation in full detail.
  39. rpc GetRecommendation(GetRecommendationRequest) returns (google.ads.googleads.v6.resources.Recommendation) {
  40. option (google.api.http) = {
  41. get: "/v6/{resource_name=customers/*/recommendations/*}"
  42. };
  43. option (google.api.method_signature) = "resource_name";
  44. }
  45. // Applies given recommendations with corresponding apply parameters.
  46. rpc ApplyRecommendation(ApplyRecommendationRequest) returns (ApplyRecommendationResponse) {
  47. option (google.api.http) = {
  48. post: "/v6/customers/{customer_id=*}/recommendations:apply"
  49. body: "*"
  50. };
  51. option (google.api.method_signature) = "customer_id,operations";
  52. }
  53. // Dismisses given recommendations.
  54. rpc DismissRecommendation(DismissRecommendationRequest) returns (DismissRecommendationResponse) {
  55. option (google.api.http) = {
  56. post: "/v6/customers/{customer_id=*}/recommendations:dismiss"
  57. body: "*"
  58. };
  59. option (google.api.method_signature) = "customer_id,operations";
  60. }
  61. }
  62. // Request message for [RecommendationService.GetRecommendation][google.ads.googleads.v6.services.RecommendationService.GetRecommendation].
  63. message GetRecommendationRequest {
  64. // Required. The resource name of the recommendation to fetch.
  65. string resource_name = 1 [
  66. (google.api.field_behavior) = REQUIRED,
  67. (google.api.resource_reference) = {
  68. type: "googleads.googleapis.com/Recommendation"
  69. }
  70. ];
  71. }
  72. // Request message for [RecommendationService.ApplyRecommendation][google.ads.googleads.v6.services.RecommendationService.ApplyRecommendation].
  73. message ApplyRecommendationRequest {
  74. // Required. The ID of the customer with the recommendation.
  75. string customer_id = 1 [(google.api.field_behavior) = REQUIRED];
  76. // Required. The list of operations to apply recommendations.
  77. // If partial_failure=false all recommendations should be of the same type
  78. // There is a limit of 100 operations per request.
  79. repeated ApplyRecommendationOperation operations = 2 [(google.api.field_behavior) = REQUIRED];
  80. // If true, successful operations will be carried out and invalid
  81. // operations will return errors. If false, operations will be carried
  82. // out as a transaction if and only if they are all valid.
  83. // Default is false.
  84. bool partial_failure = 3;
  85. }
  86. // Information about the operation to apply a recommendation and any parameters
  87. // to customize it.
  88. message ApplyRecommendationOperation {
  89. // Parameters to use when applying a campaign budget recommendation.
  90. message CampaignBudgetParameters {
  91. // New budget amount to set for target budget resource. This is a required
  92. // field.
  93. optional int64 new_budget_amount_micros = 2;
  94. }
  95. // Parameters to use when applying a text ad recommendation.
  96. message TextAdParameters {
  97. // New ad to add to recommended ad group. All necessary fields need to be
  98. // set in this message. This is a required field.
  99. google.ads.googleads.v6.resources.Ad ad = 1;
  100. }
  101. // Parameters to use when applying keyword recommendation.
  102. message KeywordParameters {
  103. // The ad group resource to add keyword to. This is a required field.
  104. optional string ad_group = 4;
  105. // The match type of the keyword. This is a required field.
  106. google.ads.googleads.v6.enums.KeywordMatchTypeEnum.KeywordMatchType match_type = 2;
  107. // Optional, CPC bid to set for the keyword. If not set, keyword will use
  108. // bid based on bidding strategy used by target ad group.
  109. optional int64 cpc_bid_micros = 5;
  110. }
  111. // Parameters to use when applying Target CPA recommendation.
  112. message TargetCpaOptInParameters {
  113. // Average CPA to use for Target CPA bidding strategy. This is a required
  114. // field.
  115. optional int64 target_cpa_micros = 3;
  116. // Optional, budget amount to set for the campaign.
  117. optional int64 new_campaign_budget_amount_micros = 4;
  118. }
  119. // Parameters to use when applying a Target ROAS opt-in recommendation.
  120. message TargetRoasOptInParameters {
  121. // Average ROAS (revenue per unit of spend) to use for Target ROAS bidding
  122. // strategy. The value is between 0.01 and 1000.0, inclusive. This is a
  123. // required field.
  124. optional double target_roas = 1;
  125. // Optional, budget amount to set for the campaign.
  126. optional int64 new_campaign_budget_amount_micros = 2;
  127. }
  128. // Parameters to use when applying callout extension recommendation.
  129. message CalloutExtensionParameters {
  130. // Callout extensions to be added. This is a required field.
  131. repeated google.ads.googleads.v6.common.CalloutFeedItem callout_extensions = 1;
  132. }
  133. // Parameters to use when applying call extension recommendation.
  134. message CallExtensionParameters {
  135. // Call extensions to be added. This is a required field.
  136. repeated google.ads.googleads.v6.common.CallFeedItem call_extensions = 1;
  137. }
  138. // Parameters to use when applying sitelink extension recommendation.
  139. message SitelinkExtensionParameters {
  140. // Sitelink extensions to be added. This is a required field.
  141. repeated google.ads.googleads.v6.common.SitelinkFeedItem sitelink_extensions = 1;
  142. }
  143. // Parameters to use when applying move unused budget recommendation.
  144. message MoveUnusedBudgetParameters {
  145. // Budget amount to move from excess budget to constrained budget. This is
  146. // a required field.
  147. optional int64 budget_micros_to_move = 2;
  148. }
  149. // Parameters to use when applying a responsive search ad recommendation.
  150. message ResponsiveSearchAdParameters {
  151. // Required. New ad to add to recommended ad group.
  152. google.ads.googleads.v6.resources.Ad ad = 1 [(google.api.field_behavior) = REQUIRED];
  153. }
  154. // The resource name of the recommendation to apply.
  155. string resource_name = 1;
  156. // Parameters to use when applying the recommendation.
  157. oneof apply_parameters {
  158. // Optional parameters to use when applying a campaign budget
  159. // recommendation.
  160. CampaignBudgetParameters campaign_budget = 2;
  161. // Optional parameters to use when applying a text ad recommendation.
  162. TextAdParameters text_ad = 3;
  163. // Optional parameters to use when applying keyword recommendation.
  164. KeywordParameters keyword = 4;
  165. // Optional parameters to use when applying target CPA opt-in
  166. // recommendation.
  167. TargetCpaOptInParameters target_cpa_opt_in = 5;
  168. // Optional parameters to use when applying target ROAS opt-in
  169. // recommendation.
  170. TargetRoasOptInParameters target_roas_opt_in = 10;
  171. // Parameters to use when applying callout extension recommendation.
  172. CalloutExtensionParameters callout_extension = 6;
  173. // Parameters to use when applying call extension recommendation.
  174. CallExtensionParameters call_extension = 7;
  175. // Parameters to use when applying sitelink extension recommendation.
  176. SitelinkExtensionParameters sitelink_extension = 8;
  177. // Parameters to use when applying move unused budget recommendation.
  178. MoveUnusedBudgetParameters move_unused_budget = 9;
  179. // Parameters to use when applying a responsive search ad recommendation.
  180. ResponsiveSearchAdParameters responsive_search_ad = 11;
  181. }
  182. }
  183. // Response message for [RecommendationService.ApplyRecommendation][google.ads.googleads.v6.services.RecommendationService.ApplyRecommendation].
  184. message ApplyRecommendationResponse {
  185. // Results of operations to apply recommendations.
  186. repeated ApplyRecommendationResult results = 1;
  187. // Errors that pertain to operation failures in the partial failure mode.
  188. // Returned only when partial_failure = true and all errors occur inside the
  189. // operations. If any errors occur outside the operations (e.g. auth errors)
  190. // we return the RPC level error.
  191. google.rpc.Status partial_failure_error = 2;
  192. }
  193. // The result of applying a recommendation.
  194. message ApplyRecommendationResult {
  195. // Returned for successful applies.
  196. string resource_name = 1;
  197. }
  198. // Request message for [RecommendationService.DismissRecommendation][google.ads.googleads.v6.services.RecommendationService.DismissRecommendation].
  199. message DismissRecommendationRequest {
  200. // Operation to dismiss a single recommendation identified by resource_name.
  201. message DismissRecommendationOperation {
  202. // The resource name of the recommendation to dismiss.
  203. string resource_name = 1;
  204. }
  205. // Required. The ID of the customer with the recommendation.
  206. string customer_id = 1 [(google.api.field_behavior) = REQUIRED];
  207. // Required. The list of operations to dismiss recommendations.
  208. // If partial_failure=false all recommendations should be of the same type
  209. // There is a limit of 100 operations per request.
  210. repeated DismissRecommendationOperation operations = 3 [(google.api.field_behavior) = REQUIRED];
  211. // If true, successful operations will be carried out and invalid
  212. // operations will return errors. If false, operations will be carried in a
  213. // single transaction if and only if they are all valid.
  214. // Default is false.
  215. bool partial_failure = 2;
  216. }
  217. // Response message for [RecommendationService.DismissRecommendation][google.ads.googleads.v6.services.RecommendationService.DismissRecommendation].
  218. message DismissRecommendationResponse {
  219. // The result of dismissing a recommendation.
  220. message DismissRecommendationResult {
  221. // Returned for successful dismissals.
  222. string resource_name = 1;
  223. }
  224. // Results of operations to dismiss recommendations.
  225. repeated DismissRecommendationResult results = 1;
  226. // Errors that pertain to operation failures in the partial failure mode.
  227. // Returned only when partial_failure = true and all errors occur inside the
  228. // operations. If any errors occur outside the operations (e.g. auth errors)
  229. // we return the RPC level error.
  230. google.rpc.Status partial_failure_error = 2;
  231. }