// 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/creative_wrapper_enums.proto";
import "google/ads/admanager/v1/third_party_data_declaration.proto";
import "google/ads/admanager/v1/video_tracking_url.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 = "CreativeWrapperMessagesProto";
option java_package = "com.google.ads.admanager.v1";
option php_namespace = "Google\\Ads\\AdManager\\V1";
option ruby_package = "Google::Ads::AdManager::V1";

// A `CreativeWrapper` allows the wrapping of HTML snippets to be served along
// with Creative objects.
//
// `CreativeWrapper` must be associated with a
// [LabelType.CREATIVE_WRAPPER][google.ads.admanager.v1.LabelTypeEnum.LabelType.CREATIVE_WRAPPER]
// label and applied to ad units by
// [AdUnit.appliedLabels][google.ads.admanager.v1.AdUnit.applied_labels].
message CreativeWrapper {
  option (google.api.resource) = {
    type: "admanager.googleapis.com/CreativeWrapper"
    pattern: "networks/{network_code}/creativeWrappers/{creative_wrapper}"
    plural: "creativeWrappers"
    singular: "creativeWrapper"
  };

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

  // Required. Immutable. The resource name of the
  // [Label][google.ads.admanager.v1.Label].
  // Format:`networks/{network_code}/label/{label_id}`
  string label = 4 [
    (google.api.field_behavior) = IMMUTABLE,
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = { type: "admanager.googleapis.com/Label" }
  ];

  // Required. The `creative_wrapper_type`. If the `creative_wrapper_type` is
  // [CreativeWrapperType.VIDEO_TRACKING_URL][google.ads.admanager.v1.CreativeWrapperTypeEnum.CreativeWrapperType.VIDEO_TRACKING_URL],
  // the `video_tracking_urls` field must be set. If the `creative_wrapper_type`
  // is
  // [CreativeWrapperType.HTML][google.ads.admanager.v1.CreativeWrapperTypeEnum.CreativeWrapperType.HTML],
  // either the header or footer field must be set.
  optional CreativeWrapperTypeEnum.CreativeWrapperType creative_wrapper_type = 5
      [(google.api.field_behavior) = REQUIRED];

  // Output only. The resource name of the
  // [Creative][google.ads.admanager.v1.Creative]. Format:
  // `networks/{network_code}/creative/{creative_id}`
  optional string header_creative = 7 [
    (google.api.field_behavior) = OUTPUT_ONLY,
    (google.api.resource_reference) = {
      type: "admanager.googleapis.com/Creative"
    }
  ];

  // Output only. The resource name of the
  // [Creative][google.ads.admanager.v1.Creative]. Format:
  // `networks/{network_code}/creative/{creative_id}`
  optional string footer_creative = 9 [
    (google.api.field_behavior) = OUTPUT_ONLY,
    (google.api.resource_reference) = {
      type: "admanager.googleapis.com/Creative"
    }
  ];

  // Optional. The header HTML snippet that this `CreativeWrapper` delivers.
  optional string html_header = 11 [(google.api.field_behavior) = OPTIONAL];

  // Optional. The footer HTML snippet that this `CreativeWrapper` delivers.
  optional string html_footer = 12 [(google.api.field_behavior) = OPTIONAL];

  // Optional. The header AMP snippet that this `CreativeWrapper` delivers.
  optional string amp_header = 13 [(google.api.field_behavior) = OPTIONAL];

  // Optional. The footer AMP snippet that this `CreativeWrapper` delivers.
  optional string amp_footer = 14 [(google.api.field_behavior) = OPTIONAL];

  // Optional. The video tracking URLs that this `CreativeWrapper` delivers.
  // This field is required if the `creative_wrapper_type` is
  // [CreativeWrapperType.VIDEO_TRACKING_URL][google.ads.admanager.v1.CreativeWrapperTypeEnum.CreativeWrapperType.VIDEO_TRACKING_URL]
  // and ignored otherwise.
  repeated VideoTrackingUrl video_tracking_urls = 15
      [(google.api.field_behavior) = OPTIONAL];

  // Optional. The `ThirdPartyDataDeclaration` for this creative wrapper.
  //
  // The third party companies that are associated with this `CreativeWrapper`
  // and are present in the `html_header` or `html_footer`. This field is only
  // applicable when the `creative_wrapper_type` is
  // [CreativeWrapperType.HTML][google.ads.admanager.v1.CreativeWrapperTypeEnum.CreativeWrapperType.HTML].
  optional ThirdPartyDataDeclaration third_party_data_declaration = 16
      [(google.api.field_behavior) = OPTIONAL];

  // Optional. If there are multiple wrappers for a
  // [Creative][google.ads.admanager.v1.Creative], then ordering
  // defines the order in which the HTML snippets are rendered.
  optional CreativeWrapperOrderingEnum.CreativeWrapperOrdering ordering = 20
      [(google.api.field_behavior) = OPTIONAL];

  // Output only. The status of the `CreativeWrapper`.
  optional CreativeWrapperStatusEnum.CreativeWrapperStatus status = 21
      [(google.api.field_behavior) = OUTPUT_ONLY];
}
