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.



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

#attrsObject (readonly)

Returns the value of attribute attrs.



10
11
12
# File 'lib/ngrokapi/models/tls_certificate.rb', line 10

def attrs
  @attrs
end

#certificate_pemObject (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

#clientObject (readonly)

Returns the value of attribute client.



10
11
12
# File 'lib/ngrokapi/models/tls_certificate.rb', line 10

def client
  @client
end

#created_atObject (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

#descriptionObject (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_usagesObject (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

#idObject (readonly)

Returns the value of attribute id.



10
11
12
# File 'lib/ngrokapi/models/tls_certificate.rb', line 10

def id
  @id
end

#issued_atObject (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_nameObject (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_usagesObject (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

#metadataObject (readonly)

Returns the value of attribute metadata.



10
11
12
# File 'lib/ngrokapi/models/tls_certificate.rb', line 10

def 
  @metadata
end

#not_afterObject (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_beforeObject (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_typeObject (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_numberObject (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_namesObject (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_nameObject (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_countryObject (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_localityObject (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_organizationObject (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_unitObject (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_provinceObject (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

#uriObject (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

#deleteObject



78
79
80
81
82
# File 'lib/ngrokapi/models/tls_certificate.rb', line 78

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

#to_hObject



70
71
72
# File 'lib/ngrokapi/models/tls_certificate.rb', line 70

def to_h
  @attrs.to_h
end

#to_sObject



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

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



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