<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/ads/googleads/v23/services/asset_generation_service.proto

namespace Google\Ads\GoogleAds\V23\Services;

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

/**
 * Request message for
 * [AssetGenerationService.GenerateText][google.ads.googleads.v23.services.AssetGenerationService.GenerateText]
 *
 * Generated from protobuf message <code>google.ads.googleads.v23.services.GenerateTextRequest</code>
 */
class GenerateTextRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The ID of the customer to generate assets for. Required.
     *
     * Generated from protobuf field <code>string customer_id = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $customer_id = '';
    /**
     * Required. Which field types text is being generated for. Supported values
     * are: HEADLINE, LONG_HEADLINE, DESCRIPTION. Required.
     *
     * Generated from protobuf field <code>repeated .google.ads.googleads.v23.enums.AssetFieldTypeEnum.AssetFieldType asset_field_types = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $asset_field_types;
    /**
     * Optional. Final url to use as a source for generating assets.
     * Required if existing_generation_context is not provided
     * or does not have a final url associated with it.
     *
     * Generated from protobuf field <code>string final_url = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $final_url = '';
    /**
     * Optional. A freeform description of what assets should be generated.
     * The string length must be between 1 and 1500, inclusive.
     *
     * Generated from protobuf field <code>string freeform_prompt = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $freeform_prompt = '';
    /**
     * Optional. A freeform list of keywords that are relevant,
     * used to inform asset generation.
     *
     * Generated from protobuf field <code>repeated string keywords = 7 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $keywords;
    protected $context;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $customer_id
     *           Required. The ID of the customer to generate assets for. Required.
     *     @type array<int>|\Google\Protobuf\Internal\RepeatedField $asset_field_types
     *           Required. Which field types text is being generated for. Supported values
     *           are: HEADLINE, LONG_HEADLINE, DESCRIPTION. Required.
     *     @type string $final_url
     *           Optional. Final url to use as a source for generating assets.
     *           Required if existing_generation_context is not provided
     *           or does not have a final url associated with it.
     *     @type string $freeform_prompt
     *           Optional. A freeform description of what assets should be generated.
     *           The string length must be between 1 and 1500, inclusive.
     *     @type array<string>|\Google\Protobuf\Internal\RepeatedField $keywords
     *           Optional. A freeform list of keywords that are relevant,
     *           used to inform asset generation.
     *     @type \Google\Ads\GoogleAds\V23\Services\AssetGenerationExistingContext $existing_generation_context
     *           Optional. The setting for which assets are being generated, such as an
     *           existing AssetGroup or AdGroupAd.
     *     @type int $advertising_channel_type
     *           Optional. The advertising channel for which to generate assets. Required
     *           if existing_context is not provided.
     *           Supported channel types:
     *           SEARCH, PERFORMANCE_MAX, DISPLAY, and DEMAND_GEN
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Ads\GoogleAds\V23\Services\AssetGenerationService::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The ID of the customer to generate assets for. Required.
     *
     * Generated from protobuf field <code>string customer_id = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getCustomerId()
    {
        return $this->customer_id;
    }

    /**
     * Required. The ID of the customer to generate assets for. Required.
     *
     * Generated from protobuf field <code>string customer_id = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setCustomerId($var)
    {
        GPBUtil::checkString($var, True);
        $this->customer_id = $var;

        return $this;
    }

    /**
     * Required. Which field types text is being generated for. Supported values
     * are: HEADLINE, LONG_HEADLINE, DESCRIPTION. Required.
     *
     * Generated from protobuf field <code>repeated .google.ads.googleads.v23.enums.AssetFieldTypeEnum.AssetFieldType asset_field_types = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getAssetFieldTypes()
    {
        return $this->asset_field_types;
    }

    /**
     * Required. Which field types text is being generated for. Supported values
     * are: HEADLINE, LONG_HEADLINE, DESCRIPTION. Required.
     *
     * Generated from protobuf field <code>repeated .google.ads.googleads.v23.enums.AssetFieldTypeEnum.AssetFieldType asset_field_types = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param array<int>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setAssetFieldTypes($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Ads\GoogleAds\V23\Enums\AssetFieldTypeEnum\AssetFieldType::class);
        $this->asset_field_types = $arr;

        return $this;
    }

    /**
     * Optional. Final url to use as a source for generating assets.
     * Required if existing_generation_context is not provided
     * or does not have a final url associated with it.
     *
     * Generated from protobuf field <code>string final_url = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getFinalUrl()
    {
        return $this->final_url;
    }

    /**
     * Optional. Final url to use as a source for generating assets.
     * Required if existing_generation_context is not provided
     * or does not have a final url associated with it.
     *
     * Generated from protobuf field <code>string final_url = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setFinalUrl($var)
    {
        GPBUtil::checkString($var, True);
        $this->final_url = $var;

        return $this;
    }

    /**
     * Optional. A freeform description of what assets should be generated.
     * The string length must be between 1 and 1500, inclusive.
     *
     * Generated from protobuf field <code>string freeform_prompt = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getFreeformPrompt()
    {
        return $this->freeform_prompt;
    }

    /**
     * Optional. A freeform description of what assets should be generated.
     * The string length must be between 1 and 1500, inclusive.
     *
     * Generated from protobuf field <code>string freeform_prompt = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setFreeformPrompt($var)
    {
        GPBUtil::checkString($var, True);
        $this->freeform_prompt = $var;

        return $this;
    }

    /**
     * Optional. A freeform list of keywords that are relevant,
     * used to inform asset generation.
     *
     * Generated from protobuf field <code>repeated string keywords = 7 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getKeywords()
    {
        return $this->keywords;
    }

    /**
     * Optional. A freeform list of keywords that are relevant,
     * used to inform asset generation.
     *
     * Generated from protobuf field <code>repeated string keywords = 7 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param array<string>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setKeywords($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->keywords = $arr;

        return $this;
    }

    /**
     * Optional. The setting for which assets are being generated, such as an
     * existing AssetGroup or AdGroupAd.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v23.services.AssetGenerationExistingContext existing_generation_context = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Ads\GoogleAds\V23\Services\AssetGenerationExistingContext|null
     */
    public function getExistingGenerationContext()
    {
        return $this->readOneof(3);
    }

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

    /**
     * Optional. The setting for which assets are being generated, such as an
     * existing AssetGroup or AdGroupAd.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v23.services.AssetGenerationExistingContext existing_generation_context = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Ads\GoogleAds\V23\Services\AssetGenerationExistingContext $var
     * @return $this
     */
    public function setExistingGenerationContext($var)
    {
        GPBUtil::checkMessage($var, \Google\Ads\GoogleAds\V23\Services\AssetGenerationExistingContext::class);
        $this->writeOneof(3, $var);

        return $this;
    }

    /**
     * Optional. The advertising channel for which to generate assets. Required
     * if existing_context is not provided.
     * Supported channel types:
     * SEARCH, PERFORMANCE_MAX, DISPLAY, and DEMAND_GEN
     *
     * Generated from protobuf field <code>.google.ads.googleads.v23.enums.AdvertisingChannelTypeEnum.AdvertisingChannelType advertising_channel_type = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return int
     */
    public function getAdvertisingChannelType()
    {
        return $this->readOneof(4);
    }

    public function hasAdvertisingChannelType()
    {
        return $this->hasOneof(4);
    }

    /**
     * Optional. The advertising channel for which to generate assets. Required
     * if existing_context is not provided.
     * Supported channel types:
     * SEARCH, PERFORMANCE_MAX, DISPLAY, and DEMAND_GEN
     *
     * Generated from protobuf field <code>.google.ads.googleads.v23.enums.AdvertisingChannelTypeEnum.AdvertisingChannelType advertising_channel_type = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param int $var
     * @return $this
     */
    public function setAdvertisingChannelType($var)
    {
        GPBUtil::checkEnum($var, \Google\Ads\GoogleAds\V23\Enums\AdvertisingChannelTypeEnum\AdvertisingChannelType::class);
        $this->writeOneof(4, $var);

        return $this;
    }

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

}

