aboutsummaryrefslogtreecommitdiff
path: root/google/ads/googleads/v0/services/recommendation_service.proto
blob: ede15fe9bb1979f06e59f0195aa0d27ada9fd661 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
// Copyright 2018 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

syntax = "proto3";

package google.ads.googleads.v0.services;

import "google/ads/googleads/v0/enums/keyword_match_type.proto";
import "google/ads/googleads/v0/resources/ad.proto";
import "google/ads/googleads/v0/resources/recommendation.proto";
import "google/api/annotations.proto";
import "google/protobuf/wrappers.proto";
import "google/rpc/status.proto";

option csharp_namespace = "Google.Ads.GoogleAds.V0.Services";
option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v0/services;services";
option java_multiple_files = true;
option java_outer_classname = "RecommendationServiceProto";
option java_package = "com.google.ads.googleads.v0.services";
option objc_class_prefix = "GAA";
option php_namespace = "Google\\Ads\\GoogleAds\\V0\\Services";
// Proto file describing the Recommendation service.

// Service to manage recommendations.
service RecommendationService {
  // Returns the requested recommendation in full detail.
  rpc GetRecommendation(GetRecommendationRequest) returns (google.ads.googleads.v0.resources.Recommendation) {
    option (google.api.http) = {
      get: "/v0/{resource_name=customers/*/recommendations/*}"
    };
  }

  // Applies given recommendations with corresponding apply parameters.
  rpc ApplyRecommendation(ApplyRecommendationRequest) returns (ApplyRecommendationResponse) {
    option (google.api.http) = {
      post: "/v0/customers/{customer_id=*}/recommendations:apply"
      body: "*"
    };
  }

  // Dismisses given recommendations.
  rpc DismissRecommendation(DismissRecommendationRequest) returns (DismissRecommendationResponse) {
    option (google.api.http) = {
      post: "/v0/customers/{customer_id=*}/recommendations:dismiss"
      body: "*"
    };
  }
}

// Request message for [RecommendationService.GetRecommendation][google.ads.googleads.v0.services.RecommendationService.GetRecommendation].
message GetRecommendationRequest {
  // The resource name of the recommendation to fetch.
  string resource_name = 1;
}

// Request message for [RecommendationService.ApplyRecommendation][google.ads.googleads.v0.services.RecommendationService.ApplyRecommendation].
message ApplyRecommendationRequest {
  // The ID of the customer with the recommendation.
  string customer_id = 1;

  // If true, successful operations will be carried out and invalid
  // operations will return errors. If false, operations will be carried
  // out as a transaction if and only if they are all valid.
  // Default is false.
  bool partial_failure = 3;

  // The list of operations to apply recommendations.
  // If partial_failure=false all recommendations should be of the same type
  // There is a limit of 100 operations per request.
  repeated ApplyRecommendationOperation operations = 2;
}

// Information about the operation to apply a recommendation and any parameters
// to
// customize it.
message ApplyRecommendationOperation {
  // Parameters to use when applying a campaign budget recommendation.
  message CampaignBudgetParameters {
    // New budget amount to set for target budget resource. This is a required
    // field.
    google.protobuf.Int64Value new_budget_amount_micros = 1;
  }

  // Parameters to use when applying a text ad recommendation.
  message TextAdParameters {
    // New ad to add to recommended ad group. All necessary fields need to be
    // set in this message. This is a required field.
    google.ads.googleads.v0.resources.Ad ad = 1;
  }

  // Parameters to use when applying keyword recommendation.
  message KeywordParameters {
    // The ad group resource to add keyword to. This is a required field.
    google.protobuf.StringValue ad_group = 1;

    // The match type of the keyword. This is a required field.
    google.ads.googleads.v0.enums.KeywordMatchTypeEnum.KeywordMatchType match_type = 2;

    // Optional, CPC bid to set for the keyword. If not set, keyword will use
    // bid based on bidding strategy used by target ad group.
    google.protobuf.Int64Value cpc_bid_micros = 3;
  }

  // Parameters to use when applying Target CPA recommendation.
  message TargetCpaOptInParameters {
    // Average CPA to use for Target CPA bidding strategy. This is a required
    // field.
    google.protobuf.Int64Value target_cpa_micros = 1;

    // Optional, budget amount to set for the campaign.
    google.protobuf.Int64Value new_campaign_budget_amount_micros = 2;
  }

  // The resource name of the recommendation to apply.
  string resource_name = 1;

  // Parameters to use when applying the recommendation.
  oneof apply_parameters {
    // Optional parameters to use when applying a campaign budget
    // recommendation.
    CampaignBudgetParameters campaign_budget = 2;

    // Optional parameters to use when applying a text ad recommendation.
    TextAdParameters text_ad = 3;

    // Optional parameters to use when applying keyword recommendation.
    KeywordParameters keyword = 4;

    // Optional parameters to use when applying target CPA opt-in
    // recommendation.
    TargetCpaOptInParameters target_cpa_opt_in = 5;
  }
}

// Response message for [RecommendationService.ApplyRecommendation][google.ads.googleads.v0.services.RecommendationService.ApplyRecommendation].
message ApplyRecommendationResponse {
  // Results of operations to apply recommendations.
  repeated ApplyRecommendationResult results = 1;

  // Errors that pertain to operation failures in the partial failure mode.
  // Returned only when partial_failure = true and all errors occur inside the
  // operations. If any errors occur outside the operations (e.g. auth errors)
  // we return the RPC level error.
  google.rpc.Status partial_failure_error = 2;
}

// The result of applying a recommendation.
message ApplyRecommendationResult {
  // Returned for successful applies.
  string resource_name = 1;
}

// Request message for [RecommendationService.DismissRecommendation][google.ads.googleads.v0.services.RecommendationService.DismissRecommendation].
message DismissRecommendationRequest {
  // Operation to dismiss a single recommendation identified by resource_name.
  message DismissRecommendationOperation {
    // The resource name of the recommendation to dismiss.
    string resource_name = 1;
  }

  // The ID of the customer with the recommendation.
  string customer_id = 1;

  // If true, successful operations will be carried out and invalid
  // operations will return errors. If false, operations will be carried in a
  // single transaction if and only if they are all valid.
  // Default is false.
  bool partial_failure = 2;

  // The list of operations to dismiss recommendations.
  // If partial_failure=false all recommendations should be of the same type
  // There is a limit of 100 operations per request.
  repeated DismissRecommendationOperation operations = 3;
}

// Response message for [RecommendationService.DismissRecommendation][google.ads.googleads.v0.services.RecommendationService.DismissRecommendation].
message DismissRecommendationResponse {
  // The result of dismissing a recommendation.
  message DismissRecommendationResult {
    // Returned for successful dismissals.
    string resource_name = 1;
  }

  // Results of operations to dismiss recommendations.
  repeated DismissRecommendationResult results = 1;

  // Errors that pertain to operation failures in the partial failure mode.
  // Returned only when partial_failure = true and all errors occur inside the
  // operations. If any errors occur outside the operations (e.g. auth errors)
  // we return the RPC level error.
  google.rpc.Status partial_failure_error = 2;
}