Class: NgrokAPI::Models::TLSCertificate

Inherits:
Object
  • Object
show all
Defined in:
lib/ngrokapi/models/tls_certificate.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client: nil, attrs: {}) ⇒ TLSCertificate

Returns a new instance of TLSCertificate.



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/ngrokapi/models/tls_certificate.rb', line 30

def initialize(client: nil, attrs: {})
  @client = client
  @attrs = attrs
  @id = @attrs['id']
  @uri = @attrs['uri']
  @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

#attrsObject (readonly)

Returns the value of attribute attrs.



6
7
8
# File 'lib/ngrokapi/models/tls_certificate.rb', line 6

def attrs
  @attrs
end

#certificate_pemObject (readonly)

Returns the value of attribute certificate_pem.



6
7
8
# File 'lib/ngrokapi/models/tls_certificate.rb', line 6

def certificate_pem
  @certificate_pem
end

#clientObject (readonly)

Returns the value of attribute client.



6
7
8
# File 'lib/ngrokapi/models/tls_certificate.rb', line 6

def client
  @client
end

#created_atObject (readonly)

Returns the value of attribute created_at.



6
7
8
# File 'lib/ngrokapi/models/tls_certificate.rb', line 6

def created_at
  @created_at
end

#descriptionObject (readonly)

Returns the value of attribute description.



6
7
8
# File 'lib/ngrokapi/models/tls_certificate.rb', line 6

def description
  @description
end

#extended_key_usagesObject (readonly)

Returns the value of attribute extended_key_usages.



6
7
8
# File 'lib/ngrokapi/models/tls_certificate.rb', line 6

def extended_key_usages
  @extended_key_usages
end

#idObject (readonly)

Returns the value of attribute id.



6
7
8
# File 'lib/ngrokapi/models/tls_certificate.rb', line 6

def id
  @id
end

#issued_atObject (readonly)

Returns the value of attribute issued_at.



6
7
8
# File 'lib/ngrokapi/models/tls_certificate.rb', line 6

def issued_at
  @issued_at
end

#issuer_common_nameObject (readonly)

Returns the value of attribute issuer_common_name.



6
7
8
# File 'lib/ngrokapi/models/tls_certificate.rb', line 6

def issuer_common_name
  @issuer_common_name
end

#key_usagesObject (readonly)

Returns the value of attribute key_usages.



6
7
8
# File 'lib/ngrokapi/models/tls_certificate.rb', line 6

def key_usages
  @key_usages
end

#metadataObject (readonly)

Returns the value of attribute metadata.



6
7
8
# File 'lib/ngrokapi/models/tls_certificate.rb', line 6

def 
  @metadata
end

#not_afterObject (readonly)

Returns the value of attribute not_after.



6
7
8
# File 'lib/ngrokapi/models/tls_certificate.rb', line 6

def not_after
  @not_after
end

#not_beforeObject (readonly)

Returns the value of attribute not_before.



6
7
8
# File 'lib/ngrokapi/models/tls_certificate.rb', line 6

def not_before
  @not_before
end

#private_key_typeObject (readonly)

Returns the value of attribute private_key_type.



6
7
8
# File 'lib/ngrokapi/models/tls_certificate.rb', line 6

def private_key_type
  @private_key_type
end

#serial_numberObject (readonly)

Returns the value of attribute serial_number.



6
7
8
# File 'lib/ngrokapi/models/tls_certificate.rb', line 6

def serial_number
  @serial_number
end

#subject_alternative_namesObject (readonly)

Returns the value of attribute subject_alternative_names.



6
7
8
# File 'lib/ngrokapi/models/tls_certificate.rb', line 6

def subject_alternative_names
  @subject_alternative_names
end

#subject_common_nameObject (readonly)

Returns the value of attribute subject_common_name.



6
7
8
# File 'lib/ngrokapi/models/tls_certificate.rb', line 6

def subject_common_name
  @subject_common_name
end

#subject_countryObject (readonly)

Returns the value of attribute subject_country.



6
7
8
# File 'lib/ngrokapi/models/tls_certificate.rb', line 6

def subject_country
  @subject_country
end

#subject_localityObject (readonly)

Returns the value of attribute subject_locality.



6
7
8
# File 'lib/ngrokapi/models/tls_certificate.rb', line 6

def subject_locality
  @subject_locality
end

#subject_organizationObject (readonly)

Returns the value of attribute subject_organization.



6
7
8
# File 'lib/ngrokapi/models/tls_certificate.rb', line 6

def subject_organization
  @subject_organization
end

#subject_organizational_unitObject (readonly)

Returns the value of attribute subject_organizational_unit.



6
7
8
# File 'lib/ngrokapi/models/tls_certificate.rb', line 6

def subject_organizational_unit
  @subject_organizational_unit
end

#subject_provinceObject (readonly)

Returns the value of attribute subject_province.



6
7
8
# File 'lib/ngrokapi/models/tls_certificate.rb', line 6

def subject_province
  @subject_province
end

#uriObject (readonly)

Returns the value of attribute uri.



6
7
8
# File 'lib/ngrokapi/models/tls_certificate.rb', line 6

def uri
  @uri
end

Instance Method Details

#==(other) ⇒ Object



56
57
58
# File 'lib/ngrokapi/models/tls_certificate.rb', line 56

def ==(other)
  @attrs == other.attrs
end

#deleteObject



72
73
74
75
76
# File 'lib/ngrokapi/models/tls_certificate.rb', line 72

def delete
  @client.delete(
    id: @id
  )
end

#to_hObject



64
65
66
# File 'lib/ngrokapi/models/tls_certificate.rb', line 64

def to_h
  @attrs.to_h
end

#to_sObject



60
61
62
# File 'lib/ngrokapi/models/tls_certificate.rb', line 60

def to_s
  @attrs.to_s
end

#update(description: nil, metadata: nil) ⇒ Object

Update attributes of a TLS Certificate by ID

ngrok.com/docs/api#api-tls-certificates-update



82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/ngrokapi/models/tls_certificate.rb', line 82

def update(
  description: nil,
  metadata: nil
)
  @description = description if description
  @metadata =  if 
  @client.update(
    id: @id,
    description: description,
    metadata: 
  )
end