Built motion from commit 6a09e18b.|2.6.11
[motion2.git] / legacy-libs / google-proto-files / google / ads / googleads / v1 / services / keyword_plan_service.proto
1 // Copyright 2019 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 //
15
16 syntax = "proto3";
17
18 package google.ads.googleads.v1.services;
19
20 import "google/ads/googleads/v1/common/keyword_plan_common.proto";
21 import "google/ads/googleads/v1/resources/keyword_plan.proto";
22 import "google/api/annotations.proto";
23 import "google/protobuf/field_mask.proto";
24 import "google/protobuf/wrappers.proto";
25 import "google/rpc/status.proto";
26
27 option csharp_namespace = "Google.Ads.GoogleAds.V1.Services";
28 option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v1/services;services";
29 option java_multiple_files = true;
30 option java_outer_classname = "KeywordPlanServiceProto";
31 option java_package = "com.google.ads.googleads.v1.services";
32 option objc_class_prefix = "GAA";
33 option php_namespace = "Google\\Ads\\GoogleAds\\V1\\Services";
34 option ruby_package = "Google::Ads::GoogleAds::V1::Services";
35 // Proto file describing the keyword plan service.
36
37 // Service to manage keyword plans.
38 service KeywordPlanService {
39   // Returns the requested plan in full detail.
40   rpc GetKeywordPlan(GetKeywordPlanRequest) returns (google.ads.googleads.v1.resources.KeywordPlan) {
41     option (google.api.http) = {
42       get: "/v1/{resource_name=customers/*/keywordPlans/*}"
43     };
44   }
45
46   // Creates, updates, or removes keyword plans. Operation statuses are
47   // returned.
48   rpc MutateKeywordPlans(MutateKeywordPlansRequest) returns (MutateKeywordPlansResponse) {
49     option (google.api.http) = {
50       post: "/v1/customers/{customer_id=*}/keywordPlans:mutate"
51       body: "*"
52     };
53   }
54
55   // Returns the requested Keyword Plan forecasts.
56   rpc GenerateForecastMetrics(GenerateForecastMetricsRequest) returns (GenerateForecastMetricsResponse) {
57     option (google.api.http) = {
58       post: "/v1/{keyword_plan=customers/*/keywordPlans/*}:generateForecastMetrics"
59       body: "*"
60     };
61   }
62
63   // Returns the requested Keyword Plan historical metrics.
64   rpc GenerateHistoricalMetrics(GenerateHistoricalMetricsRequest) returns (GenerateHistoricalMetricsResponse) {
65     option (google.api.http) = {
66       post: "/v1/{keyword_plan=customers/*/keywordPlans/*}:generateHistoricalMetrics"
67       body: "*"
68     };
69   }
70 }
71
72 // Request message for [KeywordPlanService.GetKeywordPlan][google.ads.googleads.v1.services.KeywordPlanService.GetKeywordPlan].
73 message GetKeywordPlanRequest {
74   // The resource name of the plan to fetch.
75   string resource_name = 1;
76 }
77
78 // Request message for [KeywordPlanService.MutateKeywordPlans][google.ads.googleads.v1.services.KeywordPlanService.MutateKeywordPlans].
79 message MutateKeywordPlansRequest {
80   // The ID of the customer whose keyword plans are being modified.
81   string customer_id = 1;
82
83   // The list of operations to perform on individual keyword plans.
84   repeated KeywordPlanOperation operations = 2;
85
86   // If true, successful operations will be carried out and invalid
87   // operations will return errors. If false, all operations will be carried
88   // out in one transaction if and only if they are all valid.
89   // Default is false.
90   bool partial_failure = 3;
91
92   // If true, the request is validated but not executed. Only errors are
93   // returned, not results.
94   bool validate_only = 4;
95 }
96
97 // A single operation (create, update, remove) on a keyword plan.
98 message KeywordPlanOperation {
99   // The FieldMask that determines which resource fields are modified in an
100   // update.
101   google.protobuf.FieldMask update_mask = 4;
102
103   // The mutate operation.
104   oneof operation {
105     // Create operation: No resource name is expected for the new keyword plan.
106     google.ads.googleads.v1.resources.KeywordPlan create = 1;
107
108     // Update operation: The keyword plan is expected to have a valid resource
109     // name.
110     google.ads.googleads.v1.resources.KeywordPlan update = 2;
111
112     // Remove operation: A resource name for the removed keyword plan is
113     // expected in this format:
114     //
115     // `customers/{customer_id}/keywordPlans/{keyword_plan_id}`
116     string remove = 3;
117   }
118 }
119
120 // Response message for a keyword plan mutate.
121 message MutateKeywordPlansResponse {
122   // Errors that pertain to operation failures in the partial failure mode.
123   // Returned only when partial_failure = true and all errors occur inside the
124   // operations. If any errors occur outside the operations (e.g. auth errors),
125   // we return an RPC level error.
126   google.rpc.Status partial_failure_error = 3;
127
128   // All results for the mutate.
129   repeated MutateKeywordPlansResult results = 2;
130 }
131
132 // The result for the keyword plan mutate.
133 message MutateKeywordPlansResult {
134   // Returned for successful operations.
135   string resource_name = 1;
136 }
137
138 // Request message for [KeywordPlanService.GenerateForecastMetrics][google.ads.googleads.v1.services.KeywordPlanService.GenerateForecastMetrics].
139 message GenerateForecastMetricsRequest {
140   // The resource name of the keyword plan to be forecasted.
141   string keyword_plan = 1;
142 }
143
144 // Response message for [KeywordPlanService.GenerateForecastMetrics][google.ads.googleads.v1.services.KeywordPlanService.GenerateForecastMetrics].
145 message GenerateForecastMetricsResponse {
146   // List of campaign forecasts.
147   // One maximum.
148   repeated KeywordPlanCampaignForecast campaign_forecasts = 1;
149
150   // List of ad group forecasts.
151   repeated KeywordPlanAdGroupForecast ad_group_forecasts = 2;
152
153   // List of keyword forecasts.
154   repeated KeywordPlanKeywordForecast keyword_forecasts = 3;
155 }
156
157 // A campaign forecast.
158 message KeywordPlanCampaignForecast {
159   // The resource name of the Keyword Plan campaign related to the forecast.
160   //
161   // `customers/{customer_id}/keywordPlanCampaigns/{keyword+plan_campaign_id}`
162   google.protobuf.StringValue keyword_plan_campaign = 1;
163
164   // The forecast for the Keyword Plan campaign.
165   ForecastMetrics campaign_forecast = 2;
166 }
167
168 // An ad group forecast.
169 message KeywordPlanAdGroupForecast {
170   // The resource name of the Keyword Plan ad group related to the forecast.
171   //
172   // `customers/{customer_id}/keywordPlanAdGroups/{keyword_plan_ad_group_id}`
173   google.protobuf.StringValue keyword_plan_ad_group = 1;
174
175   // The forecast for the Keyword Plan ad group.
176   ForecastMetrics ad_group_forecast = 2;
177 }
178
179 // A keyword forecast.
180 message KeywordPlanKeywordForecast {
181   // The resource name of the Keyword Plan keyword related to the forecast.
182   //
183   //
184   // `customers/{customer_id}/keywordPlanAdGroupKeywords/{keyword_plan_ad_group_keyword_id}`
185   google.protobuf.StringValue keyword_plan_ad_group_keyword = 1;
186
187   // The forecast for the Keyword Plan keyword.
188   ForecastMetrics keyword_forecast = 2;
189 }
190
191 // Forecast metrics.
192 message ForecastMetrics {
193   // Impressions
194   google.protobuf.DoubleValue impressions = 1;
195
196   // Ctr
197   google.protobuf.DoubleValue ctr = 2;
198
199   // AVG cpc
200   google.protobuf.Int64Value average_cpc = 3;
201
202   // Clicks
203   google.protobuf.DoubleValue clicks = 5;
204
205   // Cost
206   google.protobuf.Int64Value cost_micros = 6;
207 }
208
209 // Request message for [KeywordPlanService.GenerateHistoricalMetrics][google.ads.googleads.v1.services.KeywordPlanService.GenerateHistoricalMetrics].
210 message GenerateHistoricalMetricsRequest {
211   // The resource name of the keyword plan of which historical metrics are
212   // requested.
213   string keyword_plan = 1;
214 }
215
216 // Response message for [KeywordPlanService.GenerateHistoricalMetrics][google.ads.googleads.v1.services.KeywordPlanService.GenerateHistoricalMetrics].
217 message GenerateHistoricalMetricsResponse {
218   // List of keyword historical metrics.
219   repeated KeywordPlanKeywordHistoricalMetrics metrics = 1;
220 }
221
222 // A keyword historical metrics.
223 message KeywordPlanKeywordHistoricalMetrics {
224   // The text of the query associated with one or more ad_group_keywords in the
225   // plan.
226   //
227   // Note that we de-dupe your keywords list, eliminating close variants before
228   // returning the plan's keywords as text. For example, if your plan originally
229   // contained the keywords 'car' and 'cars', the returned search query will
230   // only contain 'car'.
231   google.protobuf.StringValue search_query = 1;
232
233   // The historical metrics for the query associated with one or more
234   // ad_group_keywords in the plan.
235   google.ads.googleads.v1.common.KeywordPlanHistoricalMetrics keyword_metrics = 2;
236 }