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

namespace Google\Ads\GoogleAds\V25\Services;

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

/**
 * Request message for
 * [RecommendationSubscriptionService.MutateRecommendationSubscription][google.ads.googleads.v25.services.RecommendationSubscriptionService.MutateRecommendationSubscription]
 *
 * Generated from protobuf message <code>google.ads.googleads.v25.services.MutateRecommendationSubscriptionRequest</code>
 */
class MutateRecommendationSubscriptionRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The ID of the subscribing customer.
     *
     * Generated from protobuf field <code>string customer_id = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $customer_id = '';
    /**
     * Required. The list of create or update operations.
     *
     * Generated from protobuf field <code>repeated .google.ads.googleads.v25.services.RecommendationSubscriptionOperation operations = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $operations;
    /**
     * If true, successful operations will be carried out and invalid
     * operations will return errors. If false, all operations will be carried
     * out in one transaction if and only if they are all valid.
     * Default is false.
     *
     * Generated from protobuf field <code>bool partial_failure = 3;</code>
     */
    protected $partial_failure = false;
    /**
     * If true, the request is validated but not executed. Only errors are
     * returned, not results.
     *
     * Generated from protobuf field <code>bool validate_only = 4;</code>
     */
    protected $validate_only = false;
    /**
     * The response content type setting. Determines whether the mutable resource
     * or just the resource name should be returned post mutation. The mutable
     * resource will only be returned if the resource has the appropriate response
     * field. For example, MutateCampaignResult.campaign.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v25.enums.ResponseContentTypeEnum.ResponseContentType response_content_type = 5;</code>
     */
    protected $response_content_type = 0;

    /**
     * @param string                                                                   $customerId Required. The ID of the subscribing customer.
     * @param \Google\Ads\GoogleAds\V25\Services\RecommendationSubscriptionOperation[] $operations Required. The list of create or update operations.
     *
     * @return \Google\Ads\GoogleAds\V25\Services\MutateRecommendationSubscriptionRequest
     *
     * @experimental
     */
    public static function build(string $customerId, array $operations): self
    {
        return (new self())
            ->setCustomerId($customerId)
            ->setOperations($operations);
    }

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $customer_id
     *           Required. The ID of the subscribing customer.
     *     @type \Google\Ads\GoogleAds\V25\Services\RecommendationSubscriptionOperation[] $operations
     *           Required. The list of create or update operations.
     *     @type bool $partial_failure
     *           If true, successful operations will be carried out and invalid
     *           operations will return errors. If false, all operations will be carried
     *           out in one transaction if and only if they are all valid.
     *           Default is false.
     *     @type bool $validate_only
     *           If true, the request is validated but not executed. Only errors are
     *           returned, not results.
     *     @type int $response_content_type
     *           The response content type setting. Determines whether the mutable resource
     *           or just the resource name should be returned post mutation. The mutable
     *           resource will only be returned if the resource has the appropriate response
     *           field. For example, MutateCampaignResult.campaign.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Ads\GoogleAds\V25\Services\RecommendationSubscriptionService::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The ID of the subscribing customer.
     *
     * 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 subscribing customer.
     *
     * 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. The list of create or update operations.
     *
     * Generated from protobuf field <code>repeated .google.ads.googleads.v25.services.RecommendationSubscriptionOperation operations = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return RepeatedField<\Google\Ads\GoogleAds\V25\Services\RecommendationSubscriptionOperation>
     */
    public function getOperations()
    {
        return $this->operations;
    }

    /**
     * Required. The list of create or update operations.
     *
     * Generated from protobuf field <code>repeated .google.ads.googleads.v25.services.RecommendationSubscriptionOperation operations = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Ads\GoogleAds\V25\Services\RecommendationSubscriptionOperation[] $var
     * @return $this
     */
    public function setOperations($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Ads\GoogleAds\V25\Services\RecommendationSubscriptionOperation::class);
        $this->operations = $arr;

        return $this;
    }

    /**
     * If true, successful operations will be carried out and invalid
     * operations will return errors. If false, all operations will be carried
     * out in one transaction if and only if they are all valid.
     * Default is false.
     *
     * Generated from protobuf field <code>bool partial_failure = 3;</code>
     * @return bool
     */
    public function getPartialFailure()
    {
        return $this->partial_failure;
    }

    /**
     * If true, successful operations will be carried out and invalid
     * operations will return errors. If false, all operations will be carried
     * out in one transaction if and only if they are all valid.
     * Default is false.
     *
     * Generated from protobuf field <code>bool partial_failure = 3;</code>
     * @param bool $var
     * @return $this
     */
    public function setPartialFailure($var)
    {
        GPBUtil::checkBool($var);
        $this->partial_failure = $var;

        return $this;
    }

    /**
     * If true, the request is validated but not executed. Only errors are
     * returned, not results.
     *
     * Generated from protobuf field <code>bool validate_only = 4;</code>
     * @return bool
     */
    public function getValidateOnly()
    {
        return $this->validate_only;
    }

    /**
     * If true, the request is validated but not executed. Only errors are
     * returned, not results.
     *
     * Generated from protobuf field <code>bool validate_only = 4;</code>
     * @param bool $var
     * @return $this
     */
    public function setValidateOnly($var)
    {
        GPBUtil::checkBool($var);
        $this->validate_only = $var;

        return $this;
    }

    /**
     * The response content type setting. Determines whether the mutable resource
     * or just the resource name should be returned post mutation. The mutable
     * resource will only be returned if the resource has the appropriate response
     * field. For example, MutateCampaignResult.campaign.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v25.enums.ResponseContentTypeEnum.ResponseContentType response_content_type = 5;</code>
     * @return int
     */
    public function getResponseContentType()
    {
        return $this->response_content_type;
    }

    /**
     * The response content type setting. Determines whether the mutable resource
     * or just the resource name should be returned post mutation. The mutable
     * resource will only be returned if the resource has the appropriate response
     * field. For example, MutateCampaignResult.campaign.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v25.enums.ResponseContentTypeEnum.ResponseContentType response_content_type = 5;</code>
     * @param int $var
     * @return $this
     */
    public function setResponseContentType($var)
    {
        GPBUtil::checkEnum($var, \Google\Ads\GoogleAds\V25\Enums\ResponseContentTypeEnum\ResponseContentType::class);
        $this->response_content_type = $var;

        return $this;
    }

}

