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.



8109
8110
8111
8112
8113
8114
8115
8116
8117
8118
8119
8120
8121
# File 'lib/models/porcelain.rb', line 8109

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.



8099
8100
8101
# File 'lib/models/porcelain.rb', line 8099

def description
  @description
end

#idObject

Unique identifier of the Group.



8101
8102
8103
# File 'lib/models/porcelain.rb', line 8101

def id
  @id
end

#nameObject

Unique human-readable name of the Group.



8103
8104
8105
# File 'lib/models/porcelain.rb', line 8103

def name
  @name
end

#sourceObject

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



8105
8106
8107
# File 'lib/models/porcelain.rb', line 8105

def source
  @source
end

#tagsObject

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



8107
8108
8109
# File 'lib/models/porcelain.rb', line 8107

def tags
  @tags
end

Instance Method Details

#to_json(options = {}) ⇒ Object



8123
8124
8125
8126
8127
8128
8129
# File 'lib/models/porcelain.rb', line 8123

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