Class EventStreams.CreateCallBuilder

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

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

    • metadata

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

      public EventStreams.CreateCallBuilder metadata(Optional<String> metadata)
      Arbitrary user-defined machine-readable data of this Event Stream. Optional, max 4096 bytes.
      Parameters:
      metadata - the value of the metadata parameter as an Optional of String
      Returns:
      the call builder instance
    • description

      public EventStreams.CreateCallBuilder description(String description)
      Human-readable description of the Event Stream. Optional, max 255 bytes.
      Parameters:
      description - the value of the description parameter as a String
      Returns:
      the call builder instance
    • description

      public EventStreams.CreateCallBuilder description(Optional<String> description)
      Human-readable description of the Event Stream. Optional, max 255 bytes.
      Parameters:
      description - the value of the description parameter as an Optional of String
      Returns:
      the call builder instance
    • fields

      public EventStreams.CreateCallBuilder fields(List<String> fields)
      A list of protocol-specific fields you want to collect on each event.
      Parameters:
      fields - the value of the fields parameter as a List<String>
      Returns:
      the call builder instance
    • fields

      public EventStreams.CreateCallBuilder fields(Optional<List<String>> fields)
      A list of protocol-specific fields you want to collect on each event.
      Parameters:
      fields - the value of the fields parameter as an Optional of List<String>
      Returns:
      the call builder instance
    • eventType

      public EventStreams.CreateCallBuilder eventType(String eventType)
      The protocol that determines which events will be collected. Supported values are tcp_connection_closed and http_request_complete.
      Parameters:
      eventType - the value of the event_type parameter as a String
      Returns:
      the call builder instance
    • eventType

      public EventStreams.CreateCallBuilder eventType(Optional<String> eventType)
      The protocol that determines which events will be collected. Supported values are tcp_connection_closed and http_request_complete.
      Parameters:
      eventType - the value of the event_type parameter as an Optional of String
      Returns:
      the call builder instance
    • destinationIds

      public EventStreams.CreateCallBuilder destinationIds(List<String> destinationIds)
      A list of Event Destination IDs which should be used for this Event Stream. Event Streams are required to have at least one Event Destination.
      Parameters:
      destinationIds - the value of the destination_ids parameter as a List<String>
      Returns:
      the call builder instance
    • destinationIds

      public EventStreams.CreateCallBuilder destinationIds(Optional<List<String>> destinationIds)
      A list of Event Destination IDs which should be used for this Event Stream. Event Streams are required to have at least one Event Destination.
      Parameters:
      destinationIds - the value of the destination_ids parameter as an Optional of List<String>
      Returns:
      the call builder instance
    • samplingRate

      public EventStreams.CreateCallBuilder samplingRate(double samplingRate)
      The percentage of all events you would like to capture. Valid values range from 0.01, representing 1% of all events to 1.00, representing 100% of all events.
      Parameters:
      samplingRate - the value of the sampling_rate parameter as a double
      Returns:
      the call builder instance
    • samplingRate

      public EventStreams.CreateCallBuilder samplingRate(Optional<Double> samplingRate)
      The percentage of all events you would like to capture. Valid values range from 0.01, representing 1% of all events to 1.00, representing 100% of all events.
      Parameters:
      samplingRate - the value of the sampling_rate parameter as an Optional of double
      Returns:
      the call builder instance
    • call

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

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