ssoready 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/lib/environment.rb +7 -0
- data/lib/gemconfig.rb +14 -0
- data/lib/requests.rb +159 -0
- data/lib/ssoready/management/client.rb +51 -0
- data/lib/ssoready/management/organizations/client.rb +247 -0
- data/lib/ssoready/management/saml_connections/client.rb +269 -0
- data/lib/ssoready/management/scim_directories/client.rb +330 -0
- data/lib/ssoready/management/setup_urls/client.rb +97 -0
- data/lib/ssoready/saml/client.rb +170 -0
- data/lib/ssoready/scim/client.rb +296 -0
- data/lib/ssoready/types/create_organization_response.rb +63 -0
- data/lib/ssoready/types/create_saml_connection_response.rb +63 -0
- data/lib/ssoready/types/create_scim_directory_response.rb +63 -0
- data/lib/ssoready/types/create_setup_url_response.rb +62 -0
- data/lib/ssoready/types/get_organization_response.rb +63 -0
- data/lib/ssoready/types/get_saml_connection_response.rb +63 -0
- data/lib/ssoready/types/get_saml_redirect_url_response.rb +56 -0
- data/lib/ssoready/types/get_scim_directory_response.rb +63 -0
- data/lib/ssoready/types/get_scim_group_response.rb +63 -0
- data/lib/ssoready/types/get_scim_user_response.rb +63 -0
- data/lib/ssoready/types/google_protobuf_any.rb +58 -0
- data/lib/ssoready/types/list_organizations_response.rb +73 -0
- data/lib/ssoready/types/list_saml_connections_response.rb +73 -0
- data/lib/ssoready/types/list_scim_directories_response.rb +73 -0
- data/lib/ssoready/types/list_scim_groups_response.rb +73 -0
- data/lib/ssoready/types/list_scim_users_response.rb +73 -0
- data/lib/ssoready/types/organization.rb +112 -0
- data/lib/ssoready/types/redeem_saml_access_code_response.rb +126 -0
- data/lib/ssoready/types/rotate_scim_directory_bearer_token_response.rb +63 -0
- data/lib/ssoready/types/saml_connection.rb +144 -0
- data/lib/ssoready/types/scim_directory.rb +104 -0
- data/lib/ssoready/types/scim_group.rb +114 -0
- data/lib/ssoready/types/scim_user.rb +102 -0
- data/lib/ssoready/types/status.rb +94 -0
- data/lib/ssoready/types/update_organization_response.rb +63 -0
- data/lib/ssoready/types/update_saml_connection_response.rb +63 -0
- data/lib/ssoready/types/update_scim_directory_response.rb +63 -0
- data/lib/ssoready.rb +68 -0
- data/lib/types_export.rb +29 -0
- metadata +163 -0
@@ -0,0 +1,63 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "saml_connection"
|
4
|
+
require "ostruct"
|
5
|
+
require "json"
|
6
|
+
|
7
|
+
module SSOReady
|
8
|
+
class CreateSAMLConnectionResponse
|
9
|
+
# @return [SSOReady::SAMLConnection] The created SAML connection.
|
10
|
+
attr_reader :saml_connection
|
11
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
12
|
+
attr_reader :additional_properties
|
13
|
+
# @return [Object]
|
14
|
+
attr_reader :_field_set
|
15
|
+
protected :_field_set
|
16
|
+
|
17
|
+
OMIT = Object.new
|
18
|
+
|
19
|
+
# @param saml_connection [SSOReady::SAMLConnection] The created SAML connection.
|
20
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
21
|
+
# @return [SSOReady::CreateSAMLConnectionResponse]
|
22
|
+
def initialize(saml_connection: OMIT, additional_properties: nil)
|
23
|
+
@saml_connection = saml_connection if saml_connection != OMIT
|
24
|
+
@additional_properties = additional_properties
|
25
|
+
@_field_set = { "samlConnection": saml_connection }.reject do |_k, v|
|
26
|
+
v == OMIT
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
# Deserialize a JSON object to an instance of CreateSAMLConnectionResponse
|
31
|
+
#
|
32
|
+
# @param json_object [String]
|
33
|
+
# @return [SSOReady::CreateSAMLConnectionResponse]
|
34
|
+
def self.from_json(json_object:)
|
35
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
36
|
+
parsed_json = JSON.parse(json_object)
|
37
|
+
if parsed_json["samlConnection"].nil?
|
38
|
+
saml_connection = nil
|
39
|
+
else
|
40
|
+
saml_connection = parsed_json["samlConnection"].to_json
|
41
|
+
saml_connection = SSOReady::SAMLConnection.from_json(json_object: saml_connection)
|
42
|
+
end
|
43
|
+
new(saml_connection: saml_connection, additional_properties: struct)
|
44
|
+
end
|
45
|
+
|
46
|
+
# Serialize an instance of CreateSAMLConnectionResponse to a JSON object
|
47
|
+
#
|
48
|
+
# @return [String]
|
49
|
+
def to_json(*_args)
|
50
|
+
@_field_set&.to_json
|
51
|
+
end
|
52
|
+
|
53
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
54
|
+
# hash and check each fields type against the current object's property
|
55
|
+
# definitions.
|
56
|
+
#
|
57
|
+
# @param obj [Object]
|
58
|
+
# @return [Void]
|
59
|
+
def self.validate_raw(obj:)
|
60
|
+
obj.saml_connection.nil? || SSOReady::SAMLConnection.validate_raw(obj: obj.saml_connection)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "scim_directory"
|
4
|
+
require "ostruct"
|
5
|
+
require "json"
|
6
|
+
|
7
|
+
module SSOReady
|
8
|
+
class CreateSCIMDirectoryResponse
|
9
|
+
# @return [SSOReady::SCIMDirectory] The updated SCIM directory.
|
10
|
+
attr_reader :scim_directory
|
11
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
12
|
+
attr_reader :additional_properties
|
13
|
+
# @return [Object]
|
14
|
+
attr_reader :_field_set
|
15
|
+
protected :_field_set
|
16
|
+
|
17
|
+
OMIT = Object.new
|
18
|
+
|
19
|
+
# @param scim_directory [SSOReady::SCIMDirectory] The updated SCIM directory.
|
20
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
21
|
+
# @return [SSOReady::CreateSCIMDirectoryResponse]
|
22
|
+
def initialize(scim_directory: OMIT, additional_properties: nil)
|
23
|
+
@scim_directory = scim_directory if scim_directory != OMIT
|
24
|
+
@additional_properties = additional_properties
|
25
|
+
@_field_set = { "scimDirectory": scim_directory }.reject do |_k, v|
|
26
|
+
v == OMIT
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
# Deserialize a JSON object to an instance of CreateSCIMDirectoryResponse
|
31
|
+
#
|
32
|
+
# @param json_object [String]
|
33
|
+
# @return [SSOReady::CreateSCIMDirectoryResponse]
|
34
|
+
def self.from_json(json_object:)
|
35
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
36
|
+
parsed_json = JSON.parse(json_object)
|
37
|
+
if parsed_json["scimDirectory"].nil?
|
38
|
+
scim_directory = nil
|
39
|
+
else
|
40
|
+
scim_directory = parsed_json["scimDirectory"].to_json
|
41
|
+
scim_directory = SSOReady::SCIMDirectory.from_json(json_object: scim_directory)
|
42
|
+
end
|
43
|
+
new(scim_directory: scim_directory, additional_properties: struct)
|
44
|
+
end
|
45
|
+
|
46
|
+
# Serialize an instance of CreateSCIMDirectoryResponse to a JSON object
|
47
|
+
#
|
48
|
+
# @return [String]
|
49
|
+
def to_json(*_args)
|
50
|
+
@_field_set&.to_json
|
51
|
+
end
|
52
|
+
|
53
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
54
|
+
# hash and check each fields type against the current object's property
|
55
|
+
# definitions.
|
56
|
+
#
|
57
|
+
# @param obj [Object]
|
58
|
+
# @return [Void]
|
59
|
+
def self.validate_raw(obj:)
|
60
|
+
obj.scim_directory.nil? || SSOReady::SCIMDirectory.validate_raw(obj: obj.scim_directory)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
@@ -0,0 +1,62 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "ostruct"
|
4
|
+
require "json"
|
5
|
+
|
6
|
+
module SSOReady
|
7
|
+
class CreateSetupURLResponse
|
8
|
+
# @return [String] The one-time, short-lived self-serve setup URL.
|
9
|
+
# Do not log or store this URL. Because this URL is one-time, loading it yourself
|
10
|
+
# means your customer will not be
|
11
|
+
# able to load it after you.
|
12
|
+
attr_reader :url
|
13
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
14
|
+
attr_reader :additional_properties
|
15
|
+
# @return [Object]
|
16
|
+
attr_reader :_field_set
|
17
|
+
protected :_field_set
|
18
|
+
|
19
|
+
OMIT = Object.new
|
20
|
+
|
21
|
+
# @param url [String] The one-time, short-lived self-serve setup URL.
|
22
|
+
# Do not log or store this URL. Because this URL is one-time, loading it yourself
|
23
|
+
# means your customer will not be
|
24
|
+
# able to load it after you.
|
25
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
26
|
+
# @return [SSOReady::CreateSetupURLResponse]
|
27
|
+
def initialize(url: OMIT, additional_properties: nil)
|
28
|
+
@url = url if url != OMIT
|
29
|
+
@additional_properties = additional_properties
|
30
|
+
@_field_set = { "url": url }.reject do |_k, v|
|
31
|
+
v == OMIT
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
# Deserialize a JSON object to an instance of CreateSetupURLResponse
|
36
|
+
#
|
37
|
+
# @param json_object [String]
|
38
|
+
# @return [SSOReady::CreateSetupURLResponse]
|
39
|
+
def self.from_json(json_object:)
|
40
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
41
|
+
url = struct["url"]
|
42
|
+
new(url: url, additional_properties: struct)
|
43
|
+
end
|
44
|
+
|
45
|
+
# Serialize an instance of CreateSetupURLResponse to a JSON object
|
46
|
+
#
|
47
|
+
# @return [String]
|
48
|
+
def to_json(*_args)
|
49
|
+
@_field_set&.to_json
|
50
|
+
end
|
51
|
+
|
52
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
53
|
+
# hash and check each fields type against the current object's property
|
54
|
+
# definitions.
|
55
|
+
#
|
56
|
+
# @param obj [Object]
|
57
|
+
# @return [Void]
|
58
|
+
def self.validate_raw(obj:)
|
59
|
+
obj.url&.is_a?(String) != false || raise("Passed value for field obj.url is not the expected type, validation failed.")
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "organization"
|
4
|
+
require "ostruct"
|
5
|
+
require "json"
|
6
|
+
|
7
|
+
module SSOReady
|
8
|
+
class GetOrganizationResponse
|
9
|
+
# @return [SSOReady::Organization] The requested organization.
|
10
|
+
attr_reader :organization
|
11
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
12
|
+
attr_reader :additional_properties
|
13
|
+
# @return [Object]
|
14
|
+
attr_reader :_field_set
|
15
|
+
protected :_field_set
|
16
|
+
|
17
|
+
OMIT = Object.new
|
18
|
+
|
19
|
+
# @param organization [SSOReady::Organization] The requested organization.
|
20
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
21
|
+
# @return [SSOReady::GetOrganizationResponse]
|
22
|
+
def initialize(organization: OMIT, additional_properties: nil)
|
23
|
+
@organization = organization if organization != OMIT
|
24
|
+
@additional_properties = additional_properties
|
25
|
+
@_field_set = { "organization": organization }.reject do |_k, v|
|
26
|
+
v == OMIT
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
# Deserialize a JSON object to an instance of GetOrganizationResponse
|
31
|
+
#
|
32
|
+
# @param json_object [String]
|
33
|
+
# @return [SSOReady::GetOrganizationResponse]
|
34
|
+
def self.from_json(json_object:)
|
35
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
36
|
+
parsed_json = JSON.parse(json_object)
|
37
|
+
if parsed_json["organization"].nil?
|
38
|
+
organization = nil
|
39
|
+
else
|
40
|
+
organization = parsed_json["organization"].to_json
|
41
|
+
organization = SSOReady::Organization.from_json(json_object: organization)
|
42
|
+
end
|
43
|
+
new(organization: organization, additional_properties: struct)
|
44
|
+
end
|
45
|
+
|
46
|
+
# Serialize an instance of GetOrganizationResponse to a JSON object
|
47
|
+
#
|
48
|
+
# @return [String]
|
49
|
+
def to_json(*_args)
|
50
|
+
@_field_set&.to_json
|
51
|
+
end
|
52
|
+
|
53
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
54
|
+
# hash and check each fields type against the current object's property
|
55
|
+
# definitions.
|
56
|
+
#
|
57
|
+
# @param obj [Object]
|
58
|
+
# @return [Void]
|
59
|
+
def self.validate_raw(obj:)
|
60
|
+
obj.organization.nil? || SSOReady::Organization.validate_raw(obj: obj.organization)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "saml_connection"
|
4
|
+
require "ostruct"
|
5
|
+
require "json"
|
6
|
+
|
7
|
+
module SSOReady
|
8
|
+
class GetSAMLConnectionResponse
|
9
|
+
# @return [SSOReady::SAMLConnection] The requested SAML connection.
|
10
|
+
attr_reader :saml_connection
|
11
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
12
|
+
attr_reader :additional_properties
|
13
|
+
# @return [Object]
|
14
|
+
attr_reader :_field_set
|
15
|
+
protected :_field_set
|
16
|
+
|
17
|
+
OMIT = Object.new
|
18
|
+
|
19
|
+
# @param saml_connection [SSOReady::SAMLConnection] The requested SAML connection.
|
20
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
21
|
+
# @return [SSOReady::GetSAMLConnectionResponse]
|
22
|
+
def initialize(saml_connection: OMIT, additional_properties: nil)
|
23
|
+
@saml_connection = saml_connection if saml_connection != OMIT
|
24
|
+
@additional_properties = additional_properties
|
25
|
+
@_field_set = { "samlConnection": saml_connection }.reject do |_k, v|
|
26
|
+
v == OMIT
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
# Deserialize a JSON object to an instance of GetSAMLConnectionResponse
|
31
|
+
#
|
32
|
+
# @param json_object [String]
|
33
|
+
# @return [SSOReady::GetSAMLConnectionResponse]
|
34
|
+
def self.from_json(json_object:)
|
35
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
36
|
+
parsed_json = JSON.parse(json_object)
|
37
|
+
if parsed_json["samlConnection"].nil?
|
38
|
+
saml_connection = nil
|
39
|
+
else
|
40
|
+
saml_connection = parsed_json["samlConnection"].to_json
|
41
|
+
saml_connection = SSOReady::SAMLConnection.from_json(json_object: saml_connection)
|
42
|
+
end
|
43
|
+
new(saml_connection: saml_connection, additional_properties: struct)
|
44
|
+
end
|
45
|
+
|
46
|
+
# Serialize an instance of GetSAMLConnectionResponse to a JSON object
|
47
|
+
#
|
48
|
+
# @return [String]
|
49
|
+
def to_json(*_args)
|
50
|
+
@_field_set&.to_json
|
51
|
+
end
|
52
|
+
|
53
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
54
|
+
# hash and check each fields type against the current object's property
|
55
|
+
# definitions.
|
56
|
+
#
|
57
|
+
# @param obj [Object]
|
58
|
+
# @return [Void]
|
59
|
+
def self.validate_raw(obj:)
|
60
|
+
obj.saml_connection.nil? || SSOReady::SAMLConnection.validate_raw(obj: obj.saml_connection)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "ostruct"
|
4
|
+
require "json"
|
5
|
+
|
6
|
+
module SSOReady
|
7
|
+
class GetSAMLRedirectURLResponse
|
8
|
+
# @return [String] Redirect your user to this URL to start a SAML login.
|
9
|
+
attr_reader :redirect_url
|
10
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
11
|
+
attr_reader :additional_properties
|
12
|
+
# @return [Object]
|
13
|
+
attr_reader :_field_set
|
14
|
+
protected :_field_set
|
15
|
+
|
16
|
+
OMIT = Object.new
|
17
|
+
|
18
|
+
# @param redirect_url [String] Redirect your user to this URL to start a SAML login.
|
19
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
20
|
+
# @return [SSOReady::GetSAMLRedirectURLResponse]
|
21
|
+
def initialize(redirect_url: OMIT, additional_properties: nil)
|
22
|
+
@redirect_url = redirect_url if redirect_url != OMIT
|
23
|
+
@additional_properties = additional_properties
|
24
|
+
@_field_set = { "redirectUrl": redirect_url }.reject do |_k, v|
|
25
|
+
v == OMIT
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
# Deserialize a JSON object to an instance of GetSAMLRedirectURLResponse
|
30
|
+
#
|
31
|
+
# @param json_object [String]
|
32
|
+
# @return [SSOReady::GetSAMLRedirectURLResponse]
|
33
|
+
def self.from_json(json_object:)
|
34
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
35
|
+
redirect_url = struct["redirectUrl"]
|
36
|
+
new(redirect_url: redirect_url, additional_properties: struct)
|
37
|
+
end
|
38
|
+
|
39
|
+
# Serialize an instance of GetSAMLRedirectURLResponse to a JSON object
|
40
|
+
#
|
41
|
+
# @return [String]
|
42
|
+
def to_json(*_args)
|
43
|
+
@_field_set&.to_json
|
44
|
+
end
|
45
|
+
|
46
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
47
|
+
# hash and check each fields type against the current object's property
|
48
|
+
# definitions.
|
49
|
+
#
|
50
|
+
# @param obj [Object]
|
51
|
+
# @return [Void]
|
52
|
+
def self.validate_raw(obj:)
|
53
|
+
obj.redirect_url&.is_a?(String) != false || raise("Passed value for field obj.redirect_url is not the expected type, validation failed.")
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "scim_directory"
|
4
|
+
require "ostruct"
|
5
|
+
require "json"
|
6
|
+
|
7
|
+
module SSOReady
|
8
|
+
class GetSCIMDirectoryResponse
|
9
|
+
# @return [SSOReady::SCIMDirectory] The requested SCIM directory.
|
10
|
+
attr_reader :scim_directory
|
11
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
12
|
+
attr_reader :additional_properties
|
13
|
+
# @return [Object]
|
14
|
+
attr_reader :_field_set
|
15
|
+
protected :_field_set
|
16
|
+
|
17
|
+
OMIT = Object.new
|
18
|
+
|
19
|
+
# @param scim_directory [SSOReady::SCIMDirectory] The requested SCIM directory.
|
20
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
21
|
+
# @return [SSOReady::GetSCIMDirectoryResponse]
|
22
|
+
def initialize(scim_directory: OMIT, additional_properties: nil)
|
23
|
+
@scim_directory = scim_directory if scim_directory != OMIT
|
24
|
+
@additional_properties = additional_properties
|
25
|
+
@_field_set = { "scimDirectory": scim_directory }.reject do |_k, v|
|
26
|
+
v == OMIT
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
# Deserialize a JSON object to an instance of GetSCIMDirectoryResponse
|
31
|
+
#
|
32
|
+
# @param json_object [String]
|
33
|
+
# @return [SSOReady::GetSCIMDirectoryResponse]
|
34
|
+
def self.from_json(json_object:)
|
35
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
36
|
+
parsed_json = JSON.parse(json_object)
|
37
|
+
if parsed_json["scimDirectory"].nil?
|
38
|
+
scim_directory = nil
|
39
|
+
else
|
40
|
+
scim_directory = parsed_json["scimDirectory"].to_json
|
41
|
+
scim_directory = SSOReady::SCIMDirectory.from_json(json_object: scim_directory)
|
42
|
+
end
|
43
|
+
new(scim_directory: scim_directory, additional_properties: struct)
|
44
|
+
end
|
45
|
+
|
46
|
+
# Serialize an instance of GetSCIMDirectoryResponse to a JSON object
|
47
|
+
#
|
48
|
+
# @return [String]
|
49
|
+
def to_json(*_args)
|
50
|
+
@_field_set&.to_json
|
51
|
+
end
|
52
|
+
|
53
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
54
|
+
# hash and check each fields type against the current object's property
|
55
|
+
# definitions.
|
56
|
+
#
|
57
|
+
# @param obj [Object]
|
58
|
+
# @return [Void]
|
59
|
+
def self.validate_raw(obj:)
|
60
|
+
obj.scim_directory.nil? || SSOReady::SCIMDirectory.validate_raw(obj: obj.scim_directory)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "scim_group"
|
4
|
+
require "ostruct"
|
5
|
+
require "json"
|
6
|
+
|
7
|
+
module SSOReady
|
8
|
+
class GetSCIMGroupResponse
|
9
|
+
# @return [SSOReady::SCIMGroup] The requested SCIM group.
|
10
|
+
attr_reader :scim_group
|
11
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
12
|
+
attr_reader :additional_properties
|
13
|
+
# @return [Object]
|
14
|
+
attr_reader :_field_set
|
15
|
+
protected :_field_set
|
16
|
+
|
17
|
+
OMIT = Object.new
|
18
|
+
|
19
|
+
# @param scim_group [SSOReady::SCIMGroup] The requested SCIM group.
|
20
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
21
|
+
# @return [SSOReady::GetSCIMGroupResponse]
|
22
|
+
def initialize(scim_group: OMIT, additional_properties: nil)
|
23
|
+
@scim_group = scim_group if scim_group != OMIT
|
24
|
+
@additional_properties = additional_properties
|
25
|
+
@_field_set = { "scimGroup": scim_group }.reject do |_k, v|
|
26
|
+
v == OMIT
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
# Deserialize a JSON object to an instance of GetSCIMGroupResponse
|
31
|
+
#
|
32
|
+
# @param json_object [String]
|
33
|
+
# @return [SSOReady::GetSCIMGroupResponse]
|
34
|
+
def self.from_json(json_object:)
|
35
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
36
|
+
parsed_json = JSON.parse(json_object)
|
37
|
+
if parsed_json["scimGroup"].nil?
|
38
|
+
scim_group = nil
|
39
|
+
else
|
40
|
+
scim_group = parsed_json["scimGroup"].to_json
|
41
|
+
scim_group = SSOReady::SCIMGroup.from_json(json_object: scim_group)
|
42
|
+
end
|
43
|
+
new(scim_group: scim_group, additional_properties: struct)
|
44
|
+
end
|
45
|
+
|
46
|
+
# Serialize an instance of GetSCIMGroupResponse to a JSON object
|
47
|
+
#
|
48
|
+
# @return [String]
|
49
|
+
def to_json(*_args)
|
50
|
+
@_field_set&.to_json
|
51
|
+
end
|
52
|
+
|
53
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
54
|
+
# hash and check each fields type against the current object's property
|
55
|
+
# definitions.
|
56
|
+
#
|
57
|
+
# @param obj [Object]
|
58
|
+
# @return [Void]
|
59
|
+
def self.validate_raw(obj:)
|
60
|
+
obj.scim_group.nil? || SSOReady::SCIMGroup.validate_raw(obj: obj.scim_group)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "scim_user"
|
4
|
+
require "ostruct"
|
5
|
+
require "json"
|
6
|
+
|
7
|
+
module SSOReady
|
8
|
+
class GetSCIMUserResponse
|
9
|
+
# @return [SSOReady::SCIMUser] The requested SCIM user.
|
10
|
+
attr_reader :scim_user
|
11
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
12
|
+
attr_reader :additional_properties
|
13
|
+
# @return [Object]
|
14
|
+
attr_reader :_field_set
|
15
|
+
protected :_field_set
|
16
|
+
|
17
|
+
OMIT = Object.new
|
18
|
+
|
19
|
+
# @param scim_user [SSOReady::SCIMUser] The requested SCIM user.
|
20
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
21
|
+
# @return [SSOReady::GetSCIMUserResponse]
|
22
|
+
def initialize(scim_user: OMIT, additional_properties: nil)
|
23
|
+
@scim_user = scim_user if scim_user != OMIT
|
24
|
+
@additional_properties = additional_properties
|
25
|
+
@_field_set = { "scimUser": scim_user }.reject do |_k, v|
|
26
|
+
v == OMIT
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
# Deserialize a JSON object to an instance of GetSCIMUserResponse
|
31
|
+
#
|
32
|
+
# @param json_object [String]
|
33
|
+
# @return [SSOReady::GetSCIMUserResponse]
|
34
|
+
def self.from_json(json_object:)
|
35
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
36
|
+
parsed_json = JSON.parse(json_object)
|
37
|
+
if parsed_json["scimUser"].nil?
|
38
|
+
scim_user = nil
|
39
|
+
else
|
40
|
+
scim_user = parsed_json["scimUser"].to_json
|
41
|
+
scim_user = SSOReady::SCIMUser.from_json(json_object: scim_user)
|
42
|
+
end
|
43
|
+
new(scim_user: scim_user, additional_properties: struct)
|
44
|
+
end
|
45
|
+
|
46
|
+
# Serialize an instance of GetSCIMUserResponse to a JSON object
|
47
|
+
#
|
48
|
+
# @return [String]
|
49
|
+
def to_json(*_args)
|
50
|
+
@_field_set&.to_json
|
51
|
+
end
|
52
|
+
|
53
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
54
|
+
# hash and check each fields type against the current object's property
|
55
|
+
# definitions.
|
56
|
+
#
|
57
|
+
# @param obj [Object]
|
58
|
+
# @return [Void]
|
59
|
+
def self.validate_raw(obj:)
|
60
|
+
obj.scim_user.nil? || SSOReady::SCIMUser.validate_raw(obj: obj.scim_user)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "ostruct"
|
4
|
+
require "json"
|
5
|
+
|
6
|
+
module SSOReady
|
7
|
+
# Contains an arbitrary serialized message along with a @type that describes the
|
8
|
+
# type of the serialized message.
|
9
|
+
class GoogleProtobufAny
|
10
|
+
# @return [String] The type of the serialized message.
|
11
|
+
attr_reader :type
|
12
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
13
|
+
attr_reader :additional_properties
|
14
|
+
# @return [Object]
|
15
|
+
attr_reader :_field_set
|
16
|
+
protected :_field_set
|
17
|
+
|
18
|
+
OMIT = Object.new
|
19
|
+
|
20
|
+
# @param type [String] The type of the serialized message.
|
21
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
22
|
+
# @return [SSOReady::GoogleProtobufAny]
|
23
|
+
def initialize(type: OMIT, additional_properties: nil)
|
24
|
+
@type = type if type != OMIT
|
25
|
+
@additional_properties = additional_properties
|
26
|
+
@_field_set = { "@type": type }.reject do |_k, v|
|
27
|
+
v == OMIT
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
# Deserialize a JSON object to an instance of GoogleProtobufAny
|
32
|
+
#
|
33
|
+
# @param json_object [String]
|
34
|
+
# @return [SSOReady::GoogleProtobufAny]
|
35
|
+
def self.from_json(json_object:)
|
36
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
37
|
+
type = struct["@type"]
|
38
|
+
new(type: type, additional_properties: struct)
|
39
|
+
end
|
40
|
+
|
41
|
+
# Serialize an instance of GoogleProtobufAny to a JSON object
|
42
|
+
#
|
43
|
+
# @return [String]
|
44
|
+
def to_json(*_args)
|
45
|
+
@_field_set&.to_json
|
46
|
+
end
|
47
|
+
|
48
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
49
|
+
# hash and check each fields type against the current object's property
|
50
|
+
# definitions.
|
51
|
+
#
|
52
|
+
# @param obj [Object]
|
53
|
+
# @return [Void]
|
54
|
+
def self.validate_raw(obj:)
|
55
|
+
obj.type&.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|