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:, result:) ⇒ 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:, result:)
  @client = client
  @result = result
  @id = @result['id']
  @uri = @result['uri']
  @created_at = @result['created_at']
  @description = @result['description']
  @metadata = @result['metadata']
  @ca_pem = @result['ca_pem']
  @subject_common_name = @result['subject_common_name']
  @not_before = @result['not_before']
  @not_after = @result['not_after']
  @key_usages = @result['key_usages']
  @extended_key_usages = @result['extended_key_usages']
end

Instance Attribute Details

#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

#resultObject (readonly)

Returns the value of attribute result.



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

def result
  @result
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)
  @result == other.result
end

#deleteObject



48
49
50
51
52
# File 'lib/ngrokapi/models/certificate_authority.rb', line 48

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

#to_sObject



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

def to_s
  @result.to_s
end

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

Update attributes of a Certificate Authority by ID

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



58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/ngrokapi/models/certificate_authority.rb', line 58

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