Class Credentials.CreateCallBuilder

java.lang.Object
com.ngrok.services.Credentials.CreateCallBuilder
Enclosing class:
Credentials

public class Credentials.CreateCallBuilder extends Object
A builder object encapsulating state for an unsent Create API call.
  • Method Details

    • description

      public Credentials.CreateCallBuilder description(String description)
      human-readable description of who or what will use the credential to authenticate. Optional, max 255 bytes.
      Parameters:
      description - the value of the description parameter as a String
      Returns:
      the call builder instance
    • description

      public Credentials.CreateCallBuilder description(Optional<String> description)
      human-readable description of who or what will use the credential to authenticate. Optional, max 255 bytes.
      Parameters:
      description - the value of the description parameter as an Optional of String
      Returns:
      the call builder instance
    • metadata

      public Credentials.CreateCallBuilder metadata(String metadata)
      arbitrary user-defined machine-readable data of this credential. Optional, max 4096 bytes.
      Parameters:
      metadata - the value of the metadata parameter as a String
      Returns:
      the call builder instance
    • metadata

      public Credentials.CreateCallBuilder metadata(Optional<String> metadata)
      arbitrary user-defined machine-readable data of this credential. Optional, max 4096 bytes.
      Parameters:
      metadata - the value of the metadata parameter as an Optional of String
      Returns:
      the call builder instance
    • acl

      optional list of ACL rules. If unspecified, the credential will have no restrictions. The only allowed ACL rule at this time is the bind rule. The bind rule allows the caller to restrict what domains and addresses the token is allowed to bind. For example, to allow the token to open a tunnel on example.ngrok.io your ACL would include the rule bind:example.ngrok.io. Bind rules may specify a leading wildcard to match multiple domains with a common suffix. For example, you may specify a rule of bind:*.example.com which will allow x.example.com, y.example.com, *.example.com, etc. A rule of '*' is equivalent to no acl at all and will explicitly permit all actions.
      Parameters:
      acl - the value of the acl parameter as a List of String
      Returns:
      the call builder instance
    • acl

      optional list of ACL rules. If unspecified, the credential will have no restrictions. The only allowed ACL rule at this time is the bind rule. The bind rule allows the caller to restrict what domains and addresses the token is allowed to bind. For example, to allow the token to open a tunnel on example.ngrok.io your ACL would include the rule bind:example.ngrok.io. Bind rules may specify a leading wildcard to match multiple domains with a common suffix. For example, you may specify a rule of bind:*.example.com which will allow x.example.com, y.example.com, *.example.com, etc. A rule of '*' is equivalent to no acl at all and will explicitly permit all actions.
      Parameters:
      acl - the value of the acl parameter as an Optional of List of String
      Returns:
      the call builder instance
    • call

      public CompletionStage<Credential> call()
      Initiates the API call asynchronously.
      Returns:
      a CompletionStage of Credential
    • blockingCall

      public Credential blockingCall() throws InterruptedException
      Initiates the API call and blocks until it returns.
      Returns:
      Credential
      Throws:
      InterruptedException - if the thread was interrupted during the call