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.



7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
# File 'lib/models/porcelain.rb', line 7131

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.



7121
7122
7123
# File 'lib/models/porcelain.rb', line 7121

def description
  @description
end

#idObject

Unique identifier of the Group.



7123
7124
7125
# File 'lib/models/porcelain.rb', line 7123

def id
  @id
end

#nameObject

Unique human-readable name of the Group.



7125
7126
7127
# File 'lib/models/porcelain.rb', line 7125

def name
  @name
end

#sourceObject

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



7127
7128
7129
# File 'lib/models/porcelain.rb', line 7127

def source
  @source
end

#tagsObject

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



7129
7130
7131
# File 'lib/models/porcelain.rb', line 7129

def tags
  @tags
end

Instance Method Details

#to_json(options = {}) ⇒ Object



7145
7146
7147
7148
7149
7150
7151
# File 'lib/models/porcelain.rb', line 7145

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