Class: SSOReady::SCIMGroup
- Inherits:
-
Object
- Object
- SSOReady::SCIMGroup
- Defined in:
- lib/ssoready/types/scim_group.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#attributes ⇒ Hash{String => Object}
readonly
Arbitrary, potentially nested, attributes the Identity Provider included about the group.
-
#deleted ⇒ Boolean
readonly
Whether the SCIM group has been deleted or deprovisioned from its SCIM directory.
-
#display_name ⇒ String
readonly
A human-friendly name for the SCIM group.
-
#id ⇒ String
readonly
Unique identifier for this SCIM group.
-
#scim_directory_id ⇒ String
readonly
SCIM directory this SCIM group belongs to.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ SSOReady::SCIMGroup
Deserialize a JSON object to an instance of SCIMGroup.
-
.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.
Instance Method Summary collapse
- #initialize(id: OMIT, scim_directory_id: OMIT, display_name: OMIT, deleted: OMIT, attributes: OMIT, additional_properties: nil) ⇒ SSOReady::SCIMGroup constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of SCIMGroup to a JSON object.
Constructor Details
#initialize(id: OMIT, scim_directory_id: OMIT, display_name: OMIT, deleted: OMIT, attributes: OMIT, additional_properties: nil) ⇒ SSOReady::SCIMGroup
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_properties ⇒ OpenStruct (readonly)
Returns 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 |
#attributes ⇒ Hash{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.
27 28 29 |
# File 'lib/ssoready/types/scim_group.rb', line 27 def attributes @attributes end |
#deleted ⇒ Boolean (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.
21 22 23 |
# File 'lib/ssoready/types/scim_group.rb', line 21 def deleted @deleted end |
#display_name ⇒ String (readonly)
Returns 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 |
#id ⇒ String (readonly)
Returns Unique identifier for this SCIM group.
9 10 11 |
# File 'lib/ssoready/types/scim_group.rb', line 9 def id @id end |
#scim_directory_id ⇒ String (readonly)
Returns 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
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.
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
97 98 99 |
# File 'lib/ssoready/types/scim_group.rb', line 97 def to_json(*_args) @_field_set&.to_json end |