<?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. Only the first 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.
     *
     * 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;
    /**
     * 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;

    public function __construct() {
        \GPBMetadata\Google\Cloud\Iot\V1\Resources::initOnce();
        parent::__construct();
    }

    /**
     * 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. Only the first 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.
     *
     * 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. Only the first 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.
     *
     * Generated from protobuf field <code>repeated .google.cloud.iot.v1.EventNotificationConfig event_notification_configs = 10;</code>
     * @param \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
     */
    public function getStateNotificationConfig()
    {
        return $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
     */
    public function getMqttConfig()
    {
        return $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
     */
    public function getHttpConfig()
    {
        return $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;
    }

    /**
     * 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 \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;
    }

}

