Class: NgrokAPI::Models::ReservedDomain
- Inherits:
-
Object
- Object
- NgrokAPI::Models::ReservedDomain
- Defined in:
- lib/ngrokapi/models/reserved_domain.rb
Overview
A resource representing data from the reserved_domains API
Instance Attribute Summary collapse
-
#certificate ⇒ Object
readonly
Returns the value of attribute certificate.
-
#certificate_management_policy ⇒ Object
readonly
Returns the value of attribute certificate_management_policy.
-
#certificate_management_status ⇒ Object
readonly
Returns the value of attribute certificate_management_status.
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#cname_target ⇒ Object
readonly
Returns the value of attribute cname_target.
-
#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.
-
#http_endpoint_configuration ⇒ Object
readonly
Returns the value of attribute http_endpoint_configuration.
-
#https_endpoint_configuration ⇒ Object
readonly
Returns the value of attribute https_endpoint_configuration.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#region ⇒ Object
readonly
Returns the value of attribute region.
-
#result ⇒ Object
readonly
Returns the value of attribute result.
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#delete ⇒ nil
Delete this reserved domain.
-
#delete_certificate ⇒ nil
Detach the certificate attached from this reserved domain.
-
#delete_certificate_management_policy ⇒ nil
Detach the certificate management policy attached from this reserved domain.
-
#delete_http_endpoint_config ⇒ nil
Detach the http endpoint configuration attached from this reserved domain.
-
#delete_https_endpoint_config ⇒ nil
Detach the https endpoint configuration attached from this reserved domain.
-
#initialize(client:, result:) ⇒ ReservedDomain
constructor
A new instance of ReservedDomain.
-
#restore_certificate ⇒ NgrokAPI::Models::ReservedDomain
Restore the certificate attached to this reserved domain.
-
#restore_certificate_management_policy ⇒ NgrokAPI::Models::ReservedDomain
Restore the certificate management policy attached to this reserved domain.
-
#restore_http_endpoint_config ⇒ NgrokAPI::Models::ReservedDomain
Restore the http endpoint configuration attached to this reserved domain.
-
#restore_https_endpoint_config ⇒ NgrokAPI::Models::ReservedDomain
Restore the https endpoint configuration attached to this reserved domain.
- #to_s ⇒ Object
-
#update(certificate_id: nil, certificate_management_policy: nil, description: '', http_endpoint_configuration_id: nil, https_endpoint_configuration_id: nil, metadata: '') ⇒ NgrokAPI::Models::ReservedDomain
Update the attributes of this reserved domain.
Constructor Details
#initialize(client:, result:) ⇒ ReservedDomain
Returns a new instance of ReservedDomain.
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/ngrokapi/models/reserved_domain.rb', line 24 def initialize(client:, result:) @client = client @result = result @created_at = @result['created_at'] @certificate = @result['certificate'] @certificate_management_policy = @result['certificate_management_policy'] @certificate_management_status = @result['certificate_management_status'] @cname_target = @result['cname_target'] @description = @result['description'] @domain = @result['domain'] @http_endpoint_configuration = @result['http_endpoint_configuration'] @https_endpoint_configuration = @result['https_endpoint_configuration'] @id = @result['id'] @metadata = @result['metadata'] @region = @result['region'] @uri = @result['uri'] end |
Instance Attribute Details
#certificate ⇒ Object (readonly)
Returns the value of attribute certificate.
8 9 10 |
# File 'lib/ngrokapi/models/reserved_domain.rb', line 8 def certificate @certificate end |
#certificate_management_policy ⇒ Object (readonly)
Returns the value of attribute certificate_management_policy.
8 9 10 |
# File 'lib/ngrokapi/models/reserved_domain.rb', line 8 def certificate_management_policy @certificate_management_policy end |
#certificate_management_status ⇒ Object (readonly)
Returns the value of attribute certificate_management_status.
8 9 10 |
# File 'lib/ngrokapi/models/reserved_domain.rb', line 8 def certificate_management_status @certificate_management_status end |
#client ⇒ Object (readonly)
Returns the value of attribute client.
8 9 10 |
# File 'lib/ngrokapi/models/reserved_domain.rb', line 8 def client @client end |
#cname_target ⇒ Object (readonly)
Returns the value of attribute cname_target.
8 9 10 |
# File 'lib/ngrokapi/models/reserved_domain.rb', line 8 def cname_target @cname_target end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
8 9 10 |
# File 'lib/ngrokapi/models/reserved_domain.rb', line 8 def created_at @created_at end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
8 9 10 |
# File 'lib/ngrokapi/models/reserved_domain.rb', line 8 def description @description end |
#domain ⇒ Object (readonly)
Returns the value of attribute domain.
8 9 10 |
# File 'lib/ngrokapi/models/reserved_domain.rb', line 8 def domain @domain end |
#http_endpoint_configuration ⇒ Object (readonly)
Returns the value of attribute http_endpoint_configuration.
8 9 10 |
# File 'lib/ngrokapi/models/reserved_domain.rb', line 8 def http_endpoint_configuration @http_endpoint_configuration end |
#https_endpoint_configuration ⇒ Object (readonly)
Returns the value of attribute https_endpoint_configuration.
8 9 10 |
# File 'lib/ngrokapi/models/reserved_domain.rb', line 8 def https_endpoint_configuration @https_endpoint_configuration end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
8 9 10 |
# File 'lib/ngrokapi/models/reserved_domain.rb', line 8 def id @id end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
8 9 10 |
# File 'lib/ngrokapi/models/reserved_domain.rb', line 8 def @metadata end |
#region ⇒ Object (readonly)
Returns the value of attribute region.
8 9 10 |
# File 'lib/ngrokapi/models/reserved_domain.rb', line 8 def region @region end |
#result ⇒ Object (readonly)
Returns the value of attribute result.
8 9 10 |
# File 'lib/ngrokapi/models/reserved_domain.rb', line 8 def result @result end |
#uri ⇒ Object (readonly)
Returns the value of attribute uri.
8 9 10 |
# File 'lib/ngrokapi/models/reserved_domain.rb', line 8 def uri @uri end |
Instance Method Details
#==(other) ⇒ Object
42 43 44 |
# File 'lib/ngrokapi/models/reserved_domain.rb', line 42 def ==(other) @result == other.result end |
#delete ⇒ nil
Delete this reserved domain.
56 57 58 |
# File 'lib/ngrokapi/models/reserved_domain.rb', line 56 def delete @client.delete(id: @id) end |
#delete_certificate ⇒ nil
Detach the certificate attached from this reserved domain.
113 114 115 116 |
# File 'lib/ngrokapi/models/reserved_domain.rb', line 113 def delete_certificate @certificate = nil @client.delete_certificate(id: @id) end |
#delete_certificate_management_policy ⇒ nil
Detach the certificate management policy attached from this reserved domain.
ngrok.com/docs/api#api-reserved-domains-delete-certificate-management-policy
124 125 126 127 128 |
# File 'lib/ngrokapi/models/reserved_domain.rb', line 124 def delete_certificate_management_policy @certificate_management_policy = nil @certificate_management_status = nil @client.delete_certificate_management_policy(id: @id) end |
#delete_http_endpoint_config ⇒ nil
Detach the http endpoint configuration attached from this reserved domain.
ngrok.com/docs/api#api-reserved-domains-delete-http-endpoint-config
136 137 138 139 |
# File 'lib/ngrokapi/models/reserved_domain.rb', line 136 def delete_http_endpoint_config @http_endpoint_configuration = nil @client.delete_http_endpoint_config(id: @id) end |
#delete_https_endpoint_config ⇒ nil
Detach the https endpoint configuration attached from this reserved domain.
ngrok.com/docs/api#api-reserved-domains-delete-https-endpoint-config
147 148 149 150 |
# File 'lib/ngrokapi/models/reserved_domain.rb', line 147 def delete_https_endpoint_config @https_endpoint_configuration = nil @client.delete_https_endpoint_config(id: @id) end |
#restore_certificate ⇒ NgrokAPI::Models::ReservedDomain
Restore the certificate attached to this reserved domain. Only works if the @result is still present from a previous action
159 160 161 162 |
# File 'lib/ngrokapi/models/reserved_domain.rb', line 159 def restore_certificate @certificate = @result['certificate'] @client.update(id: @id, certificate_id: @result['certificate']['id']) end |
#restore_certificate_management_policy ⇒ NgrokAPI::Models::ReservedDomain
Restore the certificate management policy attached to this reserved domain. Only works if the @result is still present from a previous action
171 172 173 174 175 176 177 178 |
# File 'lib/ngrokapi/models/reserved_domain.rb', line 171 def restore_certificate_management_policy @certificate_management_policy = @result['certificate_management_policy'] @certificate_management_status = @result['certificate_management_status'] @client.update( id: @id, certificate_management_policy: @result['certificate_management_policy'] ) end |
#restore_http_endpoint_config ⇒ NgrokAPI::Models::ReservedDomain
Restore the http endpoint configuration attached to this reserved domain. Only works if the @result is still present from a previous action
187 188 189 190 191 192 193 |
# File 'lib/ngrokapi/models/reserved_domain.rb', line 187 def restore_http_endpoint_config @http_endpoint_configuration = @result['http_endpoint_configuration'] @client.update( id: @id, http_endpoint_configuration_id: @result['http_endpoint_configuration']['id'] ) end |
#restore_https_endpoint_config ⇒ NgrokAPI::Models::ReservedDomain
Restore the https endpoint configuration attached to this reserved domain. Only works if the @result is still present from a previous action
202 203 204 205 206 207 208 |
# File 'lib/ngrokapi/models/reserved_domain.rb', line 202 def restore_https_endpoint_config @https_endpoint_configuration = @result['https_endpoint_configuration'] @client.update( id: @id, https_endpoint_configuration_id: @result['https_endpoint_configuration']['id'] ) end |
#to_s ⇒ Object
46 47 48 |
# File 'lib/ngrokapi/models/reserved_domain.rb', line 46 def to_s @result.to_s end |
#update(certificate_id: nil, certificate_management_policy: nil, description: '', http_endpoint_configuration_id: nil, https_endpoint_configuration_id: nil, metadata: '') ⇒ NgrokAPI::Models::ReservedDomain
Update the attributes of this reserved domain.
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/ngrokapi/models/reserved_domain.rb', line 74 def update( certificate_id: nil, certificate_management_policy: nil, description: '', http_endpoint_configuration_id: nil, https_endpoint_configuration_id: nil, metadata: '' ) if certificate_management_policy @certificate_management_policy = certificate_management_policy end @description = description if description @metadata = if @client.update( id: @id, 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 ) # TODO: update @certificate, etc? # @certificate = new_result['certificate'] if certificate_id && new_result['certificate'] # if http_endpoint_configuration_id # @http_endpoint_configuration_id = http_endpoint_configuration_id # end # if https_endpoint_configuration_id # @https_endpoint_configuration_id = https_endpoint_configuration_id # end end |