// Copyright 2023 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.searchads360.v0.common;

import "google/ads/searchads360/v0/common/criteria.proto";
import "google/ads/searchads360/v0/enums/conversion_action_category.proto";
import "google/ads/searchads360/v0/enums/day_of_week.proto";
import "google/ads/searchads360/v0/enums/device.proto";
import "google/api/resource.proto";

option csharp_namespace = "Google.Ads.SearchAds360.V0.Common";
option go_package = "google.golang.org/genproto/googleapis/ads/searchads360/v0/common;common";
option java_multiple_files = true;
option java_outer_classname = "SegmentsProto";
option java_package = "com.google.ads.searchads360.v0.common";
option objc_class_prefix = "GASA360";
option php_namespace = "Google\\Ads\\SearchAds360\\V0\\Common";
option ruby_package = "Google::Ads::SearchAds360::V0::Common";

// Proto file describing segment only fields.

// Segment only fields.
message Segments {
  // Resource name of the conversion action.
  optional string conversion_action = 146 [(google.api.resource_reference) = {
    type: "searchads360.googleapis.com/ConversionAction"
  }];

  // Conversion action category.
  google.ads.searchads360.v0.enums.ConversionActionCategoryEnum
      .ConversionActionCategory conversion_action_category = 53;

  // Conversion action name.
  optional string conversion_action_name = 114;

  // Date to which metrics apply.
  // yyyy-MM-dd format, for example, 2018-04-17.
  optional string date = 79;

  // Day of the week, for example, MONDAY.
  google.ads.searchads360.v0.enums.DayOfWeekEnum.DayOfWeek day_of_week = 5;

  // Device to which metrics apply.
  google.ads.searchads360.v0.enums.DeviceEnum.Device device = 1;

  // Keyword criterion.
  Keyword keyword = 61;

  // Month as represented by the date of the first day of a month. Formatted as
  // yyyy-MM-dd.
  optional string month = 90;

  // Quarter as represented by the date of the first day of a quarter.
  // Uses the calendar year for quarters, for example, the second quarter of
  // 2018 starts on 2018-04-01. Formatted as yyyy-MM-dd.
  optional string quarter = 128;

  // Week as defined as Monday through Sunday, and represented by the date of
  // Monday. Formatted as yyyy-MM-dd.
  optional string week = 130;

  // Year, formatted as yyyy.
  optional int32 year = 131;
}

// A Keyword criterion segment.
message Keyword {
  // The AdGroupCriterion resource name.
  optional string ad_group_criterion = 3;

  // Keyword info.
  KeywordInfo info = 2;
}
