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

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

// A Site represents a domain owned or represented by a network. For a parent
// network managing other networks as part of Multiple Customer Management
// "Manage Inventory" model, it could be the child's domain.
message Site {
  option (google.api.resource) = {
    type: "admanager.googleapis.com/Site"
    pattern: "networks/{network_code}/sites/{site}"
    plural: "sites"
    singular: "site"
  };

  // Identifier. The resource name of the `Site`.
  // Format: `networks/{network_code}/sites/{site_id}`
  string name = 1 [(google.api.field_behavior) = IDENTIFIER];

  // Required. The URL of the Site.
  optional string url = 3 [(google.api.field_behavior) = REQUIRED];

  // Optional. The network code of the child if the Site is being managed for an
  // MCM child network, or null if owned by this network.
  optional string child_network_code = 4
      [(google.api.field_behavior) = OPTIONAL];

  // Output only. Status of the review performed on the Site by Google.
  optional SiteApprovalStatusEnum.SiteApprovalStatus approval_status = 5
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. The latest Site approval status change time.
  optional google.protobuf.Timestamp approval_status_update_time = 6
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. Provides reasons for disapproving the Site. It is null when
  // the Site is not disapproved.
  repeated DisapprovalReason disapproval_reasons = 7
      [(google.api.field_behavior) = OUTPUT_ONLY];
}

// Represents the reason for which Google disapproved the Site.
message DisapprovalReason {
  // Output only. The type of policy violation found for the Site.
  optional SiteDisapprovalReasonEnum.SiteDisapprovalReason type = 1
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. Additional details for the disapproval of the Site.
  optional string details = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
}
