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.



7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
# File 'lib/models/porcelain.rb', line 7222

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.



7212
7213
7214
# File 'lib/models/porcelain.rb', line 7212

def description
  @description
end

#idObject

Unique identifier of the Group.



7214
7215
7216
# File 'lib/models/porcelain.rb', line 7214

def id
  @id
end

#nameObject

Unique human-readable name of the Group.



7216
7217
7218
# File 'lib/models/porcelain.rb', line 7216

def name
  @name
end

#sourceObject

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



7218
7219
7220
# File 'lib/models/porcelain.rb', line 7218

def source
  @source
end

#tagsObject

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



7220
7221
7222
# File 'lib/models/porcelain.rb', line 7220

def tags
  @tags
end

Instance Method Details

#to_json(options = {}) ⇒ Object



7236
7237
7238
7239
7240
7241
7242
# File 'lib/models/porcelain.rb', line 7236

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