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

namespace Google\Cloud\ManagedKafka\SchemaRegistry\V1;

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

/**
 * SchemaConfig represents configuration for a schema registry or a specific
 * subject.
 *
 * Generated from protobuf message <code>google.cloud.managedkafka.schemaregistry.v1.SchemaConfig</code>
 */
class SchemaConfig extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The compatibility type of the schema.
     * The default value is BACKWARD.
     * If unset in a SchemaSubject-level SchemaConfig, defaults to the global
     * value. If unset in a SchemaRegistry-level SchemaConfig, reverts to the
     * default value.
     *
     * Generated from protobuf field <code>optional .google.cloud.managedkafka.schemaregistry.v1.SchemaConfig.CompatibilityType compatibility = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $compatibility = null;
    /**
     * Optional. If true, the schema will be normalized before being stored or
     * looked up. The default is false. If unset in a SchemaSubject-level
     * SchemaConfig, the global value will be used. If unset in a
     * SchemaRegistry-level SchemaConfig, reverts to the default value.
     *
     * Generated from protobuf field <code>optional bool normalize = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $normalize = null;
    /**
     * Optional. The subject to which this subject is an alias of. Only applicable
     * for subject config.
     *
     * Generated from protobuf field <code>string alias = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $alias = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $compatibility
     *           Required. The compatibility type of the schema.
     *           The default value is BACKWARD.
     *           If unset in a SchemaSubject-level SchemaConfig, defaults to the global
     *           value. If unset in a SchemaRegistry-level SchemaConfig, reverts to the
     *           default value.
     *     @type bool $normalize
     *           Optional. If true, the schema will be normalized before being stored or
     *           looked up. The default is false. If unset in a SchemaSubject-level
     *           SchemaConfig, the global value will be used. If unset in a
     *           SchemaRegistry-level SchemaConfig, reverts to the default value.
     *     @type string $alias
     *           Optional. The subject to which this subject is an alias of. Only applicable
     *           for subject config.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Managedkafka\Schemaregistry\V1\SchemaRegistryResources::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The compatibility type of the schema.
     * The default value is BACKWARD.
     * If unset in a SchemaSubject-level SchemaConfig, defaults to the global
     * value. If unset in a SchemaRegistry-level SchemaConfig, reverts to the
     * default value.
     *
     * Generated from protobuf field <code>optional .google.cloud.managedkafka.schemaregistry.v1.SchemaConfig.CompatibilityType compatibility = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return int
     */
    public function getCompatibility()
    {
        return isset($this->compatibility) ? $this->compatibility : 0;
    }

    public function hasCompatibility()
    {
        return isset($this->compatibility);
    }

    public function clearCompatibility()
    {
        unset($this->compatibility);
    }

    /**
     * Required. The compatibility type of the schema.
     * The default value is BACKWARD.
     * If unset in a SchemaSubject-level SchemaConfig, defaults to the global
     * value. If unset in a SchemaRegistry-level SchemaConfig, reverts to the
     * default value.
     *
     * Generated from protobuf field <code>optional .google.cloud.managedkafka.schemaregistry.v1.SchemaConfig.CompatibilityType compatibility = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param int $var
     * @return $this
     */
    public function setCompatibility($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\ManagedKafka\SchemaRegistry\V1\SchemaConfig\CompatibilityType::class);
        $this->compatibility = $var;

        return $this;
    }

    /**
     * Optional. If true, the schema will be normalized before being stored or
     * looked up. The default is false. If unset in a SchemaSubject-level
     * SchemaConfig, the global value will be used. If unset in a
     * SchemaRegistry-level SchemaConfig, reverts to the default value.
     *
     * Generated from protobuf field <code>optional bool normalize = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return bool
     */
    public function getNormalize()
    {
        return isset($this->normalize) ? $this->normalize : false;
    }

    public function hasNormalize()
    {
        return isset($this->normalize);
    }

    public function clearNormalize()
    {
        unset($this->normalize);
    }

    /**
     * Optional. If true, the schema will be normalized before being stored or
     * looked up. The default is false. If unset in a SchemaSubject-level
     * SchemaConfig, the global value will be used. If unset in a
     * SchemaRegistry-level SchemaConfig, reverts to the default value.
     *
     * Generated from protobuf field <code>optional bool normalize = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param bool $var
     * @return $this
     */
    public function setNormalize($var)
    {
        GPBUtil::checkBool($var);
        $this->normalize = $var;

        return $this;
    }

    /**
     * Optional. The subject to which this subject is an alias of. Only applicable
     * for subject config.
     *
     * Generated from protobuf field <code>string alias = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getAlias()
    {
        return $this->alias;
    }

    /**
     * Optional. The subject to which this subject is an alias of. Only applicable
     * for subject config.
     *
     * Generated from protobuf field <code>string alias = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setAlias($var)
    {
        GPBUtil::checkString($var, True);
        $this->alias = $var;

        return $this;
    }

}

