Class QuotaEvent.Builder

  • Enclosing class:
    QuotaEvent

    public static class QuotaEvent.Builder
    extends java.lang.Object
    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • withMessageText

        public QuotaEvent.Builder withMessageText​(java.lang.String messageText)
        Parameters:
        messageText - Any additional description for the event.
      • withFullResourceName

        public QuotaEvent.Builder withFullResourceName​(java.lang.String fullResourceName)
        Parameters:
        fullResourceName - The full path for the resource involved. For GCP, this would follow https://google.aip.dev/122#full-resource-names.
      • withQuotaName

        public QuotaEvent.Builder withQuotaName​(java.lang.String quotaName)
        Parameters:
        quotaName - The full quota name. For GCP, this would look like: example.googleapis.com/quota/name
      • withOperation

        public QuotaEvent.Builder withOperation​(java.lang.String operation)
        Parameters:
        operation - Name of the operation that generated this quota event, in snake-case.
      • create

        @Nullable
        public QuotaEvent.QuotaEventCloseable create()
        Puts the given values in the MDC as a quota event.
        Returns:
        An AutoCloseable that removes the added values from the MDC, or null if the feature is disabled.