<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/bigquery/datapolicies/v1beta1/datapolicy.proto

namespace Google\Cloud\BigQuery\DataPolicies\V1beta1;

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

/**
 * Request message for the CreateDataPolicy method.
 *
 * Generated from protobuf message <code>google.cloud.bigquery.datapolicies.v1beta1.CreateDataPolicyRequest</code>
 */
class CreateDataPolicyRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. Resource name of the project that the data policy will belong to. The
     * format is `projects/{project_number}/locations/{location_id}`.
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     */
    private $parent = '';
    /**
     * Required. The data policy to create. The `name` field does not need to be
     * provided for the data policy creation.
     *
     * Generated from protobuf field <code>.google.cloud.bigquery.datapolicies.v1beta1.DataPolicy data_policy = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $data_policy = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $parent
     *           Required. Resource name of the project that the data policy will belong to. The
     *           format is `projects/{project_number}/locations/{location_id}`.
     *     @type \Google\Cloud\BigQuery\DataPolicies\V1beta1\DataPolicy $data_policy
     *           Required. The data policy to create. The `name` field does not need to be
     *           provided for the data policy creation.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Bigquery\Datapolicies\V1Beta1\Datapolicy::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. Resource name of the project that the data policy will belong to. The
     * format is `projects/{project_number}/locations/{location_id}`.
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getParent()
    {
        return $this->parent;
    }

    /**
     * Required. Resource name of the project that the data policy will belong to. The
     * format is `projects/{project_number}/locations/{location_id}`.
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setParent($var)
    {
        GPBUtil::checkString($var, True);
        $this->parent = $var;

        return $this;
    }

    /**
     * Required. The data policy to create. The `name` field does not need to be
     * provided for the data policy creation.
     *
     * Generated from protobuf field <code>.google.cloud.bigquery.datapolicies.v1beta1.DataPolicy data_policy = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Cloud\BigQuery\DataPolicies\V1beta1\DataPolicy|null
     */
    public function getDataPolicy()
    {
        return $this->data_policy;
    }

    public function hasDataPolicy()
    {
        return isset($this->data_policy);
    }

    public function clearDataPolicy()
    {
        unset($this->data_policy);
    }

    /**
     * Required. The data policy to create. The `name` field does not need to be
     * provided for the data policy creation.
     *
     * Generated from protobuf field <code>.google.cloud.bigquery.datapolicies.v1beta1.DataPolicy data_policy = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Cloud\BigQuery\DataPolicies\V1beta1\DataPolicy $var
     * @return $this
     */
    public function setDataPolicy($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\DataPolicies\V1beta1\DataPolicy::class);
        $this->data_policy = $var;

        return $this;
    }

}

