// 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/custom_pacing_goal_unit_enum.proto";
import "google/api/field_behavior.proto";
import "google/protobuf/timestamp.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 = "CustomPacingCurveProto";
option java_package = "com.google.ads.admanager.v1";
option php_namespace = "Google\\Ads\\AdManager\\V1";
option ruby_package = "Google::Ads::AdManager::V1";

// A curve consisting of CustomPacingGoal objects that is used to pace line item
// delivery.
message CustomPacingCurve {
  // Required. The unit of the
  // [CustomPacingGoal.amount][google.ads.admanager.v1.CustomPacingGoal.amount]
  // values.
  optional CustomPacingGoalUnitEnum.CustomPacingGoalUnit
      custom_pacing_goal_unit = 1 [(google.api.field_behavior) = REQUIRED];

  // Required. The list of goals that make up the custom pacing curve.
  repeated CustomPacingGoal custom_pacing_goals = 2
      [(google.api.field_behavior) = REQUIRED];
}

// An interval of a CustomPacingCurve. A custom pacing goal contains a start
// time and an amount. The goal will apply until either the next custom pacing
// goal's getStartTime or the line item's end time if it is the last goal.
message CustomPacingGoal {
  // Optional. The start date and time of the goal. This field is required
  // unless
  // [use_line_item_start_time][google.ads.admanager.v1.CustomPacingGoal.use_line_item_start_time]
  // is true.
  optional google.protobuf.Timestamp start_time = 1
      [(google.api.field_behavior) = OPTIONAL];

  // Optional. Input only. Whether the [LineItem.start_time] should be used for
  // the start date and time of this goal. This field is not persisted and if it
  // is set to true, the [start_time] field will be populated by the line item's
  // start time.
  optional bool use_line_item_start_time = 2 [
    (google.api.field_behavior) = OPTIONAL,
    (google.api.field_behavior) = INPUT_ONLY
  ];

  // Optional. The amount associated with the goal. This field is required.
  optional int64 amount = 3 [(google.api.field_behavior) = OPTIONAL];
}
