// 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.googleads.v24.actions;

import "google/ads/googleads/v24/enums/preview_type.proto";
import "google/api/field_behavior.proto";

option csharp_namespace = "Google.Ads.GoogleAds.V24.Actions";
option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v24/actions;actions";
option java_multiple_files = true;
option java_outer_classname = "GenerateShareablePreviewsProto";
option java_package = "com.google.ads.googleads.v24.actions";
option objc_class_prefix = "GAA";
option php_namespace = "Google\\Ads\\GoogleAds\\V24\\Actions";
option ruby_package = "Google::Ads::GoogleAds::V24::Actions";

// Operation to generate shareable previews.
message GenerateShareablePreviewsOperation {
  // Required. The list of shareable previews to generate.
  repeated ShareablePreview shareable_previews = 1
      [(google.api.field_behavior) = REQUIRED];
}

// A shareable preview with its identifier.
message ShareablePreview {
  // Required. The type of preview to generate.
  google.ads.googleads.v24.enums.PreviewTypeEnum.PreviewType preview_type = 1
      [(google.api.field_behavior) = REQUIRED];

  // The identifier of the shareable preview.
  oneof identifier {
    // Ad group ad of the shareable preview. Only supported for preview type
    // YOUTUBE_LIVE_PREVIEW.
    // Format: customers/{customer_id}/adGroupAds/{ad_group_id}~{ad_id}
    string ad_group_ad = 2;

    // Asset group of the shareable preview.
    // Format: customers/{customer_id}/assetGroups/{asset_group_id}
    string asset_group = 3;
  }
}

// Result of the GenerateShareablePreviews action.
message GenerateShareablePreviewsResult {
  // List of previews.
  repeated ShareablePreviewResult previews = 1;
}

// Message to hold a shareable preview result.
message ShareablePreviewResult {
  // Expiration date time using the ISO-8601 format.
  string expiration_date_time = 3;

  // The result of the shareable preview.
  oneof result {
    // The result of a UI preview. Only populated for preview type UI_PREVIEW.
    UiPreviewResult ui_preview_result = 1;

    // The result of a YouTube live preview. Only populated for preview type
    // YOUTUBE_LIVE_PREVIEW.
    YouTubeLivePreviewResult youtube_live_preview_result = 2;
  }

  // The identifier of the shareable preview.
  oneof identifier {
    // Ad group ad of the shareable preview.
    // Format: customers/{customer_id}/adGroupAds/{ad_group_id}~{ad_id}
    string ad_group_ad = 4;

    // Asset group of the shareable preview.
    // Format: customers/{customer_id}/assetGroups/{asset_group_id}
    string asset_group = 5;
  }
}

// Message to hold a UI preview result.
message UiPreviewResult {
  // The shareable preview URL.
  string shareable_preview_url = 1;
}

// Message to hold a YouTube live preview result.
message YouTubeLivePreviewResult {
  // The shareable preview URL for YouTube videos.
  string youtube_preview_url = 1;

  // The shareable preview URL for YouTube TV.
  string youtube_tv_preview_url = 2;
}
