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

namespace Google\Cloud\Iot\V1;

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

/**
 * Options for limiting the list based on gateway type and associations.
 *
 * Generated from protobuf message <code>google.cloud.iot.v1.GatewayListOptions</code>
 */
class GatewayListOptions extends \Google\Protobuf\Internal\Message
{
    protected $filter;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $gateway_type
     *           If `GATEWAY` is specified, only gateways are returned. If `NON_GATEWAY`
     *           is specified, only non-gateway devices are returned. If
     *           `GATEWAY_TYPE_UNSPECIFIED` is specified, all devices are returned.
     *     @type string $associations_gateway_id
     *           If set, only devices associated with the specified gateway are returned.
     *           The gateway ID can be numeric (`num_id`) or the user-defined string
     *           (`id`). For example, if `123` is specified, only devices bound to the
     *           gateway with `num_id` 123 are returned.
     *     @type string $associations_device_id
     *           If set, returns only the gateways with which the specified device is
     *           associated. The device ID can be numeric (`num_id`) or the user-defined
     *           string (`id`). For example, if `456` is specified, returns only the
     *           gateways to which the device with `num_id` 456 is bound.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Iot\V1\DeviceManager::initOnce();
        parent::__construct($data);
    }

    /**
     * If `GATEWAY` is specified, only gateways are returned. If `NON_GATEWAY`
     * is specified, only non-gateway devices are returned. If
     * `GATEWAY_TYPE_UNSPECIFIED` is specified, all devices are returned.
     *
     * Generated from protobuf field <code>.google.cloud.iot.v1.GatewayType gateway_type = 1;</code>
     * @return int
     */
    public function getGatewayType()
    {
        return $this->readOneof(1);
    }

    /**
     * If `GATEWAY` is specified, only gateways are returned. If `NON_GATEWAY`
     * is specified, only non-gateway devices are returned. If
     * `GATEWAY_TYPE_UNSPECIFIED` is specified, all devices are returned.
     *
     * Generated from protobuf field <code>.google.cloud.iot.v1.GatewayType gateway_type = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setGatewayType($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Iot\V1\GatewayType::class);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * If set, only devices associated with the specified gateway are returned.
     * The gateway ID can be numeric (`num_id`) or the user-defined string
     * (`id`). For example, if `123` is specified, only devices bound to the
     * gateway with `num_id` 123 are returned.
     *
     * Generated from protobuf field <code>string associations_gateway_id = 2;</code>
     * @return string
     */
    public function getAssociationsGatewayId()
    {
        return $this->readOneof(2);
    }

    /**
     * If set, only devices associated with the specified gateway are returned.
     * The gateway ID can be numeric (`num_id`) or the user-defined string
     * (`id`). For example, if `123` is specified, only devices bound to the
     * gateway with `num_id` 123 are returned.
     *
     * Generated from protobuf field <code>string associations_gateway_id = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setAssociationsGatewayId($var)
    {
        GPBUtil::checkString($var, True);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * If set, returns only the gateways with which the specified device is
     * associated. The device ID can be numeric (`num_id`) or the user-defined
     * string (`id`). For example, if `456` is specified, returns only the
     * gateways to which the device with `num_id` 456 is bound.
     *
     * Generated from protobuf field <code>string associations_device_id = 3;</code>
     * @return string
     */
    public function getAssociationsDeviceId()
    {
        return $this->readOneof(3);
    }

    /**
     * If set, returns only the gateways with which the specified device is
     * associated. The device ID can be numeric (`num_id`) or the user-defined
     * string (`id`). For example, if `456` is specified, returns only the
     * gateways to which the device with `num_id` 456 is bound.
     *
     * Generated from protobuf field <code>string associations_device_id = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setAssociationsDeviceId($var)
    {
        GPBUtil::checkString($var, True);
        $this->writeOneof(3, $var);

        return $this;
    }

    /**
     * @return string
     */
    public function getFilter()
    {
        return $this->whichOneof("filter");
    }

}

