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

namespace Google\Cloud\Iot\V1;

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

/**
 * A container for a group of devices.
 *
 * Generated from protobuf message <code>google.cloud.iot.v1.DeviceRegistry</code>
 */
class DeviceRegistry extends \Google\Protobuf\Internal\Message
{
    /**
     * The identifier of this device registry. For example, `myRegistry`.
     *
     * Generated from protobuf field <code>string id = 1;</code>
     */
    private $id = '';
    /**
     * The resource path name. For example,
     * `projects/example-project/locations/us-central1/registries/my-registry`.
     *
     * Generated from protobuf field <code>string name = 2;</code>
     */
    private $name = '';
    /**
     * The configuration for notification of telemetry events received from the
     * device. All telemetry events that were successfully published by the
     * device and acknowledged by Cloud IoT Core are guaranteed to be
     * delivered to Cloud Pub/Sub. If multiple configurations match a message,
     * only the first matching configuration is used. If you try to publish a
     * device telemetry event using MQTT without specifying a Cloud Pub/Sub topic
     * for the device's registry, the connection closes automatically. If you try
     * to do so using an HTTP connection, an error is returned. Up to 10
     * configurations may be provided.
     *
     * Generated from protobuf field <code>repeated .google.cloud.iot.v1.EventNotificationConfig event_notification_configs = 10;</code>
     */
    private $event_notification_configs;
    /**
     * The configuration for notification of new states received from the device.
     * State updates are guaranteed to be stored in the state history, but
     * notifications to Cloud Pub/Sub are not guaranteed. For example, if
     * permissions are misconfigured or the specified topic doesn't exist, no
     * notification will be published but the state will still be stored in Cloud
     * IoT Core.
     *
     * Generated from protobuf field <code>.google.cloud.iot.v1.StateNotificationConfig state_notification_config = 7;</code>
     */
    private $state_notification_config = null;
    /**
     * The MQTT configuration for this device registry.
     *
     * Generated from protobuf field <code>.google.cloud.iot.v1.MqttConfig mqtt_config = 4;</code>
     */
    private $mqtt_config = null;
    /**
     * The DeviceService (HTTP) configuration for this device registry.
     *
     * Generated from protobuf field <code>.google.cloud.iot.v1.HttpConfig http_config = 9;</code>
     */
    private $http_config = null;
    /**
     * **Beta Feature**
     * The default logging verbosity for activity from devices in this registry.
     * The verbosity level can be overridden by Device.log_level.
     *
     * Generated from protobuf field <code>.google.cloud.iot.v1.LogLevel log_level = 11;</code>
     */
    private $log_level = 0;
    /**
     * The credentials used to verify the device credentials. No more than 10
     * credentials can be bound to a single registry at a time. The verification
     * process occurs at the time of device creation or update. If this field is
     * empty, no verification is performed. Otherwise, the credentials of a newly
     * created device or added credentials of an updated device should be signed
     * with one of these registry credentials.
     * Note, however, that existing devices will never be affected by
     * modifications to this list of credentials: after a device has been
     * successfully created in a registry, it should be able to connect even if
     * its registry credentials are revoked, deleted, or modified.
     *
     * Generated from protobuf field <code>repeated .google.cloud.iot.v1.RegistryCredential credentials = 8;</code>
     */
    private $credentials;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $id
     *           The identifier of this device registry. For example, `myRegistry`.
     *     @type string $name
     *           The resource path name. For example,
     *           `projects/example-project/locations/us-central1/registries/my-registry`.
     *     @type array<\Google\Cloud\Iot\V1\EventNotificationConfig>|\Google\Protobuf\Internal\RepeatedField $event_notification_configs
     *           The configuration for notification of telemetry events received from the
     *           device. All telemetry events that were successfully published by the
     *           device and acknowledged by Cloud IoT Core are guaranteed to be
     *           delivered to Cloud Pub/Sub. If multiple configurations match a message,
     *           only the first matching configuration is used. If you try to publish a
     *           device telemetry event using MQTT without specifying a Cloud Pub/Sub topic
     *           for the device's registry, the connection closes automatically. If you try
     *           to do so using an HTTP connection, an error is returned. Up to 10
     *           configurations may be provided.
     *     @type \Google\Cloud\Iot\V1\StateNotificationConfig $state_notification_config
     *           The configuration for notification of new states received from the device.
     *           State updates are guaranteed to be stored in the state history, but
     *           notifications to Cloud Pub/Sub are not guaranteed. For example, if
     *           permissions are misconfigured or the specified topic doesn't exist, no
     *           notification will be published but the state will still be stored in Cloud
     *           IoT Core.
     *     @type \Google\Cloud\Iot\V1\MqttConfig $mqtt_config
     *           The MQTT configuration for this device registry.
     *     @type \Google\Cloud\Iot\V1\HttpConfig $http_config
     *           The DeviceService (HTTP) configuration for this device registry.
     *     @type int $log_level
     *           **Beta Feature**
     *           The default logging verbosity for activity from devices in this registry.
     *           The verbosity level can be overridden by Device.log_level.
     *     @type array<\Google\Cloud\Iot\V1\RegistryCredential>|\Google\Protobuf\Internal\RepeatedField $credentials
     *           The credentials used to verify the device credentials. No more than 10
     *           credentials can be bound to a single registry at a time. The verification
     *           process occurs at the time of device creation or update. If this field is
     *           empty, no verification is performed. Otherwise, the credentials of a newly
     *           created device or added credentials of an updated device should be signed
     *           with one of these registry credentials.
     *           Note, however, that existing devices will never be affected by
     *           modifications to this list of credentials: after a device has been
     *           successfully created in a registry, it should be able to connect even if
     *           its registry credentials are revoked, deleted, or modified.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Iot\V1\Resources::initOnce();
        parent::__construct($data);
    }

    /**
     * The identifier of this device registry. For example, `myRegistry`.
     *
     * Generated from protobuf field <code>string id = 1;</code>
     * @return string
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * The identifier of this device registry. For example, `myRegistry`.
     *
     * Generated from protobuf field <code>string id = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setId($var)
    {
        GPBUtil::checkString($var, True);
        $this->id = $var;

        return $this;
    }

    /**
     * The resource path name. For example,
     * `projects/example-project/locations/us-central1/registries/my-registry`.
     *
     * Generated from protobuf field <code>string name = 2;</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * The resource path name. For example,
     * `projects/example-project/locations/us-central1/registries/my-registry`.
     *
     * Generated from protobuf field <code>string name = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * The configuration for notification of telemetry events received from the
     * device. All telemetry events that were successfully published by the
     * device and acknowledged by Cloud IoT Core are guaranteed to be
     * delivered to Cloud Pub/Sub. If multiple configurations match a message,
     * only the first matching configuration is used. If you try to publish a
     * device telemetry event using MQTT without specifying a Cloud Pub/Sub topic
     * for the device's registry, the connection closes automatically. If you try
     * to do so using an HTTP connection, an error is returned. Up to 10
     * configurations may be provided.
     *
     * Generated from protobuf field <code>repeated .google.cloud.iot.v1.EventNotificationConfig event_notification_configs = 10;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getEventNotificationConfigs()
    {
        return $this->event_notification_configs;
    }

    /**
     * The configuration for notification of telemetry events received from the
     * device. All telemetry events that were successfully published by the
     * device and acknowledged by Cloud IoT Core are guaranteed to be
     * delivered to Cloud Pub/Sub. If multiple configurations match a message,
     * only the first matching configuration is used. If you try to publish a
     * device telemetry event using MQTT without specifying a Cloud Pub/Sub topic
     * for the device's registry, the connection closes automatically. If you try
     * to do so using an HTTP connection, an error is returned. Up to 10
     * configurations may be provided.
     *
     * Generated from protobuf field <code>repeated .google.cloud.iot.v1.EventNotificationConfig event_notification_configs = 10;</code>
     * @param array<\Google\Cloud\Iot\V1\EventNotificationConfig>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setEventNotificationConfigs($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Iot\V1\EventNotificationConfig::class);
        $this->event_notification_configs = $arr;

        return $this;
    }

    /**
     * The configuration for notification of new states received from the device.
     * State updates are guaranteed to be stored in the state history, but
     * notifications to Cloud Pub/Sub are not guaranteed. For example, if
     * permissions are misconfigured or the specified topic doesn't exist, no
     * notification will be published but the state will still be stored in Cloud
     * IoT Core.
     *
     * Generated from protobuf field <code>.google.cloud.iot.v1.StateNotificationConfig state_notification_config = 7;</code>
     * @return \Google\Cloud\Iot\V1\StateNotificationConfig|null
     */
    public function getStateNotificationConfig()
    {
        return $this->state_notification_config;
    }

    public function hasStateNotificationConfig()
    {
        return isset($this->state_notification_config);
    }

    public function clearStateNotificationConfig()
    {
        unset($this->state_notification_config);
    }

    /**
     * The configuration for notification of new states received from the device.
     * State updates are guaranteed to be stored in the state history, but
     * notifications to Cloud Pub/Sub are not guaranteed. For example, if
     * permissions are misconfigured or the specified topic doesn't exist, no
     * notification will be published but the state will still be stored in Cloud
     * IoT Core.
     *
     * Generated from protobuf field <code>.google.cloud.iot.v1.StateNotificationConfig state_notification_config = 7;</code>
     * @param \Google\Cloud\Iot\V1\StateNotificationConfig $var
     * @return $this
     */
    public function setStateNotificationConfig($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Iot\V1\StateNotificationConfig::class);
        $this->state_notification_config = $var;

        return $this;
    }

    /**
     * The MQTT configuration for this device registry.
     *
     * Generated from protobuf field <code>.google.cloud.iot.v1.MqttConfig mqtt_config = 4;</code>
     * @return \Google\Cloud\Iot\V1\MqttConfig|null
     */
    public function getMqttConfig()
    {
        return $this->mqtt_config;
    }

    public function hasMqttConfig()
    {
        return isset($this->mqtt_config);
    }

    public function clearMqttConfig()
    {
        unset($this->mqtt_config);
    }

    /**
     * The MQTT configuration for this device registry.
     *
     * Generated from protobuf field <code>.google.cloud.iot.v1.MqttConfig mqtt_config = 4;</code>
     * @param \Google\Cloud\Iot\V1\MqttConfig $var
     * @return $this
     */
    public function setMqttConfig($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Iot\V1\MqttConfig::class);
        $this->mqtt_config = $var;

        return $this;
    }

    /**
     * The DeviceService (HTTP) configuration for this device registry.
     *
     * Generated from protobuf field <code>.google.cloud.iot.v1.HttpConfig http_config = 9;</code>
     * @return \Google\Cloud\Iot\V1\HttpConfig|null
     */
    public function getHttpConfig()
    {
        return $this->http_config;
    }

    public function hasHttpConfig()
    {
        return isset($this->http_config);
    }

    public function clearHttpConfig()
    {
        unset($this->http_config);
    }

    /**
     * The DeviceService (HTTP) configuration for this device registry.
     *
     * Generated from protobuf field <code>.google.cloud.iot.v1.HttpConfig http_config = 9;</code>
     * @param \Google\Cloud\Iot\V1\HttpConfig $var
     * @return $this
     */
    public function setHttpConfig($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Iot\V1\HttpConfig::class);
        $this->http_config = $var;

        return $this;
    }

    /**
     * **Beta Feature**
     * The default logging verbosity for activity from devices in this registry.
     * The verbosity level can be overridden by Device.log_level.
     *
     * Generated from protobuf field <code>.google.cloud.iot.v1.LogLevel log_level = 11;</code>
     * @return int
     */
    public function getLogLevel()
    {
        return $this->log_level;
    }

    /**
     * **Beta Feature**
     * The default logging verbosity for activity from devices in this registry.
     * The verbosity level can be overridden by Device.log_level.
     *
     * Generated from protobuf field <code>.google.cloud.iot.v1.LogLevel log_level = 11;</code>
     * @param int $var
     * @return $this
     */
    public function setLogLevel($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Iot\V1\LogLevel::class);
        $this->log_level = $var;

        return $this;
    }

    /**
     * The credentials used to verify the device credentials. No more than 10
     * credentials can be bound to a single registry at a time. The verification
     * process occurs at the time of device creation or update. If this field is
     * empty, no verification is performed. Otherwise, the credentials of a newly
     * created device or added credentials of an updated device should be signed
     * with one of these registry credentials.
     * Note, however, that existing devices will never be affected by
     * modifications to this list of credentials: after a device has been
     * successfully created in a registry, it should be able to connect even if
     * its registry credentials are revoked, deleted, or modified.
     *
     * Generated from protobuf field <code>repeated .google.cloud.iot.v1.RegistryCredential credentials = 8;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getCredentials()
    {
        return $this->credentials;
    }

    /**
     * The credentials used to verify the device credentials. No more than 10
     * credentials can be bound to a single registry at a time. The verification
     * process occurs at the time of device creation or update. If this field is
     * empty, no verification is performed. Otherwise, the credentials of a newly
     * created device or added credentials of an updated device should be signed
     * with one of these registry credentials.
     * Note, however, that existing devices will never be affected by
     * modifications to this list of credentials: after a device has been
     * successfully created in a registry, it should be able to connect even if
     * its registry credentials are revoked, deleted, or modified.
     *
     * Generated from protobuf field <code>repeated .google.cloud.iot.v1.RegistryCredential credentials = 8;</code>
     * @param array<\Google\Cloud\Iot\V1\RegistryCredential>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setCredentials($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Iot\V1\RegistryCredential::class);
        $this->credentials = $arr;

        return $this;
    }

}

