// 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/ads/datamanager/v1/user_list_global_license_type.proto";
import "google/ads/datamanager/v1/user_list_license_client_account_type.proto";
import "google/ads/datamanager/v1/user_list_license_metrics.proto";
import "google/ads/datamanager/v1/user_list_license_pricing.proto";
import "google/ads/datamanager/v1/user_list_license_status.proto";
import "google/api/field_behavior.proto";
import "google/api/resource.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 = "UserListGlobalLicenseProto";
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 global license.
//
// This feature is only available to data partners.
message UserListGlobalLicense {
  option (google.api.resource) = {
    type: "datamanager.googleapis.com/UserListGlobalLicense"
    pattern: "accountTypes/{account_type}/accounts/{account}/userListGlobalLicenses/{user_list_global_license}"
    plural: "userListGlobalLicenses"
    singular: "userListGlobalLicense"
  };

  // Identifier. The resource name of the user list global license.
  string name = 1 [(google.api.field_behavior) = IDENTIFIER];

  // Immutable. ID of the user list being licensed.
  optional int64 user_list_id = 2 [(google.api.field_behavior) = IMMUTABLE];

  // Output only. Name of the user list being licensed.
  //
  // This field is read-only.
  string user_list_display_name = 3 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Immutable. Product type of client customer which the user list is being
  // licensed to.
  optional UserListGlobalLicenseType license_type = 4
      [(google.api.field_behavior) = IMMUTABLE];

  // Optional. Status of UserListGlobalLicense - ENABLED or DISABLED.
  optional UserListLicenseStatus status = 5
      [(google.api.field_behavior) = OPTIONAL];

  // Optional. UserListGlobalLicense pricing.
  UserListLicensePricing pricing = 6 [(google.api.field_behavior) = OPTIONAL];

  // Output only. Pricing history of this user list license.
  //
  // This field is read-only.
  repeated UserListLicensePricing historical_pricings = 7
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. Metrics related to this license
  //
  // This field is read-only and only populated if the start and end dates are
  // set in the ListUserListGlobalLicenses call
  UserListLicenseMetrics metrics = 8
      [(google.api.field_behavior) = OUTPUT_ONLY];
}

// Information about a customer of a user list global license.  This will
// automatically be created by the system when a customer purchases a global
// license.
message UserListGlobalLicenseCustomerInfo {
  option (google.api.resource) = {
    type: "datamanager.googleapis.com/UserListGlobalLicenseCustomerInfo"
    pattern: "accountTypes/{account_type}/accounts/{account}/userListGlobalLicenses/{user_list_global_license}/customerInfos/{license_customer_info}"
    plural: "userListGlobalLicenseCustomerInfos"
    singular: "userListGlobalLicenseCustomerInfo"
  };

  // Identifier. The resource name of the user list global license customer.
  string name = 1 [(google.api.field_behavior) = IDENTIFIER];

  // Output only. ID of the user list being licensed.
  int64 user_list_id = 2 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. Name of the user list being licensed.
  string user_list_display_name = 3 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. Product type of client customer which the user list is being
  // licensed to.
  UserListGlobalLicenseType license_type = 4
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. Status of UserListDirectLicense - ENABLED or DISABLED.
  UserListLicenseStatus status = 5 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. UserListDirectLicense pricing.
  UserListLicensePricing pricing = 6
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. Product type of client customer which the user list is being
  // licensed to.
  UserListLicenseClientAccountType client_account_type = 7
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. ID of client customer which the user list is being licensed
  // to.
  int64 client_account_id = 8 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. Name of client customer which the user list is being licensed
  // to.
  string client_account_display_name = 9
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. Pricing history of this user list license.
  repeated UserListLicensePricing historical_pricings = 10
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. Metrics related to this license
  //
  // This field is only populated if the start and end dates are set in the
  // ListUserListGlobalLicenseCustomerInfos call.
  UserListLicenseMetrics metrics = 11
      [(google.api.field_behavior) = OUTPUT_ONLY];
}
