Class: NgrokAPI::Services::EdgesHTTPSClient
- Inherits:
-
Object
- Object
- NgrokAPI::Services::EdgesHTTPSClient
- Defined in:
- lib/ngrokapi/services/edges_https_client.rb
Overview
Constant Summary collapse
- PATH =
The API path for the requests
'/edges/https'
- LIST_PROPERTY =
The List Property from the resulting API for list calls
'https_edges'
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Instance Method Summary collapse
-
#create(description: "", metadata: "", hostports: nil, mutual_tls: nil, tls_termination: nil) ⇒ NgrokAPI::Models::HTTPSEdge
Create an HTTPS Edge.
-
#create!(description: "", metadata: "", hostports: nil, mutual_tls: nil, tls_termination: nil) ⇒ NgrokAPI::Models::HTTPSEdge
Create an HTTPS Edge Throws an exception if API error.
-
#delete(id: "") ⇒ NgrokAPI::Models::Empty
Delete an HTTPS Edge by ID.
-
#delete!(id: "") ⇒ NgrokAPI::Models::Empty
Delete an HTTPS Edge by ID Throws an exception if API error.
-
#get(id: "") ⇒ NgrokAPI::Models::HTTPSEdge
Get an HTTPS Edge by ID.
-
#get!(id: "") ⇒ NgrokAPI::Models::HTTPSEdge
Get an HTTPS Edge by ID Throws an exception if API error.
-
#initialize(client:) ⇒ EdgesHTTPSClient
constructor
A new instance of EdgesHTTPSClient.
-
#list(before_id: nil, limit: nil, url: nil) ⇒ NgrokAPI::Models::Listable
Returns a list of all HTTPS Edges on this account.
-
#list!(before_id: nil, limit: nil, url: nil) ⇒ NgrokAPI::Models::Listable
Returns a list of all HTTPS Edges on this account Throws an exception if API error.
-
#update(id: "", description: nil, metadata: nil, hostports: nil, mutual_tls: nil, tls_termination: nil) ⇒ NgrokAPI::Models::HTTPSEdge
Updates an HTTPS Edge by ID.
-
#update!(id: "", description: nil, metadata: nil, hostports: nil, mutual_tls: nil, tls_termination: nil) ⇒ NgrokAPI::Models::HTTPSEdge
Updates an HTTPS Edge by ID.
Constructor Details
#initialize(client:) ⇒ EdgesHTTPSClient
Returns a new instance of EdgesHTTPSClient.
17 18 19 |
# File 'lib/ngrokapi/services/edges_https_client.rb', line 17 def initialize(client:) @client = client end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
15 16 17 |
# File 'lib/ngrokapi/services/edges_https_client.rb', line 15 def client @client end |
Instance Method Details
#create(description: "", metadata: "", hostports: nil, mutual_tls: nil, tls_termination: nil) ⇒ NgrokAPI::Models::HTTPSEdge
Create an HTTPS Edge
32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/ngrokapi/services/edges_https_client.rb', line 32 def create(description: "", metadata: "", hostports: nil, mutual_tls: nil, tls_termination: nil) path = '/edges/https' replacements = { } data = {} data[:description] = description if description data[:metadata] = if data[:hostports] = hostports if hostports data[:mutual_tls] = mutual_tls if mutual_tls data[:tls_termination] = tls_termination if tls_termination result = @client.post(path % replacements, data: data) NgrokAPI::Models::HTTPSEdge.new(client: self, attrs: result) end |
#create!(description: "", metadata: "", hostports: nil, mutual_tls: nil, tls_termination: nil) ⇒ NgrokAPI::Models::HTTPSEdge
Create an HTTPS Edge Throws an exception if API error.
58 59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/ngrokapi/services/edges_https_client.rb', line 58 def create!(description: "", metadata: "", hostports: nil, mutual_tls: nil, tls_termination: nil) path = '/edges/https' replacements = { } data = {} data[:description] = description if description data[:metadata] = if data[:hostports] = hostports if hostports data[:mutual_tls] = mutual_tls if mutual_tls data[:tls_termination] = tls_termination if tls_termination result = @client.post(path % replacements, data: data, danger: true) NgrokAPI::Models::HTTPSEdge.new(client: self, attrs: result) end |
#delete(id: "") ⇒ NgrokAPI::Models::Empty
Delete an HTTPS Edge by ID
236 237 238 239 240 241 242 |
# File 'lib/ngrokapi/services/edges_https_client.rb', line 236 def delete(id: "") path = '/edges/https/%{id}' replacements = { id: id, } @client.delete(path % replacements) end |
#delete!(id: "") ⇒ NgrokAPI::Models::Empty
Delete an HTTPS Edge by ID Throws an exception if API error.
252 253 254 255 256 257 258 |
# File 'lib/ngrokapi/services/edges_https_client.rb', line 252 def delete!(id: "") path = '/edges/https/%{id}' replacements = { id: id, } @client.delete(path % replacements, danger: true) end |
#get(id: "") ⇒ NgrokAPI::Models::HTTPSEdge
Get an HTTPS Edge by ID
79 80 81 82 83 84 85 86 87 |
# File 'lib/ngrokapi/services/edges_https_client.rb', line 79 def get(id: "") path = '/edges/https/%{id}' replacements = { id: id, } data = {} result = @client.get(path % replacements, data: data) NgrokAPI::Models::HTTPSEdge.new(client: self, attrs: result) end |
#get!(id: "") ⇒ NgrokAPI::Models::HTTPSEdge
Get an HTTPS Edge by ID Throws an exception if API error.
97 98 99 100 101 102 103 104 105 |
# File 'lib/ngrokapi/services/edges_https_client.rb', line 97 def get!(id: "") path = '/edges/https/%{id}' replacements = { id: id, } data = {} result = @client.get(path % replacements, data: data, danger: true) NgrokAPI::Models::HTTPSEdge.new(client: self, attrs: result) end |
#list(before_id: nil, limit: nil, url: nil) ⇒ NgrokAPI::Models::Listable
Returns a list of all HTTPS Edges on this account
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 |
# File 'lib/ngrokapi/services/edges_https_client.rb', line 116 def list( before_id: nil, limit: nil, url: nil ) result = @client.list( before_id: before_id, limit: limit, url: url, path: PATH ) NgrokAPI::Models::Listable.new( client: self, attrs: result, list_property: LIST_PROPERTY, klass: NgrokAPI::Models::HTTPSEdge ) end |
#list!(before_id: nil, limit: nil, url: nil) ⇒ NgrokAPI::Models::Listable
Returns a list of all HTTPS Edges on this account Throws an exception if API error.
146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 |
# File 'lib/ngrokapi/services/edges_https_client.rb', line 146 def list!( before_id: nil, limit: nil, url: nil ) result = @client.list( before_id: before_id, limit: limit, danger: true, url: url, path: PATH ) NgrokAPI::Models::Listable.new( client: self, attrs: result, list_property: LIST_PROPERTY, klass: NgrokAPI::Models::HTTPSEdge, danger: true ) end |
#update(id: "", description: nil, metadata: nil, hostports: nil, mutual_tls: nil, tls_termination: nil) ⇒ NgrokAPI::Models::HTTPSEdge
Updates an HTTPS 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.
183 184 185 186 187 188 189 190 191 192 193 194 195 196 |
# File 'lib/ngrokapi/services/edges_https_client.rb', line 183 def update(id: "", description: nil, metadata: nil, hostports: nil, mutual_tls: nil, tls_termination: nil) path = '/edges/https/%{id}' replacements = { id: id, } data = {} data[:description] = description if description data[:metadata] = if data[:hostports] = hostports if hostports data[:mutual_tls] = mutual_tls if mutual_tls data[:tls_termination] = tls_termination if tls_termination result = @client.patch(path % replacements, data: data) NgrokAPI::Models::HTTPSEdge.new(client: self, attrs: result) end |
#update!(id: "", description: nil, metadata: nil, hostports: nil, mutual_tls: nil, tls_termination: nil) ⇒ NgrokAPI::Models::HTTPSEdge
Updates an HTTPS 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. Throws an exception if API error.
214 215 216 217 218 219 220 221 222 223 224 225 226 227 |
# File 'lib/ngrokapi/services/edges_https_client.rb', line 214 def update!(id: "", description: nil, metadata: nil, hostports: nil, mutual_tls: nil, tls_termination: nil) path = '/edges/https/%{id}' replacements = { id: id, } data = {} data[:description] = description if description data[:metadata] = if data[:hostports] = hostports if hostports data[:mutual_tls] = mutual_tls if mutual_tls data[:tls_termination] = tls_termination if tls_termination result = @client.patch(path % replacements, data: data, danger: true) NgrokAPI::Models::HTTPSEdge.new(client: self, attrs: result) end |