recommendation_service.proto 12 KB

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