// Copyright 2021 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.v6.common;

import "google/ads/googleads/v6/enums/keyword_plan_competition_level.proto";
import "google/ads/googleads/v6/enums/month_of_year.proto";
import "google/api/annotations.proto";

option csharp_namespace = "Google.Ads.GoogleAds.V6.Common";
option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v6/common;common";
option java_multiple_files = true;
option java_outer_classname = "KeywordPlanCommonProto";
option java_package = "com.google.ads.googleads.v6.common";
option objc_class_prefix = "GAA";
option php_namespace = "Google\\Ads\\GoogleAds\\V6\\Common";
option ruby_package = "Google::Ads::GoogleAds::V6::Common";

// Proto file describing Keyword Planner messages.

// Historical metrics specific to the targeting options selected.
// Targeting options include geographies, network, etc.
// Refer to https://support.google.com/google-ads/answer/3022575 for more
// details.
message KeywordPlanHistoricalMetrics {
  // Approximate number of monthly searches on this query averaged
  // for the past 12 months.
  optional int64 avg_monthly_searches = 7;

  // Approximate number of searches on this query for the past twelve months.
  repeated MonthlySearchVolume monthly_search_volumes = 6;

  // The competition level for the query.
  google.ads.googleads.v6.enums.KeywordPlanCompetitionLevelEnum.KeywordPlanCompetitionLevel competition = 2;

  // The competition index for the query in the range [0, 100].
  // Shows how competitive ad placement is for a keyword.
  // The level of competition from 0-100 is determined by the number of ad slots
  // filled divided by the total number of ad slots available. If not enough
  // data is available, null is returned.
  optional int64 competition_index = 8;

  // Top of page bid low range (20th percentile) in micros for the keyword.
  optional int64 low_top_of_page_bid_micros = 9;

  // Top of page bid high range (80th percentile) in micros for the keyword.
  optional int64 high_top_of_page_bid_micros = 10;
}

// Monthly search volume.
message MonthlySearchVolume {
  // The year of the search volume (e.g. 2020).
  optional int64 year = 4;

  // The month of the search volume.
  google.ads.googleads.v6.enums.MonthOfYearEnum.MonthOfYear month = 2;

  // Approximate number of searches for the month.
  // A null value indicates the search volume is unavailable for
  // that month.
  optional int64 monthly_searches = 5;
}
