// 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.


// Proto file describing the ad type.
syntax = "proto3";

package google.ads.googleads.v0.common;

import "google/ads/googleads/v0/common/custom_parameter.proto";
import "google/ads/googleads/v0/enums/ad_type.proto";
import "google/protobuf/wrappers.proto";

option java_package = "com.google.ads.googleads.v0.common";
option java_outer_classname = "AdProto";
option java_multiple_files = true;

// Objective-C prefix. Google Ads API.
option objc_class_prefix = "GAA";
option csharp_namespace = "Google.Ads.GoogleAds.V0.Common";
option php_namespace = "Google\\Ads\\GoogleAds\\V0\\Common";
option php_metadata_namespace = "Google\\Ads\\GoogleAds\\V0\\Common";

// An ad.
message Ad {

  // The ID of the ad.
  google.protobuf.Int64Value id = 1;

  // The list of possible final URLs after all cross-domain redirects for the
  // ad.
  repeated google.protobuf.StringValue final_urls = 2;

  // The list of possible final mobile URLs after all cross-domain redirects
  // for the ad.
  repeated google.protobuf.StringValue final_mobile_urls = 16;

  // The URL template for constructing a tracking URL.
  google.protobuf.StringValue tracking_url_template = 12;

  // The list of mappings that can be used to substitute custom parameter tags
  // in a
  // `tracking_url_template`, `final_urls`, or `mobile_final_urls`.
  repeated CustomParameter url_custom_parameters = 10;

  // The URL that appears in the ad description for some ad formats.
  google.protobuf.StringValue display_url = 4;

  // The type of ad.
  enums.AdTypeEnum.AdType type = 5;

  // Details pertinent to the ad type. Exactly one value must be set.
  oneof ad_data {

    // Details pertaining to a text ad.
    TextAdInfo text_ad = 6;

    // Details pertaining to an expanded text ad.
    ExpandedTextAdInfo expanded_text_ad = 7;

    // Details pertaining to a Dynamic Search Ad.
    DynamicSearchAdInfo dynamic_search_ad = 8;

    // Details pertaining to a responsive display ad.
    ResponsiveDisplayAdInfo responsive_display_ad = 9;

    // Details pertaining to a call-only ad.
    CallOnlyAdInfo call_only_ad = 13;

    // Details pertaining to an Expanded Dynamic Search Ad.
    // This type of ad has its headline, final URLs, and display URL
    // auto-generated at serving time according to domain name specific
    // information provided by `dynamic_search_ads_setting` linked at the
    // campaign level.
    ExpandedDynamicSearchAdInfo expanded_dynamic_search_ad = 14;

    // Details pertaining to a hotel ad.
    HotelAdInfo hotel_ad = 15;
  }
}

// A text ad.
message TextAdInfo {

  // The headline of the ad.
  google.protobuf.StringValue headline = 1;

  // The first line of the ad's description.
  google.protobuf.StringValue description1 = 2;

  // The second line of the ad's description.
  google.protobuf.StringValue description2 = 3;
}

// An expanded text ad.
message ExpandedTextAdInfo {

  // The first part of the ad's headline.
  google.protobuf.StringValue headline_part1 = 1;

  // The second part of the ad's headline.
  google.protobuf.StringValue headline_part2 = 2;

  // The description of the ad.
  google.protobuf.StringValue description = 3;

  // The text that can appear alongside the ad's displayed URL.
  google.protobuf.StringValue path1 = 4;

  // Additional text that can appear alongside the ad's displayed URL.
  google.protobuf.StringValue path2 = 5;
}

// A dynamic search ad.
message DynamicSearchAdInfo {

  // The first line of the ad's description.
  google.protobuf.StringValue description1 = 1;

  // The second line of the ad's description.
  google.protobuf.StringValue description2 = 2;
}

// A responsive display ad.
message ResponsiveDisplayAdInfo {

  // The short version of the ad's headline.
  google.protobuf.StringValue short_headline = 1;

  // The long version of the ad's headline.
  google.protobuf.StringValue long_headline = 2;

  // The description of the ad.
  google.protobuf.StringValue description = 3;

  // The business name in the ad.
  google.protobuf.StringValue business_name = 4;
}

// A call-only ad.
message CallOnlyAdInfo {

  // The country code in the ad.
  google.protobuf.StringValue country_code = 1;

  // The phone number in the ad.
  google.protobuf.StringValue phone_number = 2;

  // The business name in the ad.
  google.protobuf.StringValue business_name = 3;

  // The first line of the ad's description.
  google.protobuf.StringValue description1 = 4;

  // The second line of the ad's description.
  google.protobuf.StringValue description2 = 5;

  // Whether to enable call tracking for the creative. Enabling call
  // tracking also enables call conversions.
  google.protobuf.BoolValue call_tracked = 6;

  // Whether to disable call conversion for the creative.
  // If set to `true`, disables call conversions even when `call_tracked` is
  // `true`.
  // If `call_tracked` is `false`, this field is ignored.
  google.protobuf.BoolValue disable_call_conversion = 7;

  // The URL to be used for phone number verification.
  google.protobuf.StringValue phone_number_verification_url = 8;
}

// An expanded dynamic search ad.
message ExpandedDynamicSearchAdInfo {

  // The description of the ad.
  google.protobuf.StringValue description = 1;
}

// A hotel ad.
message HotelAdInfo {
}
