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

namespace Google\Cloud\LicenseManager\V1;

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

/**
 * Message for requesting license usage per configuration.
 *
 * Generated from protobuf message <code>google.cloud.licensemanager.v1.QueryConfigurationLicenseUsageRequest</code>
 */
class QueryConfigurationLicenseUsageRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The resource path of the Configuration.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     */
    protected $name = '';
    /**
     * Required. The start time for retrieving the usage. If not specified, we
     * will use the first day of the current billing period.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp start_time = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $start_time = null;
    /**
     * Required. The end time for retrieving the usage. If not specified, we will
     * use the last day of the current billing period.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $end_time = null;

    /**
     * @param string                     $name      Required. The resource path of the Configuration. Please see
     *                                              {@see LicenseManagerClient::configurationName()} for help formatting this field.
     * @param \Google\Protobuf\Timestamp $startTime Required. The start time for retrieving the usage. If not specified, we
     *                                              will use the first day of the current billing period.
     * @param \Google\Protobuf\Timestamp $endTime   Required. The end time for retrieving the usage. If not specified, we will
     *                                              use the last day of the current billing period.
     *
     * @return \Google\Cloud\LicenseManager\V1\QueryConfigurationLicenseUsageRequest
     *
     * @experimental
     */
    public static function build(string $name, \Google\Protobuf\Timestamp $startTime, \Google\Protobuf\Timestamp $endTime): self
    {
        return (new self())
            ->setName($name)
            ->setStartTime($startTime)
            ->setEndTime($endTime);
    }

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           Required. The resource path of the Configuration.
     *     @type \Google\Protobuf\Timestamp $start_time
     *           Required. The start time for retrieving the usage. If not specified, we
     *           will use the first day of the current billing period.
     *     @type \Google\Protobuf\Timestamp $end_time
     *           Required. The end time for retrieving the usage. If not specified, we will
     *           use the last day of the current billing period.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Licensemanager\V1\Licensemanager::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The resource path of the Configuration.
     *
     * 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 resource path of the Configuration.
     *
     * 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;
    }

    /**
     * Required. The start time for retrieving the usage. If not specified, we
     * will use the first day of the current billing period.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp start_time = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getStartTime()
    {
        return $this->start_time;
    }

    public function hasStartTime()
    {
        return isset($this->start_time);
    }

    public function clearStartTime()
    {
        unset($this->start_time);
    }

    /**
     * Required. The start time for retrieving the usage. If not specified, we
     * will use the first day of the current billing period.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp start_time = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setStartTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->start_time = $var;

        return $this;
    }

    /**
     * Required. The end time for retrieving the usage. If not specified, we will
     * use the last day of the current billing period.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getEndTime()
    {
        return $this->end_time;
    }

    public function hasEndTime()
    {
        return isset($this->end_time);
    }

    public function clearEndTime()
    {
        unset($this->end_time);
    }

    /**
     * Required. The end time for retrieving the usage. If not specified, we will
     * use the last day of the current billing period.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setEndTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->end_time = $var;

        return $this;
    }

}

