Class: SSOReady::Organization
- Inherits:
-
Object
- Object
- SSOReady::Organization
- Defined in:
- lib/ssoready/types/organization.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#display_name ⇒ String
readonly
An optional human-friendly name for this organization.
-
#domains ⇒ Array<String>
readonly
A list of domains that users from this organization use.
-
#environment_id ⇒ String
readonly
The environment this organization belongs to.
-
#external_id ⇒ String
readonly
An identifier you can attach to an organization.
-
#id ⇒ String
readonly
Unique identifier for this organization.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ SSOReady::Organization
Deserialize a JSON object to an instance of Organization.
-
.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, environment_id: OMIT, display_name: OMIT, external_id: OMIT, domains: OMIT, additional_properties: nil) ⇒ SSOReady::Organization constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of Organization to a JSON object.
Constructor Details
#initialize(id: OMIT, environment_id: OMIT, display_name: OMIT, external_id: OMIT, domains: OMIT, additional_properties: nil) ⇒ SSOReady::Organization
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/ssoready/types/organization.rb', line 51 def initialize(id: OMIT, environment_id: OMIT, display_name: OMIT, external_id: OMIT, domains: OMIT, additional_properties: nil) @id = id if id != OMIT @environment_id = environment_id if environment_id != OMIT @display_name = display_name if display_name != OMIT @external_id = external_id if external_id != OMIT @domains = domains if domains != OMIT @additional_properties = additional_properties @_field_set = { "id": id, "environmentId": environment_id, "displayName": display_name, "externalId": external_id, "domains": domains }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
28 29 30 |
# File 'lib/ssoready/types/organization.rb', line 28 def additional_properties @additional_properties end |
#display_name ⇒ String (readonly)
Returns An optional human-friendly name for this organization.
13 14 15 |
# File 'lib/ssoready/types/organization.rb', line 13 def display_name @display_name end |
#domains ⇒ Array<String> (readonly)
Returns A list of domains that users from this organization use. SAML connections and SCIM directories within this organization will only produce users whose email are included in ‘domains`. SSOReady will reject SAML and SCIM users that do not fall within `domains`.
26 27 28 |
# File 'lib/ssoready/types/organization.rb', line 26 def domains @domains end |
#environment_id ⇒ String (readonly)
Returns The environment this organization belongs to.
11 12 13 |
# File 'lib/ssoready/types/organization.rb', line 11 def environment_id @environment_id end |
#external_id ⇒ String (readonly)
Returns An identifier you can attach to an organization. Meant to be used to correlate an SSOReady organization to your internal equivalent concept. External IDs are unique within an environment. No two organizations in the same environment can have the same external ID.
20 21 22 |
# File 'lib/ssoready/types/organization.rb', line 20 def external_id @external_id end |
#id ⇒ String (readonly)
Returns Unique identifier for this organization.
9 10 11 |
# File 'lib/ssoready/types/organization.rb', line 9 def id @id end |
Class Method Details
.from_json(json_object:) ⇒ SSOReady::Organization
Deserialize a JSON object to an instance of Organization
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/ssoready/types/organization.rb', line 74 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) id = parsed_json["id"] environment_id = parsed_json["environmentId"] display_name = parsed_json["displayName"] external_id = parsed_json["externalId"] domains = parsed_json["domains"] new( id: id, environment_id: environment_id, display_name: display_name, external_id: external_id, domains: domains, 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.
105 106 107 108 109 110 111 |
# File 'lib/ssoready/types/organization.rb', line 105 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.environment_id&.is_a?(String) != false || raise("Passed value for field obj.environment_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.external_id&.is_a?(String) != false || raise("Passed value for field obj.external_id is not the expected type, validation failed.") obj.domains&.is_a?(Array) != false || raise("Passed value for field obj.domains is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of Organization to a JSON object
95 96 97 |
# File 'lib/ssoready/types/organization.rb', line 95 def to_json(*_args) @_field_set&.to_json end |