ResourceCounter.java

  1. // Copyright (c) Microsoft Corporation. All rights reserved.
  2. // Licensed under the MIT License.
  3. //
  4. // Code generated by Microsoft (R) AutoRest Code Generator.
  5. // Changes may cause incorrect behavior and will be lost if the code is
  6. // regenerated.

  7. package com.azure.search.documents.indexes.models;

  8. import com.azure.core.annotation.Fluent;
  9. import com.fasterxml.jackson.annotation.JsonCreator;
  10. import com.fasterxml.jackson.annotation.JsonProperty;

  11. /** Represents a resource's usage and quota. */
  12. @Fluent
  13. public final class ResourceCounter {
  14.     /*
  15.      * The resource usage amount.
  16.      */
  17.     @JsonProperty(value = "usage", required = true)
  18.     private long usage;

  19.     /*
  20.      * The resource amount quota.
  21.      */
  22.     @JsonProperty(value = "quota")
  23.     private Long quota;

  24.     /**
  25.      * Creates an instance of ResourceCounter class.
  26.      *
  27.      * @param usage the usage value to set.
  28.      */
  29.     @JsonCreator
  30.     public ResourceCounter(@JsonProperty(value = "usage", required = true) long usage) {
  31.         this.usage = usage;
  32.     }

  33.     /**
  34.      * Get the usage property: The resource usage amount.
  35.      *
  36.      * @return the usage value.
  37.      */
  38.     public long getUsage() {
  39.         return this.usage;
  40.     }

  41.     /**
  42.      * Get the quota property: The resource amount quota.
  43.      *
  44.      * @return the quota value.
  45.      */
  46.     public Long getQuota() {
  47.         return this.quota;
  48.     }

  49.     /**
  50.      * Set the quota property: The resource amount quota.
  51.      *
  52.      * @param quota the quota value to set.
  53.      * @return the ResourceCounter object itself.
  54.      */
  55.     public ResourceCounter setQuota(Long quota) {
  56.         this.quota = quota;
  57.         return this;
  58.     }
  59. }