recommendation_service.proto 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346
  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/extensions.proto";
  17. import "google/ads/googleads/v12/enums/keyword_match_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/rpc/status.proto";
  24. option csharp_namespace = "Google.Ads.GoogleAds.V12.Services";
  25. option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v12/services;services";
  26. option java_multiple_files = true;
  27. option java_outer_classname = "RecommendationServiceProto";
  28. option java_package = "com.google.ads.googleads.v12.services";
  29. option objc_class_prefix = "GAA";
  30. option php_namespace = "Google\\Ads\\GoogleAds\\V12\\Services";
  31. option ruby_package = "Google::Ads::GoogleAds::V12::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: "/v12/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: "/v12/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.v12.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 forecasting set target roas
  100. // recommendation.
  101. message ForecastingSetTargetRoasParameters {
  102. // New target ROAS (revenue per unit of spend) to set for a campaign
  103. // resource.
  104. // The value is between 0.01 and 1000.0, inclusive.
  105. optional double target_roas = 1;
  106. // New campaign budget amount to set for a campaign resource.
  107. optional int64 campaign_budget_amount_micros = 2;
  108. }
  109. // Parameters to use when applying a text ad recommendation.
  110. message TextAdParameters {
  111. // New ad to add to recommended ad group. All necessary fields need to be
  112. // set in this message. This is a required field.
  113. google.ads.googleads.v12.resources.Ad ad = 1;
  114. }
  115. // Parameters to use when applying keyword recommendation.
  116. message KeywordParameters {
  117. // The ad group resource to add keyword to. This is a required field.
  118. optional string ad_group = 4;
  119. // The match type of the keyword. This is a required field.
  120. google.ads.googleads.v12.enums.KeywordMatchTypeEnum.KeywordMatchType match_type = 2;
  121. // Optional, CPC bid to set for the keyword. If not set, keyword will use
  122. // bid based on bidding strategy used by target ad group.
  123. optional int64 cpc_bid_micros = 5;
  124. }
  125. // Parameters to use when applying Target CPA recommendation.
  126. message TargetCpaOptInParameters {
  127. // Average CPA to use for Target CPA bidding strategy. This is a required
  128. // field.
  129. optional int64 target_cpa_micros = 3;
  130. // Optional, budget amount to set for the campaign.
  131. optional int64 new_campaign_budget_amount_micros = 4;
  132. }
  133. // Parameters to use when applying a Target ROAS opt-in recommendation.
  134. message TargetRoasOptInParameters {
  135. // Average ROAS (revenue per unit of spend) to use for Target ROAS bidding
  136. // strategy. The value is between 0.01 and 1000.0, inclusive. This is a
  137. // required field, unless new_campaign_budget_amount_micros is set.
  138. optional double target_roas = 1;
  139. // Optional, budget amount to set for the campaign.
  140. optional int64 new_campaign_budget_amount_micros = 2;
  141. }
  142. // Parameters to use when applying callout extension recommendation.
  143. message CalloutExtensionParameters {
  144. // Callout extensions to be added. This is a required field.
  145. repeated google.ads.googleads.v12.common.CalloutFeedItem callout_extensions = 1;
  146. }
  147. // Parameters to use when applying call extension recommendation.
  148. message CallExtensionParameters {
  149. // Call extensions to be added. This is a required field.
  150. repeated google.ads.googleads.v12.common.CallFeedItem call_extensions = 1;
  151. }
  152. // Parameters to use when applying sitelink extension recommendation.
  153. message SitelinkExtensionParameters {
  154. // Sitelink extensions to be added. This is a required field.
  155. repeated google.ads.googleads.v12.common.SitelinkFeedItem sitelink_extensions = 1;
  156. }
  157. // Parameters to use when applying move unused budget recommendation.
  158. message MoveUnusedBudgetParameters {
  159. // Budget amount to move from excess budget to constrained budget. This is
  160. // a required field.
  161. optional int64 budget_micros_to_move = 2;
  162. }
  163. // Parameters to use when applying a responsive search ad asset
  164. // recommendation.
  165. message ResponsiveSearchAdAssetParameters {
  166. // Updated ad. The current ad's content will be replaced.
  167. google.ads.googleads.v12.resources.Ad updated_ad = 1;
  168. }
  169. // Parameters to use when applying a responsive search ad improve ad strength
  170. // recommendation.
  171. message ResponsiveSearchAdImproveAdStrengthParameters {
  172. // Updated ad. The current ad's content will be replaced.
  173. google.ads.googleads.v12.resources.Ad updated_ad = 1;
  174. }
  175. // Parameters to use when applying a responsive search ad recommendation.
  176. message ResponsiveSearchAdParameters {
  177. // Required. New ad to add to recommended ad group.
  178. google.ads.googleads.v12.resources.Ad ad = 1 [(google.api.field_behavior) = REQUIRED];
  179. }
  180. // Parameters to use when applying a raise target CPA bid too low
  181. // recommendation. The apply is asynchronous and can take minutes depending on
  182. // the number of ad groups there is in the related campaign..
  183. message RaiseTargetCpaBidTooLowParameters {
  184. // Required. A number greater than 1.0 indicating the factor by which to increase the
  185. // target CPA. This is a required field.
  186. double target_multiplier = 1 [(google.api.field_behavior) = REQUIRED];
  187. }
  188. // Parameters to use when applying a use broad match keyword recommendation.
  189. message UseBroadMatchKeywordParameters {
  190. // New budget amount to set for target budget resource.
  191. optional int64 new_budget_amount_micros = 1;
  192. }
  193. // The resource name of the recommendation to apply.
  194. string resource_name = 1 [(google.api.resource_reference) = {
  195. type: "googleads.googleapis.com/Recommendation"
  196. }];
  197. // Parameters to use when applying the recommendation.
  198. oneof apply_parameters {
  199. // Optional parameters to use when applying a campaign budget
  200. // recommendation.
  201. CampaignBudgetParameters campaign_budget = 2;
  202. // Optional parameters to use when applying a text ad recommendation.
  203. TextAdParameters text_ad = 3;
  204. // Optional parameters to use when applying keyword recommendation.
  205. KeywordParameters keyword = 4;
  206. // Optional parameters to use when applying target CPA opt-in
  207. // recommendation.
  208. TargetCpaOptInParameters target_cpa_opt_in = 5;
  209. // Optional parameters to use when applying target ROAS opt-in
  210. // recommendation.
  211. TargetRoasOptInParameters target_roas_opt_in = 10;
  212. // Parameters to use when applying callout extension recommendation.
  213. CalloutExtensionParameters callout_extension = 6;
  214. // Parameters to use when applying call extension recommendation.
  215. CallExtensionParameters call_extension = 7;
  216. // Parameters to use when applying sitelink extension recommendation.
  217. SitelinkExtensionParameters sitelink_extension = 8;
  218. // Parameters to use when applying move unused budget recommendation.
  219. MoveUnusedBudgetParameters move_unused_budget = 9;
  220. // Parameters to use when applying a responsive search ad recommendation.
  221. ResponsiveSearchAdParameters responsive_search_ad = 11;
  222. // Parameters to use when applying a use broad match keyword recommendation.
  223. UseBroadMatchKeywordParameters use_broad_match_keyword = 12;
  224. // Parameters to use when applying a responsive search ad asset
  225. // recommendation.
  226. ResponsiveSearchAdAssetParameters responsive_search_ad_asset = 13;
  227. // Parameters to use when applying a responsive search ad improve ad
  228. // strength recommendation.
  229. ResponsiveSearchAdImproveAdStrengthParameters responsive_search_ad_improve_ad_strength = 14;
  230. // Parameters to use when applying a raise target CPA bid too low
  231. // recommendation. The apply is asynchronous and can take minutes depending
  232. // on the number of ad groups there is in the related campaign.
  233. RaiseTargetCpaBidTooLowParameters raise_target_cpa_bid_too_low = 15;
  234. // Parameters to use when applying a forecasting set target ROAS
  235. // recommendation.
  236. ForecastingSetTargetRoasParameters forecasting_set_target_roas = 16;
  237. }
  238. }
  239. // Response message for [RecommendationService.ApplyRecommendation][google.ads.googleads.v12.services.RecommendationService.ApplyRecommendation].
  240. message ApplyRecommendationResponse {
  241. // Results of operations to apply recommendations.
  242. repeated ApplyRecommendationResult results = 1;
  243. // Errors that pertain to operation failures in the partial failure mode.
  244. // Returned only when partial_failure = true and all errors occur inside the
  245. // operations. If any errors occur outside the operations (for example, auth
  246. // errors) we return the RPC level error.
  247. google.rpc.Status partial_failure_error = 2;
  248. }
  249. // The result of applying a recommendation.
  250. message ApplyRecommendationResult {
  251. // Returned for successful applies.
  252. string resource_name = 1 [(google.api.resource_reference) = {
  253. type: "googleads.googleapis.com/Recommendation"
  254. }];
  255. }
  256. // Request message for [RecommendationService.DismissRecommendation][google.ads.googleads.v12.services.RecommendationService.DismissRecommendation].
  257. message DismissRecommendationRequest {
  258. // Operation to dismiss a single recommendation identified by resource_name.
  259. message DismissRecommendationOperation {
  260. // The resource name of the recommendation to dismiss.
  261. string resource_name = 1;
  262. }
  263. // Required. The ID of the customer with the recommendation.
  264. string customer_id = 1 [(google.api.field_behavior) = REQUIRED];
  265. // Required. The list of operations to dismiss recommendations.
  266. // If partial_failure=false all recommendations should be of the same type
  267. // There is a limit of 100 operations per request.
  268. repeated DismissRecommendationOperation operations = 3 [(google.api.field_behavior) = REQUIRED];
  269. // If true, successful operations will be carried out and invalid
  270. // operations will return errors. If false, operations will be carried in a
  271. // single transaction if and only if they are all valid.
  272. // Default is false.
  273. bool partial_failure = 2;
  274. }
  275. // Response message for [RecommendationService.DismissRecommendation][google.ads.googleads.v12.services.RecommendationService.DismissRecommendation].
  276. message DismissRecommendationResponse {
  277. // The result of dismissing a recommendation.
  278. message DismissRecommendationResult {
  279. // Returned for successful dismissals.
  280. string resource_name = 1;
  281. }
  282. // Results of operations to dismiss recommendations.
  283. repeated DismissRecommendationResult results = 1;
  284. // Errors that pertain to operation failures in the partial failure mode.
  285. // Returned only when partial_failure = true and all errors occur inside the
  286. // operations. If any errors occur outside the operations (for example, auth
  287. // errors) we return the RPC level error.
  288. google.rpc.Status partial_failure_error = 2;
  289. }