Class: SSOReady::ListSCIMUsersResponse

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

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(scim_users: OMIT, next_page_token: OMIT, additional_properties: nil) ⇒ SSOReady::ListSCIMUsersResponse

Parameters:

  • scim_users (Array<SSOReady::SCIMUser>) (defaults to: OMIT)

    List of SCIM users.

  • next_page_token (String) (defaults to: OMIT)

    Value to use as ‘pageToken` for the next page of data. Empty if there is no more data.

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



27
28
29
30
31
32
33
34
# File 'lib/ssoready/types/list_scim_users_response.rb', line 27

def initialize(scim_users: OMIT, next_page_token: OMIT, additional_properties: nil)
  @scim_users = scim_users if scim_users != OMIT
  @next_page_token = next_page_token if next_page_token != OMIT
  @additional_properties = additional_properties
  @_field_set = { "scimUsers": scim_users, "nextPageToken": next_page_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



15
16
17
# File 'lib/ssoready/types/list_scim_users_response.rb', line 15

def additional_properties
  @additional_properties
end

#next_page_tokenString (readonly)

Returns Value to use as ‘pageToken` for the next page of data. Empty if there is no more data.

Returns:

  • (String)

    Value to use as ‘pageToken` for the next page of data. Empty if there is no more data.



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

def next_page_token
  @next_page_token
end

#scim_usersArray<SSOReady::SCIMUser> (readonly)

Returns List of SCIM users.

Returns:



10
11
12
# File 'lib/ssoready/types/list_scim_users_response.rb', line 10

def scim_users
  @scim_users
end

Class Method Details

.from_json(json_object:) ⇒ SSOReady::ListSCIMUsersResponse

Deserialize a JSON object to an instance of ListSCIMUsersResponse

Parameters:

  • json_object (String)

Returns:



40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/ssoready/types/list_scim_users_response.rb', line 40

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  scim_users = parsed_json["scimUsers"]&.map do |item|
    item = item.to_json
    SSOReady::SCIMUser.from_json(json_object: item)
  end
  next_page_token = parsed_json["nextPageToken"]
  new(
    scim_users: scim_users,
    next_page_token: next_page_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)


68
69
70
71
# File 'lib/ssoready/types/list_scim_users_response.rb', line 68

def self.validate_raw(obj:)
  obj.scim_users&.is_a?(Array) != false || raise("Passed value for field obj.scim_users is not the expected type, validation failed.")
  obj.next_page_token&.is_a?(String) != false || raise("Passed value for field obj.next_page_token is not the expected type, validation failed.")
end

Instance Method Details

#to_json(*_args) ⇒ String

Serialize an instance of ListSCIMUsersResponse to a JSON object

Returns:

  • (String)


58
59
60
# File 'lib/ssoready/types/list_scim_users_response.rb', line 58

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