Class: NgrokAPI::Models::TLSCertificate
- Inherits:
-
Object
- Object
- NgrokAPI::Models::TLSCertificate
- Defined in:
- lib/ngrokapi/models/tls_certificate.rb
Instance Attribute Summary collapse
-
#attrs ⇒ Object
readonly
Returns the value of attribute attrs.
-
#certificate_pem ⇒ Object
readonly
Returns the value of attribute certificate_pem.
-
#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.
-
#extended_key_usages ⇒ Object
readonly
Returns the value of attribute extended_key_usages.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#issued_at ⇒ Object
readonly
Returns the value of attribute issued_at.
-
#issuer_common_name ⇒ Object
readonly
Returns the value of attribute issuer_common_name.
-
#key_usages ⇒ Object
readonly
Returns the value of attribute key_usages.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#not_after ⇒ Object
readonly
Returns the value of attribute not_after.
-
#not_before ⇒ Object
readonly
Returns the value of attribute not_before.
-
#private_key_type ⇒ Object
readonly
Returns the value of attribute private_key_type.
-
#serial_number ⇒ Object
readonly
Returns the value of attribute serial_number.
-
#subject_alternative_names ⇒ Object
readonly
Returns the value of attribute subject_alternative_names.
-
#subject_common_name ⇒ Object
readonly
Returns the value of attribute subject_common_name.
-
#subject_country ⇒ Object
readonly
Returns the value of attribute subject_country.
-
#subject_locality ⇒ Object
readonly
Returns the value of attribute subject_locality.
-
#subject_organization ⇒ Object
readonly
Returns the value of attribute subject_organization.
-
#subject_organizational_unit ⇒ Object
readonly
Returns the value of attribute subject_organizational_unit.
-
#subject_province ⇒ Object
readonly
Returns the value of attribute subject_province.
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#delete ⇒ Object
Delete a TLS certificate.
-
#initialize(client: nil, attrs: {}) ⇒ TLSCertificate
constructor
A new instance of TLSCertificate.
- #to_h ⇒ Object
- #to_s ⇒ Object
-
#update(description: nil, metadata: nil) ⇒ Object
Update attributes of a TLS Certificate by ID.
Constructor Details
#initialize(client: nil, attrs: {}) ⇒ TLSCertificate
Returns a new instance of TLSCertificate.
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/ngrokapi/models/tls_certificate.rb', line 34 def initialize(client: nil, attrs: {}) @client = client @attrs = attrs @id = @attrs['id'] unless @attrs['uri'].nil? @uri = URI(@attrs['uri']) end @created_at = @attrs['created_at'] @description = @attrs['description'] @metadata = @attrs['metadata'] @certificate_pem = @attrs['certificate_pem'] @subject_common_name = @attrs['subject_common_name'] @subject_alternative_names = @attrs['subject_alternative_names'] @issued_at = @attrs['issued_at'] @not_before = @attrs['not_before'] @not_after = @attrs['not_after'] @key_usages = @attrs['key_usages'] @extended_key_usages = @attrs['extended_key_usages'] @private_key_type = @attrs['private_key_type'] @issuer_common_name = @attrs['issuer_common_name'] @serial_number = @attrs['serial_number'] @subject_organization = @attrs['subject_organization'] @subject_organizational_unit = @attrs['subject_organizational_unit'] @subject_locality = @attrs['subject_locality'] @subject_province = @attrs['subject_province'] @subject_country = @attrs['subject_country'] end |
Instance Attribute Details
#attrs ⇒ Object (readonly)
Returns the value of attribute attrs.
10 11 12 |
# File 'lib/ngrokapi/models/tls_certificate.rb', line 10 def attrs @attrs end |
#certificate_pem ⇒ Object (readonly)
Returns the value of attribute certificate_pem.
10 11 12 |
# File 'lib/ngrokapi/models/tls_certificate.rb', line 10 def certificate_pem @certificate_pem end |
#client ⇒ Object (readonly)
Returns the value of attribute client.
10 11 12 |
# File 'lib/ngrokapi/models/tls_certificate.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/tls_certificate.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/tls_certificate.rb', line 10 def description @description end |
#extended_key_usages ⇒ Object (readonly)
Returns the value of attribute extended_key_usages.
10 11 12 |
# File 'lib/ngrokapi/models/tls_certificate.rb', line 10 def extended_key_usages @extended_key_usages end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
10 11 12 |
# File 'lib/ngrokapi/models/tls_certificate.rb', line 10 def id @id end |
#issued_at ⇒ Object (readonly)
Returns the value of attribute issued_at.
10 11 12 |
# File 'lib/ngrokapi/models/tls_certificate.rb', line 10 def issued_at @issued_at end |
#issuer_common_name ⇒ Object (readonly)
Returns the value of attribute issuer_common_name.
10 11 12 |
# File 'lib/ngrokapi/models/tls_certificate.rb', line 10 def issuer_common_name @issuer_common_name end |
#key_usages ⇒ Object (readonly)
Returns the value of attribute key_usages.
10 11 12 |
# File 'lib/ngrokapi/models/tls_certificate.rb', line 10 def key_usages @key_usages end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
10 11 12 |
# File 'lib/ngrokapi/models/tls_certificate.rb', line 10 def @metadata end |
#not_after ⇒ Object (readonly)
Returns the value of attribute not_after.
10 11 12 |
# File 'lib/ngrokapi/models/tls_certificate.rb', line 10 def not_after @not_after end |
#not_before ⇒ Object (readonly)
Returns the value of attribute not_before.
10 11 12 |
# File 'lib/ngrokapi/models/tls_certificate.rb', line 10 def not_before @not_before end |
#private_key_type ⇒ Object (readonly)
Returns the value of attribute private_key_type.
10 11 12 |
# File 'lib/ngrokapi/models/tls_certificate.rb', line 10 def private_key_type @private_key_type end |
#serial_number ⇒ Object (readonly)
Returns the value of attribute serial_number.
10 11 12 |
# File 'lib/ngrokapi/models/tls_certificate.rb', line 10 def serial_number @serial_number end |
#subject_alternative_names ⇒ Object (readonly)
Returns the value of attribute subject_alternative_names.
10 11 12 |
# File 'lib/ngrokapi/models/tls_certificate.rb', line 10 def subject_alternative_names @subject_alternative_names end |
#subject_common_name ⇒ Object (readonly)
Returns the value of attribute subject_common_name.
10 11 12 |
# File 'lib/ngrokapi/models/tls_certificate.rb', line 10 def subject_common_name @subject_common_name end |
#subject_country ⇒ Object (readonly)
Returns the value of attribute subject_country.
10 11 12 |
# File 'lib/ngrokapi/models/tls_certificate.rb', line 10 def subject_country @subject_country end |
#subject_locality ⇒ Object (readonly)
Returns the value of attribute subject_locality.
10 11 12 |
# File 'lib/ngrokapi/models/tls_certificate.rb', line 10 def subject_locality @subject_locality end |
#subject_organization ⇒ Object (readonly)
Returns the value of attribute subject_organization.
10 11 12 |
# File 'lib/ngrokapi/models/tls_certificate.rb', line 10 def subject_organization @subject_organization end |
#subject_organizational_unit ⇒ Object (readonly)
Returns the value of attribute subject_organizational_unit.
10 11 12 |
# File 'lib/ngrokapi/models/tls_certificate.rb', line 10 def subject_organizational_unit @subject_organizational_unit end |
#subject_province ⇒ Object (readonly)
Returns the value of attribute subject_province.
10 11 12 |
# File 'lib/ngrokapi/models/tls_certificate.rb', line 10 def subject_province @subject_province end |
#uri ⇒ Object (readonly)
Returns the value of attribute uri.
10 11 12 |
# File 'lib/ngrokapi/models/tls_certificate.rb', line 10 def uri @uri end |
Instance Method Details
#==(other) ⇒ Object
62 63 64 |
# File 'lib/ngrokapi/models/tls_certificate.rb', line 62 def ==(other) @attrs == other.attrs end |
#delete ⇒ Object
Delete a TLS certificate
78 79 80 81 82 |
# File 'lib/ngrokapi/models/tls_certificate.rb', line 78 def delete @client.delete( id: @id ) end |
#to_h ⇒ Object
70 71 72 |
# File 'lib/ngrokapi/models/tls_certificate.rb', line 70 def to_h @attrs.to_h end |
#to_s ⇒ Object
66 67 68 |
# File 'lib/ngrokapi/models/tls_certificate.rb', line 66 def to_s @attrs.to_s end |
#update(description: nil, metadata: nil) ⇒ Object
Update attributes of a TLS Certificate by ID
88 89 90 91 92 93 94 95 96 97 98 99 |
# File 'lib/ngrokapi/models/tls_certificate.rb', line 88 def update( description: nil, metadata: nil ) @description = description if description @metadata = if @client.update( id: @id, description: description, metadata: ) end |