// 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/ad_unit_enums.proto";
import "google/ads/admanager/v1/ad_unit_messages.proto";
import "google/ads/admanager/v1/target_platform_enum.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 = "SuggestedAdUnitMessagesProto";
option java_package = "com.google.ads.admanager.v1";
option php_namespace = "Google\\Ads\\AdManager\\V1";
option ruby_package = "Google::Ads::AdManager::V1";

// A read-only suggestion for a new ad unit based on an ad tag that has served
// 10+ times in the past week for an undefined ad unit.
message SuggestedAdUnit {
  option (google.api.resource) = {
    type: "admanager.googleapis.com/SuggestedAdUnit"
    pattern: "networks/{network_code}/suggestedAdUnits/{suggested_ad_unit}"
    plural: "suggestedAdUnits"
    singular: "suggestedAdUnit"
  };

  // Identifier. Resource name of the `SuggestedAdUnit`.
  // Format: `networks/{network_code}/suggestedAdUnits/{suggested_ad_unit_id}`
  string name = 1 [(google.api.field_behavior) = IDENTIFIER];

  // Output only. Number of times the ad tag has been served in the past week.
  optional int64 weekly_request_count = 2
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. Path of suggested ad unit codes from the closest existing
  // ancestor ad unit that will all be created as ad units when the suggestion
  // is approved.
  //
  // Example:
  // If a -> b -> c are existing ad units with parent-child
  // relationships, and the suggested ad unit x is a child of c, the
  // `new_code_path` is (x).
  // If x is the grandchild of c, the `new_code_path` is (y, x)
  // where y is an ad unit that would be created as the parent ad unit of x (and
  // the child of c) if the suggestion is approved.
  repeated string new_code_path = 3 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. Code path of ad units leading up to and including the parent
  // of the first suggested ad unit. Combined with the `new_code_path` field,
  // this represents the full path for the suggested ad unit if approved.
  //
  // Example:
  // If a -> b -> c are existing ad units with parent-child relationships, and
  // the suggested ad unit x is a child of c, the `existing_code_path` is (a,
  // b, c). If x is the grandchild of c, the `existing_code_path` is also (a,
  // b, c).
  repeated AdUnitParent existing_code_path = 4
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. Target window of the underlying ad tag which will be used in
  // the ad unit if the suggestion is approved.
  optional TargetWindowEnum.TargetWindow target_window = 5
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. Target platform for the browser that clicked the underlying ad
  // tag.
  optional TargetPlatformEnum.TargetPlatform target_platform = 6
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. Sizes associated with this suggested ad unit.
  repeated AdUnitSize ad_unit_sizes = 7
      [(google.api.field_behavior) = OUTPUT_ONLY];
}
