// 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/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 = "DestinationProto";
option java_package = "com.google.ads.datamanager.v1";
option php_namespace = "Google\\Ads\\DataManager\\V1";
option ruby_package = "Google::Ads::DataManager::V1";
option (google.api.resource_definition) = {
  type: "datamanager.googleapis.com/Account"
  pattern: "accountTypes/{account_type}/accounts/{account}"
};

// The Google product you're sending data to. For example, a Google
// Ads account.
message Destination {
  // Optional. ID for this `Destination` resource, unique within the request.
  // Use to reference this `Destination` in  the
  // [IngestEventsRequest][google.ads.datamanager.v1.IngestEventsRequest] and
  // [IngestAudienceMembersRequest][google.ads.datamanager.v1.IngestAudienceMembersRequest].
  string reference = 1 [(google.api.field_behavior) = OPTIONAL];

  // Optional. The account used to make this API call. To add or remove data
  // from the
  // [`operating_account`][google.ads.datamanager.v1.Destination.operating_account],
  // this `login_account` must have write access to the `operating_account`. For
  // example, a manager account of the `operating_account`, or an account with
  // an established link to the `operating_account`.
  ProductAccount login_account = 2 [(google.api.field_behavior) = OPTIONAL];

  // Optional. An account that the calling user's
  // [`login_account`][google.ads.datamanager.v1.Destination.login_account] has
  // access to, through an established account link. For example, a data
  // partner's `login_account` might have access to a client's `linked_account`.
  // The partner might use this field to send data from the `linked_account` to
  // another
  // [`operating_account`][google.ads.datamanager.v1.Destination.operating_account].
  ProductAccount linked_account = 3 [(google.api.field_behavior) = OPTIONAL];

  // Required. The account to send the data to or remove the data from.
  ProductAccount operating_account = 4 [(google.api.field_behavior) = REQUIRED];

  // Required. The object within the product account to ingest into. For
  // example, a Google Ads audience ID, a Display & Video 360 audience ID or a
  // Google Ads conversion action ID.
  string product_destination_id = 5 [(google.api.field_behavior) = REQUIRED];
}

// Represents a specific account.
message ProductAccount {
  // Represents Google account types. Used to locate accounts and
  // destinations.
  enum AccountType {
    // Unspecified product. Should never be used.
    ACCOUNT_TYPE_UNSPECIFIED = 0;

    // Google Ads.
    GOOGLE_ADS = 1;

    // Display & Video 360 partner.
    DISPLAY_VIDEO_PARTNER = 2;

    // Display & Video 360 advertiser.
    DISPLAY_VIDEO_ADVERTISER = 3;

    // Data Partner.
    DATA_PARTNER = 4;

    // Google Analytics.
    GOOGLE_ANALYTICS_PROPERTY = 5;

    // Google Ad Manager audience link.
    GOOGLE_AD_MANAGER_AUDIENCE_LINK = 6;

    // Floodlight configuration.
    FLOODLIGHT_CONFIG = 7;
  }

  // Deprecated. Use
  // [`account_type`][google.ads.datamanager.v1.ProductAccount.account_type]
  // instead.
  Product product = 1 [deprecated = true];

  // Required. The ID of the account. For example, your Google Ads account ID.
  string account_id = 2 [(google.api.field_behavior) = REQUIRED];

  // Optional. The type of the account. For example, `GOOGLE_ADS`.
  // Either `account_type` or the deprecated `product` is required.
  // If both are set, the values must match.
  AccountType account_type = 3 [(google.api.field_behavior) = OPTIONAL];
}

// Deprecated. Use
// [`AccountType`][google.ads.datamanager.v1.ProductAccount.AccountType]
// instead. Represents a specific Google product.
enum Product {
  option deprecated = true;

  // Unspecified product. Should never be used.
  PRODUCT_UNSPECIFIED = 0;

  // Google Ads.
  GOOGLE_ADS = 1;

  // Display & Video 360 partner.
  DISPLAY_VIDEO_PARTNER = 2;

  // Display & Video 360 advertiser.
  DISPLAY_VIDEO_ADVERTISER = 3;

  // Data Partner.
  DATA_PARTNER = 4;
}
