Class: SDM::Group

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

Overview

A Group is a named set of principals.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(description: nil, id: nil, name: nil, source: nil, tags: nil) ⇒ Group

Returns a new instance of Group.



7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
# File 'lib/models/porcelain.rb', line 7746

def initialize(
  description: nil,
  id: nil,
  name: nil,
  source: nil,
  tags: nil
)
  @description = description == nil ? "" : description
  @id = id == nil ? "" : id
  @name = name == nil ? "" : name
  @source = source == nil ? "" : source
  @tags = tags == nil ? SDM::_porcelain_zero_value_tags() : tags
end

Instance Attribute Details

#descriptionObject

Description of the Group.



7736
7737
7738
# File 'lib/models/porcelain.rb', line 7736

def description
  @description
end

#idObject

Unique identifier of the Group.



7738
7739
7740
# File 'lib/models/porcelain.rb', line 7738

def id
  @id
end

#nameObject

Unique human-readable name of the Group.



7740
7741
7742
# File 'lib/models/porcelain.rb', line 7740

def name
  @name
end

#sourceObject

Source is a read only field for what service manages this group, e.g. StrongDM, Okta, Azure.



7742
7743
7744
# File 'lib/models/porcelain.rb', line 7742

def source
  @source
end

#tagsObject

Tags is a map of key/value pairs that can be attached to a Group.



7744
7745
7746
# File 'lib/models/porcelain.rb', line 7744

def tags
  @tags
end

Instance Method Details

#to_json(options = {}) ⇒ Object



7760
7761
7762
7763
7764
7765
7766
# File 'lib/models/porcelain.rb', line 7760

def to_json(options = {})
  hash = {}
  self.instance_variables.each do |var|
    hash[var.id2name.delete_prefix("@")] = self.instance_variable_get var
  end
  hash.to_json
end