Class: NgrokAPI::Models::Endpoint
- Inherits:
-
Object
- Object
- NgrokAPI::Models::Endpoint
- Defined in:
- lib/ngrokapi/models/endpoint.rb
Instance Attribute Summary collapse
-
#attrs ⇒ Object
readonly
Returns the value of attribute attrs.
-
#bindings ⇒ Object
readonly
Returns the value of attribute bindings.
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#domain ⇒ Object
readonly
Returns the value of attribute domain.
-
#edge ⇒ Object
readonly
Returns the value of attribute edge.
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#hostport ⇒ Object
readonly
Returns the value of attribute hostport.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#port ⇒ Object
readonly
Returns the value of attribute port.
-
#principal ⇒ Object
readonly
Returns the value of attribute principal.
-
#principal_id ⇒ Object
readonly
Returns the value of attribute principal_id.
-
#proto ⇒ Object
readonly
Returns the value of attribute proto.
-
#public_url ⇒ Object
readonly
Returns the value of attribute public_url.
-
#region ⇒ Object
readonly
Returns the value of attribute region.
-
#scheme ⇒ Object
readonly
Returns the value of attribute scheme.
-
#tcp_addr ⇒ Object
readonly
Returns the value of attribute tcp_addr.
-
#traffic_policy ⇒ Object
readonly
Returns the value of attribute traffic_policy.
-
#tunnel ⇒ Object
readonly
Returns the value of attribute tunnel.
-
#tunnel_session ⇒ Object
readonly
Returns the value of attribute tunnel_session.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#updated_at ⇒ Object
readonly
Returns the value of attribute updated_at.
-
#upstream_proto ⇒ Object
readonly
Returns the value of attribute upstream_proto.
-
#upstream_url ⇒ Object
readonly
Returns the value of attribute upstream_url.
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#delete ⇒ Object
Delete an Endpoint by ID, currently available only for cloud endpoints.
-
#initialize(client: nil, attrs: {}) ⇒ Endpoint
constructor
A new instance of Endpoint.
- #to_h ⇒ Object
- #to_s ⇒ Object
-
#update(url: nil, traffic_policy: nil, description: nil, metadata: nil, bindings: nil) ⇒ Object
Update an Endpoint by ID, currently available only for cloud endpoints.
Constructor Details
#initialize(client: nil, attrs: {}) ⇒ Endpoint
Returns a new instance of Endpoint.
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/ngrokapi/models/endpoint.rb', line 40 def initialize(client: nil, attrs: {}) @client = client @attrs = attrs @id = @attrs['id'] @region = @attrs['region'] @created_at = @attrs['created_at'] @updated_at = @attrs['updated_at'] unless @attrs['public_url'].nil? @public_url = URI(@attrs['public_url']) end @proto = @attrs['proto'] @scheme = @attrs['scheme'] @hostport = @attrs['hostport'] @host = @attrs['host'] @port = @attrs['port'] @type = @attrs['type'] @metadata = @attrs['metadata'] @description = @attrs['description'] @domain = @attrs['domain'] @tcp_addr = @attrs['tcp_addr'] @tunnel = @attrs['tunnel'] @edge = @attrs['edge'] @upstream_url = @attrs['upstream_url'] @upstream_proto = @attrs['upstream_proto'] @url = @attrs['url'] @principal = @attrs['principal'] @principal_id = @attrs['principal_id'] @traffic_policy = @attrs['traffic_policy'] @bindings = @attrs['bindings'] @tunnel_session = @attrs['tunnel_session'] unless @attrs['uri'].nil? @uri = URI(@attrs['uri']) end @name = @attrs['name'] end |
Instance Attribute Details
#attrs ⇒ Object (readonly)
Returns the value of attribute attrs.
10 11 12 |
# File 'lib/ngrokapi/models/endpoint.rb', line 10 def attrs @attrs end |
#bindings ⇒ Object (readonly)
Returns the value of attribute bindings.
10 11 12 |
# File 'lib/ngrokapi/models/endpoint.rb', line 10 def bindings @bindings end |
#client ⇒ Object (readonly)
Returns the value of attribute client.
10 11 12 |
# File 'lib/ngrokapi/models/endpoint.rb', line 10 def client @client end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
10 11 12 |
# File 'lib/ngrokapi/models/endpoint.rb', line 10 def created_at @created_at end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
10 11 12 |
# File 'lib/ngrokapi/models/endpoint.rb', line 10 def description @description end |
#domain ⇒ Object (readonly)
Returns the value of attribute domain.
10 11 12 |
# File 'lib/ngrokapi/models/endpoint.rb', line 10 def domain @domain end |
#edge ⇒ Object (readonly)
Returns the value of attribute edge.
10 11 12 |
# File 'lib/ngrokapi/models/endpoint.rb', line 10 def edge @edge end |
#host ⇒ Object (readonly)
Returns the value of attribute host.
10 11 12 |
# File 'lib/ngrokapi/models/endpoint.rb', line 10 def host @host end |
#hostport ⇒ Object (readonly)
Returns the value of attribute hostport.
10 11 12 |
# File 'lib/ngrokapi/models/endpoint.rb', line 10 def hostport @hostport end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
10 11 12 |
# File 'lib/ngrokapi/models/endpoint.rb', line 10 def id @id end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
10 11 12 |
# File 'lib/ngrokapi/models/endpoint.rb', line 10 def @metadata end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
10 11 12 |
# File 'lib/ngrokapi/models/endpoint.rb', line 10 def name @name end |
#port ⇒ Object (readonly)
Returns the value of attribute port.
10 11 12 |
# File 'lib/ngrokapi/models/endpoint.rb', line 10 def port @port end |
#principal ⇒ Object (readonly)
Returns the value of attribute principal.
10 11 12 |
# File 'lib/ngrokapi/models/endpoint.rb', line 10 def principal @principal end |
#principal_id ⇒ Object (readonly)
Returns the value of attribute principal_id.
10 11 12 |
# File 'lib/ngrokapi/models/endpoint.rb', line 10 def principal_id @principal_id end |
#proto ⇒ Object (readonly)
Returns the value of attribute proto.
10 11 12 |
# File 'lib/ngrokapi/models/endpoint.rb', line 10 def proto @proto end |
#public_url ⇒ Object (readonly)
Returns the value of attribute public_url.
10 11 12 |
# File 'lib/ngrokapi/models/endpoint.rb', line 10 def public_url @public_url end |
#region ⇒ Object (readonly)
Returns the value of attribute region.
10 11 12 |
# File 'lib/ngrokapi/models/endpoint.rb', line 10 def region @region end |
#scheme ⇒ Object (readonly)
Returns the value of attribute scheme.
10 11 12 |
# File 'lib/ngrokapi/models/endpoint.rb', line 10 def scheme @scheme end |
#tcp_addr ⇒ Object (readonly)
Returns the value of attribute tcp_addr.
10 11 12 |
# File 'lib/ngrokapi/models/endpoint.rb', line 10 def tcp_addr @tcp_addr end |
#traffic_policy ⇒ Object (readonly)
Returns the value of attribute traffic_policy.
10 11 12 |
# File 'lib/ngrokapi/models/endpoint.rb', line 10 def traffic_policy @traffic_policy end |
#tunnel ⇒ Object (readonly)
Returns the value of attribute tunnel.
10 11 12 |
# File 'lib/ngrokapi/models/endpoint.rb', line 10 def tunnel @tunnel end |
#tunnel_session ⇒ Object (readonly)
Returns the value of attribute tunnel_session.
10 11 12 |
# File 'lib/ngrokapi/models/endpoint.rb', line 10 def tunnel_session @tunnel_session end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
10 11 12 |
# File 'lib/ngrokapi/models/endpoint.rb', line 10 def type @type end |
#updated_at ⇒ Object (readonly)
Returns the value of attribute updated_at.
10 11 12 |
# File 'lib/ngrokapi/models/endpoint.rb', line 10 def updated_at @updated_at end |
#upstream_proto ⇒ Object (readonly)
Returns the value of attribute upstream_proto.
10 11 12 |
# File 'lib/ngrokapi/models/endpoint.rb', line 10 def upstream_proto @upstream_proto end |
#upstream_url ⇒ Object (readonly)
Returns the value of attribute upstream_url.
10 11 12 |
# File 'lib/ngrokapi/models/endpoint.rb', line 10 def upstream_url @upstream_url end |
#uri ⇒ Object (readonly)
Returns the value of attribute uri.
10 11 12 |
# File 'lib/ngrokapi/models/endpoint.rb', line 10 def uri @uri end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
10 11 12 |
# File 'lib/ngrokapi/models/endpoint.rb', line 10 def url @url end |
Instance Method Details
#==(other) ⇒ Object
76 77 78 |
# File 'lib/ngrokapi/models/endpoint.rb', line 76 def ==(other) @attrs == other.attrs end |
#delete ⇒ Object
Delete an Endpoint by ID, currently available only for cloud endpoints
118 119 120 121 122 |
# File 'lib/ngrokapi/models/endpoint.rb', line 118 def delete @client.delete( id: @id ) end |
#to_h ⇒ Object
84 85 86 |
# File 'lib/ngrokapi/models/endpoint.rb', line 84 def to_h @attrs.to_h end |
#to_s ⇒ Object
80 81 82 |
# File 'lib/ngrokapi/models/endpoint.rb', line 80 def to_s @attrs.to_s end |
#update(url: nil, traffic_policy: nil, description: nil, metadata: nil, bindings: nil) ⇒ Object
Update an Endpoint by ID, currently available only for cloud endpoints
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
# File 'lib/ngrokapi/models/endpoint.rb', line 92 def update( url: nil, traffic_policy: nil, description: nil, metadata: nil, bindings: nil ) @url = url if url @traffic_policy = traffic_policy if traffic_policy @description = description if description @metadata = if @bindings = bindings if bindings @client.update( id: @id, url: url, traffic_policy: traffic_policy, description: description, metadata: , bindings: bindings ) end |