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.



8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
8042
8043
8044
# File 'lib/models/porcelain.rb', line 8032

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.



8022
8023
8024
# File 'lib/models/porcelain.rb', line 8022

def description
  @description
end

#idObject

Unique identifier of the Group.



8024
8025
8026
# File 'lib/models/porcelain.rb', line 8024

def id
  @id
end

#nameObject

Unique human-readable name of the Group.



8026
8027
8028
# File 'lib/models/porcelain.rb', line 8026

def name
  @name
end

#sourceObject

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



8028
8029
8030
# File 'lib/models/porcelain.rb', line 8028

def source
  @source
end

#tagsObject

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



8030
8031
8032
# File 'lib/models/porcelain.rb', line 8030

def tags
  @tags
end

Instance Method Details

#to_json(options = {}) ⇒ Object



8046
8047
8048
8049
8050
8051
8052
# File 'lib/models/porcelain.rb', line 8046

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