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

import "google/ads/admanager/v1/mcm_enums.proto";
import "google/api/field_behavior.proto";
import "google/api/resource.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 = "ChildPublisherMessagesProto";
option java_package = "com.google.ads.admanager.v1";
option php_namespace = "Google\\Ads\\AdManager\\V1";
option ruby_package = "Google::Ads::AdManager::V1";

// The [ChildPublisher][google.ads.admanager.v1.ChildPublisher] resource.
message ChildPublisher {
  option (google.api.resource) = {
    type: "admanager.googleapis.com/ChildPublisher"
    pattern: "networks/{network_code}/childPublishers/{child_publisher}"
    plural: "childPublishers"
    singular: "childPublisher"
  };

  // Identifier. The resource name of the
  // [ChildPublisher][google.ads.admanager.v1.ChildPublisher]. Format:
  // `networks/{network_code}/childPublishers/{child_publisher_id}`
  string name = 1 [(google.api.field_behavior) = IDENTIFIER];

  // Required. The display name of the
  // [ChildPublisher][google.ads.admanager.v1.ChildPublisher].
  optional string display_name = 3 [(google.api.field_behavior) = REQUIRED];

  // Required. The email for the
  // [ChildPublisher][google.ads.admanager.v1.ChildPublisher].
  optional string email = 4 [(google.api.field_behavior) = REQUIRED];

  // Immutable. The resource name of the
  // [ChildPublisher][google.ads.admanager.v1.ChildPublisher]'s Ad Manager
  // network.
  //
  // Format: `networks/{network_code}`
  optional string child_network = 5 [
    (google.api.field_behavior) = IMMUTABLE,
    (google.api.resource_reference) = {
      type: "admanager.googleapis.com/Network"
    }
  ];

  // Required. The type of delegation for the
  // [ChildPublisher][google.ads.admanager.v1.ChildPublisher].
  //
  // This attribute is immutable while the relationship is active.
  optional DelegationTypeEnum.DelegationType delegation_type = 9
      [(google.api.field_behavior) = REQUIRED];

  // Optional. The revenue share that the parent publisher will receive in
  // millipercent. For example, 15000 millipercent is 15%.
  //
  // This attribute is only settable for Manage Account
  // [ChildPublisher][google.ads.admanager.v1.ChildPublisher]s of non-reseller
  // parent publishers. Otherwise, it is read-only and always 100%.
  //
  // Additionally, this attribute is immutable while the relationship is active.
  optional int64 parent_revenue_share_millipercent = 10
      [(google.api.field_behavior) = OPTIONAL];

  // Optional. The seller ID for the
  // [ChildPublisher][google.ads.admanager.v1.ChildPublisher], as specified in
  // the parent publisher's sellers.json file.
  //
  // This attribute is only applicable to Manage Inventory
  // [ChildPublisher][google.ads.admanager.v1.ChildPublisher]s.
  optional string seller_id = 11 [(google.api.field_behavior) = OPTIONAL];

  // Output only. The overall onboarding readiness of the
  // [ChildPublisher][google.ads.admanager.v1.ChildPublisher].
  //
  // This status is correlated with ad serving, but does not include site-level
  // approval information.
  optional McmReadinessStatusEnum.McmReadinessStatus readiness_status = 12
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. The status of the invitation request to the
  // [ChildPublisher][google.ads.admanager.v1.ChildPublisher].
  optional DelegationInvitationStatusEnum.DelegationInvitationStatus
      invitation_status = 13 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. The approval status of the
  // [ChildPublisher][google.ads.admanager.v1.ChildPublisher].
  optional DelegationApprovalStatusEnum.DelegationApprovalStatus
      approval_status = 15 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. The status of the
  // [ChildPublisher][google.ads.admanager.v1.ChildPublisher]'s identity
  // verification.
  optional ChildPublisherIdentityVerificationStatusEnum
      .ChildPublisherIdentityVerificationStatus identity_verification_status =
      17 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. The status of the
  // [ChildPublisher][google.ads.admanager.v1.ChildPublisher]'s address
  // verification (i.e., mail PIN).
  optional ChildPublisherAddressVerificationStatusEnum
      .ChildPublisherAddressVerificationStatus address_verification_status = 19
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. The pending onboarding tasks that must be completed by the
  // child publisher before Google's policy compliance (i.e.
  // [DelegationApprovalStatus.PENDING_GOOGLE_APPROVAL][]) can be verified.
  repeated ChildPublisherOnboardingTaskEnum.ChildPublisherOnboardingTask
      pending_onboarding_tasks = 22 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. The account status of the
  // [ChildPublisher][google.ads.admanager.v1.ChildPublisher].
  optional DelegationAccountStatusEnum.DelegationAccountStatus account_status =
      26 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. Provides the approved revenue share that the parent publisher
  // will receive in millipercent. For example, 15000 millipercent is 15%.
  //
  // This attribute is only set for Manage Account
  // [ChildPublisher][google.ads.admanager.v1.ChildPublisher]s of non-reseller
  // parent publishers.
  optional int64 approved_manage_account_revenue_share_millipercent = 29
      [(google.api.field_behavior) = OUTPUT_ONLY];
}
