Class: NgrokAPI::Models::Secret

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of Secret.



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/ngrokapi/models/secret.rb', line 23

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']
  @updated_at = @attrs['updated_at']
  @name = @attrs['name']
  @description = @attrs['description']
  @metadata = @attrs['metadata']
  @created_by = @attrs['created_by']
  @last_updated_by = @attrs['last_updated_by']
  @vault = @attrs['vault']
end

Instance Attribute Details

#attrsObject (readonly)

Returns the value of attribute attrs.



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

def attrs
  @attrs
end

#clientObject (readonly)

Returns the value of attribute client.



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

def client
  @client
end

#created_atObject (readonly)

Returns the value of attribute created_at.



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

def created_at
  @created_at
end

#created_byObject (readonly)

Returns the value of attribute created_by.



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

def created_by
  @created_by
end

#descriptionObject (readonly)

Returns the value of attribute description.



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

def description
  @description
end

#idObject (readonly)

Returns the value of attribute id.



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

def id
  @id
end

#last_updated_byObject (readonly)

Returns the value of attribute last_updated_by.



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

def last_updated_by
  @last_updated_by
end

#metadataObject (readonly)

Returns the value of attribute metadata.



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

def 
  @metadata
end

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

#updated_atObject (readonly)

Returns the value of attribute updated_at.



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

def updated_at
  @updated_at
end

#uriObject (readonly)

Returns the value of attribute uri.



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

def uri
  @uri
end

#vaultObject (readonly)

Returns the value of attribute vault.



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

def vault
  @vault
end

Instance Method Details

#==(other) ⇒ Object



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

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

#deleteObject



56
57
58
59
60
# File 'lib/ngrokapi/models/secret.rb', line 56

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

#to_hObject



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

def to_h
  @attrs.to_h
end

#to_sObject



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

def to_s
  @attrs.to_s
end