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

// An AdSpot is a targetable entity used in the creation of AdRule objects. A ad
// spot contains a variable number of ads and has constraints (ad duration,
// reservation type, etc) on the ads that can appear in it.
message AdSpot {
  option (google.api.resource) = {
    type: "admanager.googleapis.com/AdSpot"
    pattern: "networks/{network_code}/adSpots/{ad_spot}"
    plural: "adSpots"
    singular: "adSpot"
  };

  // Identifier. The resource name of the `AdSpot`.
  // Format: `networks/{network_code}/adSpots/{ad_spot_id}`
  string name = 1 [(google.api.field_behavior) = IDENTIFIER];

  // Optional. Name of the AdSpot. The name is case insensitive and can be
  // referenced in ad tags. This value is required if `customSpot` is true, and
  // cannot be set otherwise. You can use alphanumeric characters and symbols
  // other than the following: ", ', =, !, +, #, , ~, ;, ^, (, ), <, >, [, ],
  // the white space character.
  optional string canonical_display_name = 2
      [(google.api.field_behavior) = OPTIONAL];

  // Optional. Descriptive name for the `AdSpot`.This value is optional if
  // `customSpot` is true, and cannot be set otherwise.
  optional string display_name = 3 [(google.api.field_behavior) = OPTIONAL];

  // Optional. Whether this ad spot is a custom spot. This field is optional and
  // defaults to false. Custom spots can be reused and targeted in the targeting
  // picker.
  optional bool custom_spot = 4 [(google.api.field_behavior) = OPTIONAL];

  // Optional. Whether this ad spot is a flexible spot. This field is optional
  // and defaults to false. Flexible spots are allowed to have no max number of
  // ads.
  optional bool flexible = 5 [(google.api.field_behavior) = OPTIONAL];

  // Optional. The maximum total duration for this AdSpot. This field is
  // optional, defaults to 0, and supports precision to the nearest second.
  optional google.protobuf.Duration max_duration = 6
      [(google.api.field_behavior) = OPTIONAL];

  // Optional. The minimum allowed duration for ads in the AdSpot. This field is
  // optional and defaults to 0.
  optional google.protobuf.Duration min_ad_duration = 12
      [(google.api.field_behavior) = OPTIONAL];

  // Required. The maximum allowed duration for ads in the `AdSpot`. This field
  // is required and must be greater than
  // [min_ad_duration][google.ads.admanager.v1.AdSpot.min_ad_duration].
  optional google.protobuf.Duration max_ad_duration = 13
      [(google.api.field_behavior) = REQUIRED];

  // Optional. The maximum number of ads allowed in the AdSpot. This field is
  // optional and defaults to 0. A value of 0 means that there is no maximum for
  // the number of ads in the ad spot. No max ads is only supported for ad spots
  // that have flexible set to true.
  optional int32 max_ads = 7 [(google.api.field_behavior) = OPTIONAL];

  // Optional. The AdSpot TargetingType determines how this ad spot can be
  // targeted. This field is required.
  optional AdSpotTargetingTypeEnum.AdSpotTargetingType targeting_type = 8
      [(google.api.field_behavior) = OPTIONAL];

  // Optional. Whether backfill is blocked in this ad spot. This field is
  // optional and defaults to false.
  optional bool backfill_blocked = 9 [(google.api.field_behavior) = OPTIONAL];

  // Optional. The set of line item types that may appear in the ad spot. This
  // field is optional and defaults to an empty set, which means that all types
  // are allowed. Note, backfill reservation types are controlled by the
  // `backfillBlocked` field.
  repeated LineItemTypeEnum.LineItemType allowed_line_item_types = 10
      [(google.api.field_behavior) = OPTIONAL];

  // Optional. Whether inventory sharing is blocked in this ad spot. This field
  // is optional and defaults to false.
  optional bool inventory_sharing_blocked = 11
      [(google.api.field_behavior) = OPTIONAL];
}
