Class: NgrokAPI::Services::ReservedDomainsClient
- Inherits:
-
Object
- Object
- NgrokAPI::Services::ReservedDomainsClient
- Defined in:
- lib/ngrokapi/services/reserved_domains_client.rb
Overview
A client for interacting with the reserved_domains API
Constant Summary collapse
- LIST_PROPERTY =
The List Property from the resulting API for list calls
'reserved_domains'- PATH =
The API path for reserved domains
'/reserved_domains'
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Instance Method Summary collapse
-
#create(name: '', region: '', description: '', metadata: '', http_endpoint_configuration_id: '', https_endpoint_configuration_id: '', certificate_id: nil, certificate_management_policy: nil) ⇒ NgrokAPI::Models::ReservedDomain
Create a new reserved domain.
-
#delete(id: nil) ⇒ nil
Delete a reserved domain.
-
#delete!(id: nil) ⇒ nil
Delete a reserved domain.
-
#delete_certificate(id: nil) ⇒ nil
Detach the certificate attached from a reserved domain.
-
#delete_certificate!(id: nil) ⇒ nil
Detach the certificate attached from a reserved domain.
-
#delete_certificate_management_policy(id: nil) ⇒ nil
Detach the certificate management policy attached from a reserved domain.
-
#delete_certificate_management_policy!(id: nil) ⇒ nil
Detach the certificate management policy attached from a reserved domain.
-
#delete_http_endpoint_config(id: nil) ⇒ nil
Detach the http endpoint configuration attached from a reserved domain.
-
#delete_http_endpoint_config!(id: nil) ⇒ nil
Detach the http endpoint configuration attached from a reserved domain.
-
#delete_https_endpoint_config(id: nil) ⇒ nil
Detach the https endpoint configuration attached from a reserved domain.
-
#delete_https_endpoint_config!(id: nil) ⇒ nil
Detach the https endpoint configuration attached from a reserved domain.
-
#get(id: nil) ⇒ NgrokAPI::Models::ReservedDomain
Get the details of a reserved domain.
-
#get!(id: nil) ⇒ NgrokAPI::Models::ReservedDomain
Get the details of a reserved domain.
-
#initialize(client:) ⇒ ReservedDomainsClient
constructor
A new instance of ReservedDomainsClient.
-
#list(before_id: nil, limit: nil, url: nil) ⇒ NgrokAPI::Models::Listable
List all reserved domains on this account.
-
#update(id: nil, certificate_id: nil, certificate_management_policy: nil, description: nil, http_endpoint_configuration_id: nil, https_endpoint_configuration_id: nil, metadata: nil) ⇒ NgrokAPI::Models::ReservedDomain
Update the attributes of a reserved domain.
-
#update!(id: nil, certificate_id: nil, certificate_management_policy: nil, description: nil, http_endpoint_configuration_id: nil, https_endpoint_configuration_id: nil, metadata: nil) ⇒ NgrokAPI::Models::ReservedDomain
Update the attributes of a reserved domain.
Constructor Details
#initialize(client:) ⇒ ReservedDomainsClient
Returns a new instance of ReservedDomainsClient.
17 18 19 |
# File 'lib/ngrokapi/services/reserved_domains_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/reserved_domains_client.rb', line 15 def client @client end |
Instance Method Details
#create(name: '', region: '', description: '', metadata: '', http_endpoint_configuration_id: '', https_endpoint_configuration_id: '', certificate_id: nil, certificate_management_policy: nil) ⇒ NgrokAPI::Models::ReservedDomain
Create a new reserved domain.
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/ngrokapi/services/reserved_domains_client.rb', line 37 def create( name: '', region: '', description: '', metadata: '', http_endpoint_configuration_id: '', https_endpoint_configuration_id: '', certificate_id: nil, certificate_management_policy: nil ) data = { name: name, region: region, description: description, metadata: , http_endpoint_configuration_id: http_endpoint_configuration_id, https_endpoint_configuration_id: https_endpoint_configuration_id, certificate_id: certificate_id, certificate_management_policy: certificate_management_policy, } result = @client.post(PATH, data: data) NgrokAPI::Models::ReservedDomain.new(client: self, result: result) end |
#delete(id: nil) ⇒ nil
Delete a reserved domain.
69 70 71 |
# File 'lib/ngrokapi/services/reserved_domains_client.rb', line 69 def delete(id: nil) @client.delete("#{PATH}/#{id}") end |
#delete!(id: nil) ⇒ nil
Delete a reserved domain. Throw an exception if 404.
80 81 82 |
# File 'lib/ngrokapi/services/reserved_domains_client.rb', line 80 def delete!(id: nil) @client.delete("#{PATH}/#{id}", danger: true) end |
#delete_certificate(id: nil) ⇒ nil
Detach the certificate attached from a reserved domain.
205 206 207 |
# File 'lib/ngrokapi/services/reserved_domains_client.rb', line 205 def delete_certificate(id: nil) @client.delete("#{PATH}/#{id}/certificate") end |
#delete_certificate!(id: nil) ⇒ nil
Detach the certificate attached from a reserved domain. Throw an exception if 404.
216 217 218 |
# File 'lib/ngrokapi/services/reserved_domains_client.rb', line 216 def delete_certificate!(id: nil) @client.delete("#{PATH}/#{id}/certificate", danger: true) end |
#delete_certificate_management_policy(id: nil) ⇒ nil
Detach the certificate management policy attached from a reserved domain.
ngrok.com/docs/api#api-reserved-domains-delete-certificate-management-policy
227 228 229 |
# File 'lib/ngrokapi/services/reserved_domains_client.rb', line 227 def delete_certificate_management_policy(id: nil) @client.delete("#{PATH}/#{id}/certificate_management_policy") end |
#delete_certificate_management_policy!(id: nil) ⇒ nil
Detach the certificate management policy attached from a reserved domain.
ngrok.com/docs/api#api-reserved-domains-delete-certificate-management-policy
238 239 240 |
# File 'lib/ngrokapi/services/reserved_domains_client.rb', line 238 def delete_certificate_management_policy!(id: nil) @client.delete("#{PATH}/#{id}/certificate_management_policy", danger: true) end |
#delete_http_endpoint_config(id: nil) ⇒ nil
Detach the http endpoint configuration attached from a reserved domain.
ngrok.com/docs/api#api-reserved-domains-delete-http-endpoint-config
249 250 251 |
# File 'lib/ngrokapi/services/reserved_domains_client.rb', line 249 def delete_http_endpoint_config(id: nil) @client.delete("#{PATH}/#{id}/http_endpoint_configuration") end |
#delete_http_endpoint_config!(id: nil) ⇒ nil
Detach the http endpoint configuration attached from a reserved domain. Throw an exception if 404.
ngrok.com/docs/api#api-reserved-domains-delete-http-endpoint-config
260 261 262 |
# File 'lib/ngrokapi/services/reserved_domains_client.rb', line 260 def delete_http_endpoint_config!(id: nil) @client.delete("#{PATH}/#{id}/http_endpoint_configuration", danger: true) end |
#delete_https_endpoint_config(id: nil) ⇒ nil
Detach the https endpoint configuration attached from a reserved domain.
ngrok.com/docs/api#api-reserved-domains-delete-https-endpoint-config
271 272 273 |
# File 'lib/ngrokapi/services/reserved_domains_client.rb', line 271 def delete_https_endpoint_config(id: nil) @client.delete("#{PATH}/#{id}/https_endpoint_configuration") end |
#delete_https_endpoint_config!(id: nil) ⇒ nil
Detach the https endpoint configuration attached from a reserved domain. Throw an exception if 404.
ngrok.com/docs/api#api-reserved-domains-delete-https-endpoint-config
282 283 284 |
# File 'lib/ngrokapi/services/reserved_domains_client.rb', line 282 def delete_https_endpoint_config!(id: nil) @client.delete("#{PATH}/#{id}/https_endpoint_configuration", danger: true) end |
#get(id: nil) ⇒ NgrokAPI::Models::ReservedDomain
Get the details of a reserved domain.
91 92 93 94 |
# File 'lib/ngrokapi/services/reserved_domains_client.rb', line 91 def get(id: nil) result = @client.get("#{PATH}/#{id}") NgrokAPI::Models::ReservedDomain.new(client: self, result: result) end |
#get!(id: nil) ⇒ NgrokAPI::Models::ReservedDomain
Get the details of a reserved domain. Throw an exception if 404.
103 104 105 106 |
# File 'lib/ngrokapi/services/reserved_domains_client.rb', line 103 def get!(id: nil) result = @client.get!("#{PATH}/#{id}") NgrokAPI::Models::ReservedDomain.new(client: self, result: result) end |
#list(before_id: nil, limit: nil, url: nil) ⇒ NgrokAPI::Models::Listable
List all reserved domains on this account.
117 118 119 120 121 122 123 124 125 |
# File 'lib/ngrokapi/services/reserved_domains_client.rb', line 117 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, result: result, list_property: LIST_PROPERTY, klass: NgrokAPI::Models::ReservedDomain ) end |
#update(id: nil, certificate_id: nil, certificate_management_policy: nil, description: nil, http_endpoint_configuration_id: nil, https_endpoint_configuration_id: nil, metadata: nil) ⇒ NgrokAPI::Models::ReservedDomain
Update the attributes of a reserved domain.
142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 |
# File 'lib/ngrokapi/services/reserved_domains_client.rb', line 142 def update( id: nil, certificate_id: nil, certificate_management_policy: nil, description: nil, http_endpoint_configuration_id: nil, https_endpoint_configuration_id: nil, metadata: nil ) data = build_data( description: description, metadata: , http_endpoint_configuration_id: http_endpoint_configuration_id, https_endpoint_configuration_id: https_endpoint_configuration_id, certificate_id: certificate_id, certificate_management_policy: certificate_management_policy ) result = @client.patch("#{PATH}/#{id}", data: data) NgrokAPI::Models::ReservedDomain.new(client: self, result: result) end |
#update!(id: nil, certificate_id: nil, certificate_management_policy: nil, description: nil, http_endpoint_configuration_id: nil, https_endpoint_configuration_id: nil, metadata: nil) ⇒ NgrokAPI::Models::ReservedDomain
Update the attributes of a reserved domain. Throw an exception if 404.
176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 |
# File 'lib/ngrokapi/services/reserved_domains_client.rb', line 176 def update!( id: nil, certificate_id: nil, certificate_management_policy: nil, description: nil, http_endpoint_configuration_id: nil, https_endpoint_configuration_id: nil, metadata: nil ) data = build_data( description: description, metadata: , http_endpoint_configuration_id: http_endpoint_configuration_id, https_endpoint_configuration_id: https_endpoint_configuration_id, certificate_id: certificate_id, certificate_management_policy: certificate_management_policy ) result = @client.patch("#{PATH}/#{id}", danger: true, data: data) NgrokAPI::Models::ReservedDomain.new(client: self, result: result) end |