<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/managedkafka/schemaregistry/v1/schema_registry.proto

namespace Google\Cloud\ManagedKafka\SchemaRegistry\V1;

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

/**
 * Request for DeleteVersion.
 *
 * Generated from protobuf message <code>google.cloud.managedkafka.schemaregistry.v1.DeleteVersionRequest</code>
 */
class DeleteVersionRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The name of the subject version to delete. Structured like:
     * `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/subjects/{subject}/versions/{version}`
     * or
     * `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context}/subjects/{subject}/versions/{version}`
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     */
    protected $name = '';
    /**
     * Optional. If true, both the version and the referenced schema ID will be
     * permanently deleted. The default is false. If false, the version will be
     * deleted but the schema ID will be retained. Soft-deleted versions can still
     * be searched in ListVersions API call with deleted=true query parameter. A
     * soft-delete of a version must be performed before a hard-delete.
     *
     * Generated from protobuf field <code>optional bool permanent = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $permanent = null;

    /**
     * @param string $name Required. The name of the subject version to delete. Structured like:
     *                     `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/subjects/{subject}/versions/{version}`
     *                     or
     *                     `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context}/subjects/{subject}/versions/{version}`
     *                     Please see {@see ManagedSchemaRegistryClient::schemaVersionName()} for help formatting this field.
     *
     * @return \Google\Cloud\ManagedKafka\SchemaRegistry\V1\DeleteVersionRequest
     *
     * @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 name of the subject version to delete. Structured like:
     *           `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/subjects/{subject}/versions/{version}`
     *           or
     *           `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context}/subjects/{subject}/versions/{version}`
     *     @type bool $permanent
     *           Optional. If true, both the version and the referenced schema ID will be
     *           permanently deleted. The default is false. If false, the version will be
     *           deleted but the schema ID will be retained. Soft-deleted versions can still
     *           be searched in ListVersions API call with deleted=true query parameter. A
     *           soft-delete of a version must be performed before a hard-delete.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Managedkafka\Schemaregistry\V1\SchemaRegistry::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The name of the subject version to delete. Structured like:
     * `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/subjects/{subject}/versions/{version}`
     * or
     * `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context}/subjects/{subject}/versions/{version}`
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Required. The name of the subject version to delete. Structured like:
     * `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/subjects/{subject}/versions/{version}`
     * or
     * `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context}/subjects/{subject}/versions/{version}`
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * Optional. If true, both the version and the referenced schema ID will be
     * permanently deleted. The default is false. If false, the version will be
     * deleted but the schema ID will be retained. Soft-deleted versions can still
     * be searched in ListVersions API call with deleted=true query parameter. A
     * soft-delete of a version must be performed before a hard-delete.
     *
     * Generated from protobuf field <code>optional bool permanent = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return bool
     */
    public function getPermanent()
    {
        return isset($this->permanent) ? $this->permanent : false;
    }

    public function hasPermanent()
    {
        return isset($this->permanent);
    }

    public function clearPermanent()
    {
        unset($this->permanent);
    }

    /**
     * Optional. If true, both the version and the referenced schema ID will be
     * permanently deleted. The default is false. If false, the version will be
     * deleted but the schema ID will be retained. Soft-deleted versions can still
     * be searched in ListVersions API call with deleted=true query parameter. A
     * soft-delete of a version must be performed before a hard-delete.
     *
     * Generated from protobuf field <code>optional bool permanent = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param bool $var
     * @return $this
     */
    public function setPermanent($var)
    {
        GPBUtil::checkBool($var);
        $this->permanent = $var;

        return $this;
    }

}

