Class Usage


  • public final class Usage
    extends Object
    The usage data for a usage request.
    • Constructor Detail

      • Usage

        public Usage()
    • Method Detail

      • unit

        public UnitType unit()
        Get the unit property: The unit of the metric.
        Returns:
        the unit value.
      • withUnit

        public Usage withUnit​(UnitType unit)
        Set the unit property: The unit of the metric.
        Parameters:
        unit - the unit value to set.
        Returns:
        the Usage object itself.
      • name

        public MetricName name()
        Get the name property: The name information for the metric.
        Returns:
        the name value.
      • withName

        public Usage withName​(MetricName name)
        Set the name property: The name information for the metric.
        Parameters:
        name - the name value to set.
        Returns:
        the Usage object itself.
      • quotaPeriod

        public String quotaPeriod()
        Get the quotaPeriod property: The quota period used to summarize the usage values.
        Returns:
        the quotaPeriod value.
      • withQuotaPeriod

        public Usage withQuotaPeriod​(String quotaPeriod)
        Set the quotaPeriod property: The quota period used to summarize the usage values.
        Parameters:
        quotaPeriod - the quotaPeriod value to set.
        Returns:
        the Usage object itself.
      • limit

        public Double limit()
        Get the limit property: Maximum value for this metric.
        Returns:
        the limit value.
      • withLimit

        public Usage withLimit​(Double limit)
        Set the limit property: Maximum value for this metric.
        Parameters:
        limit - the limit value to set.
        Returns:
        the Usage object itself.
      • currentValue

        public Double currentValue()
        Get the currentValue property: Current value for this metric.
        Returns:
        the currentValue value.
      • withCurrentValue

        public Usage withCurrentValue​(Double currentValue)
        Set the currentValue property: Current value for this metric.
        Parameters:
        currentValue - the currentValue value to set.
        Returns:
        the Usage object itself.
      • nextResetTime

        public String nextResetTime()
        Get the nextResetTime property: Next reset time for current quota.
        Returns:
        the nextResetTime value.
      • withNextResetTime

        public Usage withNextResetTime​(String nextResetTime)
        Set the nextResetTime property: Next reset time for current quota.
        Parameters:
        nextResetTime - the nextResetTime value to set.
        Returns:
        the Usage object itself.
      • status

        public QuotaUsageStatus status()
        Get the status property: Cognitive Services account quota usage status.
        Returns:
        the status value.
      • withStatus

        public Usage withStatus​(QuotaUsageStatus status)
        Set the status property: Cognitive Services account quota usage status.
        Parameters:
        status - the status value to set.
        Returns:
        the Usage object itself.
      • validate

        public void validate()
        Validates the instance.
        Throws:
        IllegalArgumentException - thrown if the instance is not valid.