Class: NgrokAPI::Models::CertificateAuthority

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of CertificateAuthority.



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/ngrokapi/models/certificate_authority.rb', line 20

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']
  @ca_pem = @attrs['ca_pem']
  @subject_common_name = @attrs['subject_common_name']
  @not_before = @attrs['not_before']
  @not_after = @attrs['not_after']
  @key_usages = @attrs['key_usages']
  @extended_key_usages = @attrs['extended_key_usages']
end

Instance Attribute Details

#attrsObject (readonly)

Returns the value of attribute attrs.



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

def attrs
  @attrs
end

#ca_pemObject (readonly)

Returns the value of attribute ca_pem.



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

def ca_pem
  @ca_pem
end

#clientObject (readonly)

Returns the value of attribute client.



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

def client
  @client
end

#created_atObject (readonly)

Returns the value of attribute created_at.



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

def created_at
  @created_at
end

#descriptionObject (readonly)

Returns the value of attribute description.



6
7
8
# File 'lib/ngrokapi/models/certificate_authority.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/certificate_authority.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/certificate_authority.rb', line 6

def id
  @id
end

#key_usagesObject (readonly)

Returns the value of attribute key_usages.



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

def key_usages
  @key_usages
end

#metadataObject (readonly)

Returns the value of attribute metadata.



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

def 
  @metadata
end

#not_afterObject (readonly)

Returns the value of attribute not_after.



6
7
8
# File 'lib/ngrokapi/models/certificate_authority.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/certificate_authority.rb', line 6

def not_before
  @not_before
end

#subject_common_nameObject (readonly)

Returns the value of attribute subject_common_name.



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

def subject_common_name
  @subject_common_name
end

#uriObject (readonly)

Returns the value of attribute uri.



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

def uri
  @uri
end

Instance Method Details

#==(other) ⇒ Object



36
37
38
# File 'lib/ngrokapi/models/certificate_authority.rb', line 36

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

#deleteObject



52
53
54
55
56
# File 'lib/ngrokapi/models/certificate_authority.rb', line 52

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

#to_hObject



44
45
46
# File 'lib/ngrokapi/models/certificate_authority.rb', line 44

def to_h
  @attrs.to_h
end

#to_sObject



40
41
42
# File 'lib/ngrokapi/models/certificate_authority.rb', line 40

def to_s
  @attrs.to_s
end

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

Update attributes of a Certificate Authority by ID

ngrok.com/docs/api#api-certificate-authorities-update



62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/ngrokapi/models/certificate_authority.rb', line 62

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