<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/ads/googleads/v25/actions/generate_shareable_previews.proto

namespace Google\Ads\GoogleAds\V25\Actions;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\GPBUtil;
use Google\Protobuf\RepeatedField;

/**
 * A shareable preview with its identifier.
 * Only Performance Max asset groups and certain YouTube video/audio ad formats
 * are supported. Other ad types, such as Responsive Search Ads or Responsive
 * Display Ads, are not supported and return an `UNSUPPORTED_AD_TYPE` error.
 * The generated preview URLs cannot be embedded in an iframe because the
 * response headers include `X-Frame-Options: deny`.
 *
 * Generated from protobuf message <code>google.ads.googleads.v25.actions.ShareablePreview</code>
 */
class ShareablePreview extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The type of preview to generate.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v25.enums.PreviewTypeEnum.PreviewType preview_type = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $preview_type = 0;
    protected $identifier;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $preview_type
     *           Required. The type of preview to generate.
     *     @type string $ad_group_ad
     *           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}
     *     @type string $asset_group
     *           Asset group of the shareable preview.
     *           Format: customers/{customer_id}/assetGroups/{asset_group_id}
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Ads\GoogleAds\V25\Actions\GenerateShareablePreviews::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The type of preview to generate.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v25.enums.PreviewTypeEnum.PreviewType preview_type = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return int
     */
    public function getPreviewType()
    {
        return $this->preview_type;
    }

    /**
     * Required. The type of preview to generate.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v25.enums.PreviewTypeEnum.PreviewType preview_type = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param int $var
     * @return $this
     */
    public function setPreviewType($var)
    {
        GPBUtil::checkEnum($var, \Google\Ads\GoogleAds\V25\Enums\PreviewTypeEnum\PreviewType::class);
        $this->preview_type = $var;

        return $this;
    }

    /**
     * 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}
     *
     * Generated from protobuf field <code>string ad_group_ad = 2;</code>
     * @return string
     */
    public function getAdGroupAd()
    {
        return $this->readOneof(2);
    }

    public function hasAdGroupAd()
    {
        return $this->hasOneof(2);
    }

    /**
     * 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}
     *
     * Generated from protobuf field <code>string ad_group_ad = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setAdGroupAd($var)
    {
        GPBUtil::checkString($var, True);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * Asset group of the shareable preview.
     * Format: customers/{customer_id}/assetGroups/{asset_group_id}
     *
     * Generated from protobuf field <code>string asset_group = 3;</code>
     * @return string
     */
    public function getAssetGroup()
    {
        return $this->readOneof(3);
    }

    public function hasAssetGroup()
    {
        return $this->hasOneof(3);
    }

    /**
     * Asset group of the shareable preview.
     * Format: customers/{customer_id}/assetGroups/{asset_group_id}
     *
     * Generated from protobuf field <code>string asset_group = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setAssetGroup($var)
    {
        GPBUtil::checkString($var, True);
        $this->writeOneof(3, $var);

        return $this;
    }

    /**
     * @return string
     */
    public function getIdentifier()
    {
        return $this->whichOneof("identifier");
    }

}

