// 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.datamanager.v1;

import "google/api/field_behavior.proto";
import "google/protobuf/timestamp.proto";

option csharp_namespace = "Google.Ads.DataManager.V1";
option go_package = "cloud.google.com/go/datamanager/apiv1/datamanagerpb;datamanagerpb";
option java_multiple_files = true;
option java_outer_classname = "UserListLicensePricingProto";
option java_package = "com.google.ads.datamanager.v1";
option php_namespace = "Google\\Ads\\DataManager\\V1";
option ruby_package = "Google::Ads::DataManager::V1";

// A user list license pricing.
message UserListLicensePricing {
  // User list pricing buyer approval state.
  enum UserListPricingBuyerApprovalState {
    // UNSPECIFIED.
    USER_LIST_PRICING_BUYER_APPROVAL_STATE_UNSPECIFIED = 0;

    // User list client has not yet accepted the pricing terms set by the user
    // list owner.
    PENDING = 1;

    // User list client has accepted the pricing terms set by the user list
    // owner.
    APPROVED = 2;

    // User list client has rejected the pricing terms set by the user list
    // owner.
    REJECTED = 3;
  }

  // User list pricing cost type.
  enum UserListPricingCostType {
    // Unspecified.
    USER_LIST_PRICING_COST_TYPE_UNSPECIFIED = 0;

    // Cost per click.
    CPC = 1;

    // Cost per mille (thousand impressions).
    CPM = 2;

    // Media share.
    MEDIA_SHARE = 3;
  }

  // Output only. The ID of this pricing.
  int64 pricing_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Optional. The cost associated with the model, in micro units (10^-6), in
  // the currency specified by the currency_code field. For example, 2000000
  // means $2 if `currency_code` is `USD`.
  optional int64 cost_micros = 2 [(google.api.field_behavior) = OPTIONAL];

  // Optional. The currency in which cost and max_cost is specified. Must be a
  // three-letter currency code defined in ISO 4217.
  optional string currency_code = 9 [(google.api.field_behavior) = OPTIONAL];

  // Output only. Start time of the pricing.
  google.protobuf.Timestamp start_time = 3
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Optional. End time of the pricing.
  google.protobuf.Timestamp end_time = 4
      [(google.api.field_behavior) = OPTIONAL];

  // Output only. Whether this pricing is active.
  bool pricing_active = 5 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. The buyer approval state of this pricing.
  //
  // This field is read-only.
  UserListPricingBuyerApprovalState buyer_approval_state = 6
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Immutable. The cost type of this pricing.
  //
  // Can be set only in the `create` operation. Can't be updated for
  // an existing license.
  optional UserListPricingCostType cost_type = 7
      [(google.api.field_behavior) = IMMUTABLE];

  // Optional. The maximum CPM a commerce audience can be charged when the
  // MEDIA_SHARE cost type is used. The value is in micro units (10^-6) and in
  // the currency specified by the currency_code field. For example, 2000000
  // means $2 if `currency_code` is `USD`.
  //
  // This is only relevant when cost_type is MEDIA_SHARE.
  // When cost_type is not MEDIA_SHARE, and this field is set, a
  // MAX_COST_NOT_ALLOWED error will be returned.
  // If not set or set to`0`, there is no cap.
  optional int64 max_cost_micros = 8 [(google.api.field_behavior) = OPTIONAL];
}
