Class: NgrokAPI::Models::SSHHostCertificate

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of SSHHostCertificate.



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/ngrokapi/models/ssh_host_certificate.rb', line 25

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']
  @public_key = @attrs['public_key']
  @key_type = @attrs['key_type']
  @ssh_certificate_authority_id = @attrs['ssh_certificate_authority_id']
  @principals = @attrs['principals']
  @valid_after = @attrs['valid_after']
  @valid_until = @attrs['valid_until']
  @certificate = @attrs['certificate']
end

Instance Attribute Details

#attrsObject (readonly)

Returns the value of attribute attrs.



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

def attrs
  @attrs
end

#certificateObject (readonly)

Returns the value of attribute certificate.



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

def certificate
  @certificate
end

#clientObject (readonly)

Returns the value of attribute client.



10
11
12
# File 'lib/ngrokapi/models/ssh_host_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/ssh_host_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/ssh_host_certificate.rb', line 10

def description
  @description
end

#idObject (readonly)

Returns the value of attribute id.



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

def id
  @id
end

#key_typeObject (readonly)

Returns the value of attribute key_type.



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

def key_type
  @key_type
end

#metadataObject (readonly)

Returns the value of attribute metadata.



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

def 
  @metadata
end

#principalsObject (readonly)

Returns the value of attribute principals.



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

def principals
  @principals
end

#public_keyObject (readonly)

Returns the value of attribute public_key.



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

def public_key
  @public_key
end

#ssh_certificate_authority_idObject (readonly)

Returns the value of attribute ssh_certificate_authority_id.



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

def ssh_certificate_authority_id
  @ssh_certificate_authority_id
end

#uriObject (readonly)

Returns the value of attribute uri.



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

def uri
  @uri
end

#valid_afterObject (readonly)

Returns the value of attribute valid_after.



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

def valid_after
  @valid_after
end

#valid_untilObject (readonly)

Returns the value of attribute valid_until.



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

def valid_until
  @valid_until
end

Instance Method Details

#==(other) ⇒ Object



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

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

#deleteObject



60
61
62
63
64
# File 'lib/ngrokapi/models/ssh_host_certificate.rb', line 60

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

#to_hObject



52
53
54
# File 'lib/ngrokapi/models/ssh_host_certificate.rb', line 52

def to_h
  @attrs.to_h
end

#to_sObject



48
49
50
# File 'lib/ngrokapi/models/ssh_host_certificate.rb', line 48

def to_s
  @attrs.to_s
end

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



70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/ngrokapi/models/ssh_host_certificate.rb', line 70

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