// Copyright 2025 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/deal_buyer_permission_type_enum.proto";
import "google/ads/admanager/v1/private_marketplace_enums.proto";
import "google/ads/admanager/v1/size.proto";
import "google/ads/admanager/v1/targeting.proto";
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/protobuf/timestamp.proto";
import "google/type/money.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 = "PrivateAuctionDealMessagesProto";
option java_package = "com.google.ads.admanager.v1";
option php_namespace = "Google\\Ads\\AdManager\\V1";
option ruby_package = "Google::Ads::AdManager::V1";

// The `PrivateAuctionDeal` resource.
message PrivateAuctionDeal {
  option (google.api.resource) = {
    type: "admanager.googleapis.com/PrivateAuctionDeal"
    pattern: "networks/{network_code}/privateAuctionDeals/{private_auction_deal}"
    plural: "privateAuctionDeals"
    singular: "privateAuctionDeal"
  };

  // Contains buyer data. This data is required by the Marketplace API.
  message BuyerData {
    // Optional. The email contacts of the buyer of the `PrivateAuctionDeal`.
    repeated string buyer_emails = 1 [(google.api.field_behavior) = OPTIONAL];
  }

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

  // Output only. `PrivateAuctionDeal` ID.
  optional int64 private_auction_deal_id = 2
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Immutable. The ID of the
  // [PrivateAuction](google.ads.admanager.v1.PrivateAuction).
  optional int64 private_auction_id = 3
      [(google.api.field_behavior) = IMMUTABLE];

  // Output only. The display name of the
  // [PrivateAuction](google.ads.admanager.v1.PrivateAuction).
  optional string private_auction_display_name = 20
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Immutable. The account ID of the buyer of the `PrivateAuctionDeal`.
  optional int64 buyer_account_id = 4 [(google.api.field_behavior) = IMMUTABLE];

  // Output only. The external ID of the `PrivateAuctionDeal`.
  optional int64 external_deal_id = 5
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Optional. The targeting of the `PrivateAuctionDeal`.
  optional Targeting targeting = 6 [(google.api.field_behavior) = OPTIONAL];

  // Optional. The end time of the `PrivateAuctionDeal`.
  optional google.protobuf.Timestamp end_time = 8
      [(google.api.field_behavior) = OPTIONAL];

  // Required. The floor price of the `PrivateAuctionDeal`.
  optional google.type.Money floor_price = 9
      [(google.api.field_behavior) = REQUIRED];

  // Optional. The expected creative sizes of the `PrivateAuctionDeal`.
  repeated Size creative_sizes = 18 [(google.api.field_behavior) = OPTIONAL];

  // Output only. The status of the `PrivateAuctionDeal`.
  optional PrivateMarketplaceDealStatusEnum.PrivateMarketplaceDealStatus
      status = 10 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Optional. Whether the deal is enabled with priority over open auction.
  optional bool auction_priority_enabled = 11
      [(google.api.field_behavior) = OPTIONAL];

  // Optional. Whether the deal has block override enabled.
  optional bool block_override_enabled = 12
      [(google.api.field_behavior) = OPTIONAL];

  // Optional. The buyer permission model defining how the deal would transact
  // among all buyers under the same bidder.
  optional DealBuyerPermissionTypeEnum.DealBuyerPermissionType
      buyer_permission_type = 13 [(google.api.field_behavior) = OPTIONAL];

  // Optional. The buyer data required by the Marketplace API.
  optional BuyerData buyer_data = 14 [(google.api.field_behavior) = OPTIONAL];

  // Output only. The instant at which the `PrivateAuctionDeal` was created.
  optional google.protobuf.Timestamp create_time = 15
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. The instant at which the `PrivateAuctionDeal` was last
  // updated.
  optional google.protobuf.Timestamp update_time = 16
      [(google.api.field_behavior) = OUTPUT_ONLY];
}
