class NgrokAPI::Models::TCPEdge

Attributes

attrs[R]
backend[R]
client[R]
created_at[R]
description[R]
hostports[R]
id[R]
ip_restriction[R]
metadata[R]
uri[R]

Public Class Methods

new(client: nil, attrs: {}) click to toggle source
# File lib/ngrokapi/models/tcp_edge.rb, line 17
def initialize(client: nil, attrs: {})
  @client = client
  @attrs = attrs
  @id = @attrs['id']
  @description = @attrs['description']
  @metadata = @attrs['metadata']
  @created_at = @attrs['created_at']
  @uri = @attrs['uri']
  @hostports = @attrs['hostports']
  @backend = @attrs['backend']
  @ip_restriction = @attrs['ip_restriction']
end

Public Instance Methods

==(other) click to toggle source
# File lib/ngrokapi/models/tcp_edge.rb, line 30
def ==(other)
  @attrs == other.attrs
end
delete() click to toggle source

Delete a TCP Edge by ID

ngrok.com/docs/api#api-edges-tcp-delete

# File lib/ngrokapi/models/tcp_edge.rb, line 75
def delete
  @client.delete(
    id: @id
  )
end
to_h() click to toggle source
# File lib/ngrokapi/models/tcp_edge.rb, line 38
def to_h
  @attrs.to_h
end
to_s() click to toggle source
# File lib/ngrokapi/models/tcp_edge.rb, line 34
def to_s
  @attrs.to_s
end
update( description: nil, metadata: nil, hostports: nil, backend: nil, ip_restriction: nil ) click to toggle source

Updates a TCP Edge by ID. If a module is not specified in the update, it will not be modified. However, each module configuration that is specified will completely replace the existing value. There is no way to delete an existing module via this API, instead use the delete module API.

ngrok.com/docs/api#api-edges-tcp-update

# File lib/ngrokapi/models/tcp_edge.rb, line 49
def update(
  description: nil,
  metadata: nil,
  hostports: nil,
  backend: nil,
  ip_restriction: nil
)
  @description = description if description
  @metadata = metadata if metadata
  @hostports = hostports if hostports
  @backend = backend if backend
  @ip_restriction = ip_restriction if ip_restriction
  @client.update(
    id: @id,
    description: description,
    metadata: metadata,
    hostports: hostports,
    backend: backend,
    ip_restriction: ip_restriction
  )
end