Class: SSOReady::SCIMDirectory

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

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id: OMIT, organization_id: OMIT, primary: OMIT, scim_base_url: OMIT, has_client_bearer_token: OMIT, additional_properties: nil) ⇒ SSOReady::SCIMDirectory

Parameters:

  • id (String) (defaults to: OMIT)

    Unique identifier for this SCIM directory.

  • organization_id (String) (defaults to: OMIT)

    The organization this SCIM directory belongs to.

  • primary (Boolean) (defaults to: OMIT)

    Whether this is the primary SCIM directory for the organization.

  • scim_base_url (String) (defaults to: OMIT)

    Base URL the Identity Provider uses to perform SCIM HTTP requests. SCIM base URLs are assigned by SSOReady, and need to be inputted into your customer’s Identity Provider.

  • has_client_bearer_token (Boolean) (defaults to: OMIT)

    Whether this SCIM directory has a bearer token assigned. SSOReady only stores a hash of the bearer token. To get a bearer token value, you must rotate this SCIM directory’s bearer token.

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/ssoready/types/scim_directory.rb', line 43

def initialize(id: OMIT, organization_id: OMIT, primary: OMIT, scim_base_url: OMIT, has_client_bearer_token: OMIT,
               additional_properties: nil)
  @id = id if id != OMIT
  @organization_id = organization_id if organization_id != OMIT
  @primary = primary if primary != OMIT
  @scim_base_url = scim_base_url if scim_base_url != OMIT
  @has_client_bearer_token = has_client_bearer_token if has_client_bearer_token != OMIT
  @additional_properties = additional_properties
  @_field_set = {
    "id": id,
    "organizationId": organization_id,
    "primary": primary,
    "scimBaseUrl": scim_base_url,
    "hasClientBearerToken": has_client_bearer_token
  }.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



24
25
26
# File 'lib/ssoready/types/scim_directory.rb', line 24

def additional_properties
  @additional_properties
end

#has_client_bearer_tokenBoolean (readonly)

Returns Whether this SCIM directory has a bearer token assigned. SSOReady only stores a hash of the bearer token. To get a bearer token value, you must rotate this SCIM directory’s bearer token.

Returns:

  • (Boolean)

    Whether this SCIM directory has a bearer token assigned. SSOReady only stores a hash of the bearer token. To get a bearer token value, you must rotate this SCIM directory’s bearer token.



22
23
24
# File 'lib/ssoready/types/scim_directory.rb', line 22

def has_client_bearer_token
  @has_client_bearer_token
end

#idString (readonly)

Returns Unique identifier for this SCIM directory.

Returns:

  • (String)

    Unique identifier for this SCIM directory.



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

def id
  @id
end

#organization_idString (readonly)

Returns The organization this SCIM directory belongs to.

Returns:

  • (String)

    The organization this SCIM directory belongs to.



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

def organization_id
  @organization_id
end

#primaryBoolean (readonly)

Returns Whether this is the primary SCIM directory for the organization.

Returns:

  • (Boolean)

    Whether this is the primary SCIM directory for the organization.



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

def primary
  @primary
end

#scim_base_urlString (readonly)

Returns Base URL the Identity Provider uses to perform SCIM HTTP requests. SCIM base URLs are assigned by SSOReady, and need to be inputted into your customer’s Identity Provider.

Returns:

  • (String)

    Base URL the Identity Provider uses to perform SCIM HTTP requests. SCIM base URLs are assigned by SSOReady, and need to be inputted into your customer’s Identity Provider.



17
18
19
# File 'lib/ssoready/types/scim_directory.rb', line 17

def scim_base_url
  @scim_base_url
end

Class Method Details

.from_json(json_object:) ⇒ SSOReady::SCIMDirectory

Deserialize a JSON object to an instance of SCIMDirectory

Parameters:

  • json_object (String)

Returns:



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/ssoready/types/scim_directory.rb', line 66

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  id = parsed_json["id"]
  organization_id = parsed_json["organizationId"]
  primary = parsed_json["primary"]
  scim_base_url = parsed_json["scimBaseUrl"]
  has_client_bearer_token = parsed_json["hasClientBearerToken"]
  new(
    id: id,
    organization_id: organization_id,
    primary: primary,
    scim_base_url: scim_base_url,
    has_client_bearer_token: has_client_bearer_token,
    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)


97
98
99
100
101
102
103
# File 'lib/ssoready/types/scim_directory.rb', line 97

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.organization_id&.is_a?(String) != false || raise("Passed value for field obj.organization_id is not the expected type, validation failed.")
  obj.primary&.is_a?(Boolean) != false || raise("Passed value for field obj.primary is not the expected type, validation failed.")
  obj.scim_base_url&.is_a?(String) != false || raise("Passed value for field obj.scim_base_url is not the expected type, validation failed.")
  obj.has_client_bearer_token&.is_a?(Boolean) != false || raise("Passed value for field obj.has_client_bearer_token is not the expected type, validation failed.")
end

Instance Method Details

#to_json(*_args) ⇒ String

Serialize an instance of SCIMDirectory to a JSON object

Returns:

  • (String)


87
88
89
# File 'lib/ssoready/types/scim_directory.rb', line 87

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