recommendation_service.proto 12 KB

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