<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/iam/v2/policy.proto

namespace Google\Cloud\Iam\V2;

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

/**
 * Request message for `DeletePolicy`.
 *
 * Generated from protobuf message <code>google.iam.v2.DeletePolicyRequest</code>
 */
class DeletePolicyRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The resource name of the policy to delete. Format:
     * `policies/{attachment_point}/denypolicies/{policy_id}`
     * Use the URL-encoded full resource name, which means that the forward-slash
     * character, `/`, must be written as `%2F`. For example,
     * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`.
     * For organizations and folders, use the numeric ID in the full resource
     * name. For projects, you can use the alphanumeric or the numeric ID.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $name = '';
    /**
     * Optional. The expected `etag` of the policy to delete. If the value does not match
     * the value that is stored in IAM, the request fails with a `409` error code
     * and `ABORTED` status.
     * If you omit this field, the policy is deleted regardless of its current
     * `etag`.
     *
     * Generated from protobuf field <code>string etag = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $etag = '';

    /**
     * @param string $name Required. The resource name of the policy to delete. Format:
     *                     `policies/{attachment_point}/denypolicies/{policy_id}`
     *
     *
     *                     Use the URL-encoded full resource name, which means that the forward-slash
     *                     character, `/`, must be written as `%2F`. For example,
     *                     `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`.
     *
     *                     For organizations and folders, use the numeric ID in the full resource
     *                     name. For projects, you can use the alphanumeric or the numeric ID.
     *
     * @return \Google\Cloud\Iam\V2\DeletePolicyRequest
     *
     * @experimental
     */
    public static function build(string $name): self
    {
        return (new self())
            ->setName($name);
    }

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           Required. The resource name of the policy to delete. Format:
     *           `policies/{attachment_point}/denypolicies/{policy_id}`
     *           Use the URL-encoded full resource name, which means that the forward-slash
     *           character, `/`, must be written as `%2F`. For example,
     *           `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`.
     *           For organizations and folders, use the numeric ID in the full resource
     *           name. For projects, you can use the alphanumeric or the numeric ID.
     *     @type string $etag
     *           Optional. The expected `etag` of the policy to delete. If the value does not match
     *           the value that is stored in IAM, the request fails with a `409` error code
     *           and `ABORTED` status.
     *           If you omit this field, the policy is deleted regardless of its current
     *           `etag`.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Iam\V2\Policy::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The resource name of the policy to delete. Format:
     * `policies/{attachment_point}/denypolicies/{policy_id}`
     * Use the URL-encoded full resource name, which means that the forward-slash
     * character, `/`, must be written as `%2F`. For example,
     * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`.
     * For organizations and folders, use the numeric ID in the full resource
     * name. For projects, you can use the alphanumeric or the numeric ID.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Required. The resource name of the policy to delete. Format:
     * `policies/{attachment_point}/denypolicies/{policy_id}`
     * Use the URL-encoded full resource name, which means that the forward-slash
     * character, `/`, must be written as `%2F`. For example,
     * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`.
     * For organizations and folders, use the numeric ID in the full resource
     * name. For projects, you can use the alphanumeric or the numeric ID.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * Optional. The expected `etag` of the policy to delete. If the value does not match
     * the value that is stored in IAM, the request fails with a `409` error code
     * and `ABORTED` status.
     * If you omit this field, the policy is deleted regardless of its current
     * `etag`.
     *
     * Generated from protobuf field <code>string etag = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getEtag()
    {
        return $this->etag;
    }

    /**
     * Optional. The expected `etag` of the policy to delete. If the value does not match
     * the value that is stored in IAM, the request fails with a `409` error code
     * and `ABORTED` status.
     * If you omit this field, the policy is deleted regardless of its current
     * `etag`.
     *
     * Generated from protobuf field <code>string etag = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setEtag($var)
    {
        GPBUtil::checkString($var, True);
        $this->etag = $var;

        return $this;
    }

}

