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

import "google/ads/datamanager/v1/consent.proto";
import "google/ads/datamanager/v1/user_data.proto";
import "google/api/field_behavior.proto";

option csharp_namespace = "Google.Ads.DataManager.V1";
option go_package = "google.golang.org/genproto/googleapis/ads/datamanager/v1;datamanager";
option java_multiple_files = true;
option java_outer_classname = "AudienceProto";
option java_package = "com.google.ads.datamanager.v1";
option php_namespace = "Google\\Ads\\DataManager\\V1";
option ruby_package = "Google::Ads::DataManager::V1";

// The audience member to be operated on.
message AudienceMember {
  // The type of identifying data to be operated on.
  oneof data {
    // User-provided data that identifies the user.
    UserData user_data = 2;

    // [Publisher Advertiser Identity Reconciliation (PAIR)
    // IDs](//support.google.com/admanager/answer/15067908).
    PairData pair_data = 4;

    // Data identifying the user's mobile devices.
    MobileData mobile_data = 5;
  }

  // Optional. The consent setting for the user.
  Consent consent = 3 [(google.api.field_behavior) = OPTIONAL];
}

// [PAIR](//support.google.com/admanager/answer/15067908) IDs for the audience.
// At least one PAIR ID is required.
message PairData {
  // Required. Cleanroom-provided PII data, hashed with SHA256, and encrypted
  // with an EC commutative cipher using publisher key for the
  // [PAIR]((//support.google.com/admanager/answer/15067908)) user list. At most
  // 10 `pairIds` can be provided in a single
  // [AudienceMember][google.ads.datamanager.v1.AudienceMember].
  repeated string pair_ids = 1 [(google.api.field_behavior) = REQUIRED];
}

// Mobile IDs for the audience. At least one mobile ID is required.
message MobileData {
  // Required. The list of mobile device IDs (advertising ID/IDFA). At most 10
  // `mobileIds` can be provided in a single
  // [AudienceMember][google.ads.datamanager.v1.AudienceMember].
  repeated string mobile_ids = 1 [(google.api.field_behavior) = REQUIRED];
}
