// 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 Campaign resource.
syntax = "proto3";

package google.ads.googleads.v0.resources;

import "google/ads/googleads/v0/common/bidding.proto";
import "google/ads/googleads/v0/common/custom_parameter.proto";
import "google/ads/googleads/v0/enums/ad_serving_optimization_status.proto";
import "google/ads/googleads/v0/enums/advertising_channel_sub_type.proto";
import "google/ads/googleads/v0/enums/advertising_channel_type.proto";
import "google/ads/googleads/v0/enums/bidding_strategy_type.proto";
import "google/ads/googleads/v0/enums/campaign_serving_status.proto";
import "google/ads/googleads/v0/enums/campaign_status.proto";
import "google/protobuf/wrappers.proto";

option java_package = "com.google.ads.googleads.v0.resources";
option java_outer_classname = "CampaignProto";
option java_multiple_files = true;

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

// A campaign.
message Campaign {

  // The resource name of the campaign.
  // Campaign resource names have the form:
  //
  // `customers/{customer_id}/campaigns/{campaign_id}`
  string resource_name = 1;

  // The ID of the campaign.
  google.protobuf.Int64Value id = 3;

  // The name of the campaign.
  //
  // This field is required and should not be empty when creating new
  // campaigns.
  //
  // It must not contain any null (code point 0x0), NL line feed
  // (code point 0xA) or carriage return (code point 0xD) characters.
  google.protobuf.StringValue name = 4;

  // The status of the campaign.
  //
  // When a new campaign is added, the status defaults to ENABLED.
  enums.CampaignStatusEnum.CampaignStatus status = 5;

  // The ad serving status of the campaign.
  enums.CampaignServingStatusEnum.CampaignServingStatus serving_status = 21;

  // The ad serving optimization status of the campaign.
  enums.AdServingOptimizationStatusEnum.AdServingOptimizationStatus
    ad_serving_optimization_status = 8;

  // The primary serving target for ads within the campaign.
  // The targeting options can be refined in `network_settings`.
  //
  // Can be set only when creating campaigns.
  // After the campaign is created, the field can not be changed.
  enums.AdvertisingChannelTypeEnum.AdvertisingChannelType
    advertising_channel_type = 9;

  // Optional refinement to `advertising_channel_type`.
  // Must be a valid sub-type of the parent channel type.
  //
  // Can be set only when creating campaigns.
  // After campaign is created, the field can not be changed.
  enums.AdvertisingChannelSubTypeEnum.AdvertisingChannelSubType
    advertising_channel_sub_type = 10;

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

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

  // The network settings for the campaign.
  NetworkSettings network_settings = 14;

  // The hotel setting for the campaign.
  HotelSettingInfo hotel_setting = 32;

  // The setting for controlling Dynamic Search Ads (DSA).
  DynamicSearchAdsSetting dynamic_search_ads_setting = 33;

  // The budget of the campaign.
  //
  // This field must not be used in WHERE clauses.
  google.protobuf.StringValue campaign_budget = 6;

  // The type of bidding strategy.
  //
  // A bidding strategy can be created by setting either the bidding scheme to
  // create a standard bidding strategy or the `bidding_strategy` field to
  // create a portfolio bidding strategy.
  //
  // This field is read-only.
  enums.BiddingStrategyTypeEnum.BiddingStrategyType bidding_strategy_type = 22;

  // The date when campaign started.
  //
  // This field must not be used in WHERE clauses.
  google.protobuf.StringValue start_date = 19;

  // The date when campaign ended.
  //
  // This field must not be used in WHERE clauses.
  google.protobuf.StringValue end_date = 20;

  // The bidding strategy for the campaign.
  //
  // Must be either portfolio (created via BiddingStrategy service) or
  // standard, that is embedded into the campaign.
  oneof campaign_bidding_strategy {

    // Portfolio bidding strategy used by campaign.
    //
    // This field must not be used in WHERE clauses.
    google.protobuf.StringValue bidding_strategy = 23;

    // Standard Manual CPC bidding strategy.
    // Manual click-based bidding where user pays per click.
    common.ManualCpc manual_cpc = 24;

    // Standard Manual CPM bidding strategy.
    // Manual impression-based bidding where user pays per thousand
    // impressions.
    common.ManualCpm manual_cpm = 25;

    // Standard Maximize Conversions bidding strategy that automatically
    // maximizes number of conversions given a daily budget.
    common.MaximizeConversions maximize_conversions = 30;

    // Standard Maximize Conversion Value bidding strategy that automatically
    // sets bids to maximize revenue while spending your budget.
    common.MaximizeConversionValue maximize_conversion_value = 31;

    // Standard Target CPA bidding strategy that automatically sets bids to
    // help get as many conversions as possible at the target
    // cost-per-acquisition (CPA) you set.
    common.TargetCpa target_cpa = 26;

    // Standard Target ROAS bidding strategy that automatically maximizes
    // revenue while averaging a specific target return on ad spend (ROAS).
    common.TargetRoas target_roas = 29;

    // Standard Target Spend bidding strategy that automatically sets your bids
    // to help get as many clicks as possible within your budget.
    common.TargetSpend target_spend = 27;

    // Standard Percent Cpc bidding strategy where bids are a fraction of the
    // advertised price for some good or service.
    common.PercentCpc percent_cpc = 34;
  }

  // The network settings for the campaign.
  message NetworkSettings {

    // Whether ads will be served with google.com search results.
    google.protobuf.BoolValue target_google_search = 1;

    // Whether ads will be served on partner sites in the Google Search Network
    // (requires `target_google_search` to also be `true`).
    google.protobuf.BoolValue target_search_network = 2;

    // Whether ads will be served on specified placements in the Google Display
    // Network. Placements are specified using the Placement criterion.
    google.protobuf.BoolValue target_content_network = 3;

    // Whether ads will be served on the Google Partner Network.
    // This is available only to some select Google partner accounts.
    google.protobuf.BoolValue target_partner_search_network = 4;
  }

  // Campaign-level settings for hotel ads.
  message HotelSettingInfo {

    // The linked Hotel Center account.
    google.protobuf.Int64Value hotel_center_id = 1;
  }

  // The setting for controlling Dynamic Search Ads (DSA).
  message DynamicSearchAdsSetting {

    // The Internet domain name that this setting represents, e.g., "google.com"
    // or "www.google.com".
    google.protobuf.StringValue domain_name = 1;

    // The language code specifying the language of the domain, e.g., "en".
    google.protobuf.StringValue language_code = 2;

    // Whether the campaign uses advertiser supplied URLs exclusively.
    google.protobuf.BoolValue use_supplied_urls_only = 3;

    // The list of page feeds associated with the campaign.
    repeated google.protobuf.Int64Value feed_ids = 4;
  }
}
