Class Tunnel

java.lang.Object
com.ngrok.definitions.Tunnel

public class Tunnel extends Object
A class encapsulating the Tunnel resource.
  • Constructor Details

    • Tunnel

      public Tunnel(String id, URI publicUrl, OffsetDateTime startedAt, String metadata, String proto, String region, Ref tunnelSession)
      Creates a new instance of Tunnel.
      Parameters:
      id - unique tunnel resource identifier
      publicUrl - URL of the tunnel's public endpoint
      startedAt - timestamp when the tunnel was initiated in RFC 3339 format
      metadata - user-supplied metadata for the tunnel defined in the ngrok configuration file. See the tunnel metadata configuration option In API version 0, this value was instead pulled from the top-level metadata configuration option.
      proto - tunnel protocol. one of http, https, tcp or tls
      region - identifier of tune region where the tunnel is running
      tunnelSession - reference object pointing to the tunnel session on which this tunnel was started
  • Method Details

    • getId

      public String getId()
      unique tunnel resource identifier
      Returns:
      the value of the property as a String
    • getPublicUrl

      public URI getPublicUrl()
      URL of the tunnel's public endpoint
      Returns:
      the value of the property as a URI
    • getStartedAt

      public OffsetDateTime getStartedAt()
      timestamp when the tunnel was initiated in RFC 3339 format
      Returns:
      the value of the property as a OffsetDateTime
    • getMetadata

      public String getMetadata()
      user-supplied metadata for the tunnel defined in the ngrok configuration file. See the tunnel metadata configuration option In API version 0, this value was instead pulled from the top-level metadata configuration option.
      Returns:
      the value of the property as a String
    • getProto

      public String getProto()
      tunnel protocol. one of http, https, tcp or tls
      Returns:
      the value of the property as a String
    • getRegion

      public String getRegion()
      identifier of tune region where the tunnel is running
      Returns:
      the value of the property as a String
    • getTunnelSession

      public Ref getTunnelSession()
      reference object pointing to the tunnel session on which this tunnel was started
      Returns:
      the value of the property as a Ref
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object