// Copyright 2026 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.admanager.v1;

import "google/ads/admanager/v1/goal_enums.proto";

option csharp_namespace = "Google.Ads.AdManager.V1";
option go_package = "google.golang.org/genproto/googleapis/ads/admanager/v1;admanager";
option java_multiple_files = true;
option java_outer_classname = "GoalProto";
option java_package = "com.google.ads.admanager.v1";
option php_namespace = "Google\\Ads\\AdManager\\V1";
option ruby_package = "Google::Ads::AdManager::V1";

// Defines the criteria a [LineItem][google.ads.admanager.v1.LineItem] needs to
// satisfy to meet its delivery goal.
message Goal {
  // The type of the goal for the LineItem. It defines the period over which the
  // goal should be reached.
  optional GoalTypeEnum.GoalType goal_type = 1;

  // The type of the goal unit for the LineItem.
  optional UnitTypeEnum.UnitType unit_type = 2;

  // If this is a primary goal, it represents the number or percentage of
  // impressions or clicks that will be reserved. If the line item is of type
  // [LineItemTypeEnum.LineItemType.SPONSORSHIP][google.ads.admanager.v1.LineItemTypeEnum.LineItemType.SPONSORSHIP],
  // it represents the percentage of available impressions reserved. If the line
  // item is of type
  // [LineItemTypeEnum.LineItemType.BULK][google.ads.admanager.v1.LineItemTypeEnum.LineItemType.BULK]
  // or
  // [LineItemTypeEnum.LineItemType.PRICE_PRIORITY][google.ads.admanager.v1.LineItemTypeEnum.LineItemType.PRICE_PRIORITY],
  // it represents the number of remaining impressions reserved. If the line
  // item is of type
  // [LineItemTypeEnum.LineItemType.NETWORK][google.ads.admanager.v1.LineItemTypeEnum.LineItemType.NETWORK]
  // or
  // [LineItemTypeEnum.LineItemType.HOUSE][google.ads.admanager.v1.LineItemTypeEnum.LineItemType.HOUSE],
  // it represents the percentage of remaining impressions reserved. <p>If this
  // is an impression cap goal, it represents the number of impressions or
  // conversions that the line item will stop serving at if reached. For valid
  // line item types, see [LineItem.impressions_cap][].
  optional int64 units = 3;
}
