Class: SSOReady::SCIMGroup

Inherits:
Object
  • Object
show all
Defined in:
lib/ssoready/types/scim_group.rb

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id: OMIT, scim_directory_id: OMIT, display_name: OMIT, deleted: OMIT, attributes: OMIT, additional_properties: nil) ⇒ SSOReady::SCIMGroup

Parameters:

  • id (String) (defaults to: OMIT)

    Unique identifier for this SCIM group.

  • scim_directory_id (String) (defaults to: OMIT)

    SCIM directory this SCIM group belongs to.

  • display_name (String) (defaults to: OMIT)

    A human-friendly name for the SCIM group.

  • deleted (Boolean) (defaults to: OMIT)

    Whether the SCIM group has been deleted or deprovisioned from its SCIM directory. Identity Providers are inconsistent about reliably deleting SCIM groups. Many Identity Providers will deprovision the users inside a group, but not the group itself. For this reason, it’s typical to ignore this field until a specific need arises.

  • attributes (Hash{String => Object}) (defaults to: OMIT)

    Arbitrary, potentially nested, attributes the Identity Provider included about the group. Identity Providers are inconsistent about supporting sending custom attributes on groups. For this reason, it’s typical to not rely on them until a specific need arises.

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/ssoready/types/scim_group.rb', line 53

def initialize(id: OMIT, scim_directory_id: OMIT, display_name: OMIT, deleted: OMIT, attributes: OMIT,
               additional_properties: nil)
  @id = id if id != OMIT
  @scim_directory_id = scim_directory_id if scim_directory_id != OMIT
  @display_name = display_name if display_name != OMIT
  @deleted = deleted if deleted != OMIT
  @attributes = attributes if attributes != OMIT
  @additional_properties = additional_properties
  @_field_set = {
    "id": id,
    "scimDirectoryId": scim_directory_id,
    "displayName": display_name,
    "deleted": deleted,
    "attributes": attributes
  }.reject do |_k, v|
    v == OMIT
  end
end

Instance Attribute Details

#additional_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    Additional properties unmapped to the current class definition



29
30
31
# File 'lib/ssoready/types/scim_group.rb', line 29

def additional_properties
  @additional_properties
end

#attributesHash{String => Object} (readonly)

Returns Arbitrary, potentially nested, attributes the Identity Provider included about the group. Identity Providers are inconsistent about supporting sending custom attributes on groups. For this reason, it’s typical to not rely on them until a specific need arises.

Returns:

  • (Hash{String => Object})

    Arbitrary, potentially nested, attributes the Identity Provider included about the group. Identity Providers are inconsistent about supporting sending custom attributes on groups. For this reason, it’s typical to not rely on them until a specific need arises.



27
28
29
# File 'lib/ssoready/types/scim_group.rb', line 27

def attributes
  @attributes
end

#deletedBoolean (readonly)

Returns Whether the SCIM group has been deleted or deprovisioned from its SCIM directory. Identity Providers are inconsistent about reliably deleting SCIM groups. Many Identity Providers will deprovision the users inside a group, but not the group itself. For this reason, it’s typical to ignore this field until a specific need arises.

Returns:

  • (Boolean)

    Whether the SCIM group has been deleted or deprovisioned from its SCIM directory. Identity Providers are inconsistent about reliably deleting SCIM groups. Many Identity Providers will deprovision the users inside a group, but not the group itself. For this reason, it’s typical to ignore this field until a specific need arises.



21
22
23
# File 'lib/ssoready/types/scim_group.rb', line 21

def deleted
  @deleted
end

#display_nameString (readonly)

Returns A human-friendly name for the SCIM group.

Returns:

  • (String)

    A human-friendly name for the SCIM group.



13
14
15
# File 'lib/ssoready/types/scim_group.rb', line 13

def display_name
  @display_name
end

#idString (readonly)

Returns Unique identifier for this SCIM group.

Returns:

  • (String)

    Unique identifier for this SCIM group.



9
10
11
# File 'lib/ssoready/types/scim_group.rb', line 9

def id
  @id
end

#scim_directory_idString (readonly)

Returns SCIM directory this SCIM group belongs to.

Returns:

  • (String)

    SCIM directory this SCIM group belongs to.



11
12
13
# File 'lib/ssoready/types/scim_group.rb', line 11

def scim_directory_id
  @scim_directory_id
end

Class Method Details

.from_json(json_object:) ⇒ SSOReady::SCIMGroup

Deserialize a JSON object to an instance of SCIMGroup

Parameters:

  • json_object (String)

Returns:



76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'lib/ssoready/types/scim_group.rb', line 76

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  id = parsed_json["id"]
  scim_directory_id = parsed_json["scimDirectoryId"]
  display_name = parsed_json["displayName"]
  deleted = parsed_json["deleted"]
  attributes = parsed_json["attributes"]
  new(
    id: id,
    scim_directory_id: scim_directory_id,
    display_name: display_name,
    deleted: deleted,
    attributes: attributes,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Leveraged for Union-type generation, validate_raw attempts to parse the given

hash and check each fields type against the current object's property
definitions.

Parameters:

  • obj (Object)

Returns:

  • (Void)


107
108
109
110
111
112
113
# File 'lib/ssoready/types/scim_group.rb', line 107

def self.validate_raw(obj:)
  obj.id&.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
  obj.scim_directory_id&.is_a?(String) != false || raise("Passed value for field obj.scim_directory_id is not the expected type, validation failed.")
  obj.display_name&.is_a?(String) != false || raise("Passed value for field obj.display_name is not the expected type, validation failed.")
  obj.deleted&.is_a?(Boolean) != false || raise("Passed value for field obj.deleted is not the expected type, validation failed.")
  obj.attributes&.is_a?(Hash) != false || raise("Passed value for field obj.attributes is not the expected type, validation failed.")
end

Instance Method Details

#to_json(*_args) ⇒ String

Serialize an instance of SCIMGroup to a JSON object

Returns:

  • (String)


97
98
99
# File 'lib/ssoready/types/scim_group.rb', line 97

def to_json(*_args)
  @_field_set&.to_json
end