Class: SSOReady::Organization

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

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id: OMIT, environment_id: OMIT, display_name: OMIT, external_id: OMIT, domains: OMIT, additional_properties: nil) ⇒ SSOReady::Organization

Parameters:

  • id (String) (defaults to: OMIT)

    Unique identifier for this organization.

  • environment_id (String) (defaults to: OMIT)

    The environment this organization belongs to.

  • display_name (String) (defaults to: OMIT)

    An optional human-friendly name for this organization.

  • external_id (String) (defaults to: OMIT)

    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.

  • domains (Array<String>) (defaults to: OMIT)

    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`.

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



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_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    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_nameString (readonly)

Returns An optional human-friendly name for this organization.

Returns:

  • (String)

    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

#domainsArray<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`.

Returns:

  • (Array<String>)

    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_idString (readonly)

Returns The environment this organization belongs to.

Returns:

  • (String)

    The environment this organization belongs to.



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

def environment_id
  @environment_id
end

#external_idString (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.

Returns:

  • (String)

    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

#idString (readonly)

Returns Unique identifier for this organization.

Returns:

  • (String)

    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

Parameters:

  • json_object (String)

Returns:



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.

Parameters:

  • obj (Object)

Returns:

  • (Void)


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

Returns:

  • (String)


95
96
97
# File 'lib/ssoready/types/organization.rb', line 95

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