ssoready 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +7 -0
  2. data/lib/environment.rb +7 -0
  3. data/lib/gemconfig.rb +14 -0
  4. data/lib/requests.rb +159 -0
  5. data/lib/ssoready/management/client.rb +51 -0
  6. data/lib/ssoready/management/organizations/client.rb +247 -0
  7. data/lib/ssoready/management/saml_connections/client.rb +269 -0
  8. data/lib/ssoready/management/scim_directories/client.rb +330 -0
  9. data/lib/ssoready/management/setup_urls/client.rb +97 -0
  10. data/lib/ssoready/saml/client.rb +170 -0
  11. data/lib/ssoready/scim/client.rb +296 -0
  12. data/lib/ssoready/types/create_organization_response.rb +63 -0
  13. data/lib/ssoready/types/create_saml_connection_response.rb +63 -0
  14. data/lib/ssoready/types/create_scim_directory_response.rb +63 -0
  15. data/lib/ssoready/types/create_setup_url_response.rb +62 -0
  16. data/lib/ssoready/types/get_organization_response.rb +63 -0
  17. data/lib/ssoready/types/get_saml_connection_response.rb +63 -0
  18. data/lib/ssoready/types/get_saml_redirect_url_response.rb +56 -0
  19. data/lib/ssoready/types/get_scim_directory_response.rb +63 -0
  20. data/lib/ssoready/types/get_scim_group_response.rb +63 -0
  21. data/lib/ssoready/types/get_scim_user_response.rb +63 -0
  22. data/lib/ssoready/types/google_protobuf_any.rb +58 -0
  23. data/lib/ssoready/types/list_organizations_response.rb +73 -0
  24. data/lib/ssoready/types/list_saml_connections_response.rb +73 -0
  25. data/lib/ssoready/types/list_scim_directories_response.rb +73 -0
  26. data/lib/ssoready/types/list_scim_groups_response.rb +73 -0
  27. data/lib/ssoready/types/list_scim_users_response.rb +73 -0
  28. data/lib/ssoready/types/organization.rb +112 -0
  29. data/lib/ssoready/types/redeem_saml_access_code_response.rb +126 -0
  30. data/lib/ssoready/types/rotate_scim_directory_bearer_token_response.rb +63 -0
  31. data/lib/ssoready/types/saml_connection.rb +144 -0
  32. data/lib/ssoready/types/scim_directory.rb +104 -0
  33. data/lib/ssoready/types/scim_group.rb +114 -0
  34. data/lib/ssoready/types/scim_user.rb +102 -0
  35. data/lib/ssoready/types/status.rb +94 -0
  36. data/lib/ssoready/types/update_organization_response.rb +63 -0
  37. data/lib/ssoready/types/update_saml_connection_response.rb +63 -0
  38. data/lib/ssoready/types/update_scim_directory_response.rb +63 -0
  39. data/lib/ssoready.rb +68 -0
  40. data/lib/types_export.rb +29 -0
  41. metadata +163 -0
@@ -0,0 +1,144 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "ostruct"
4
+ require "json"
5
+
6
+ module SSOReady
7
+ class SAMLConnection
8
+ # @return [String] Unique identifier for this SAML connection.
9
+ attr_reader :id
10
+ # @return [String] The organization this SAML connection belongs to.
11
+ attr_reader :organization_id
12
+ # @return [Boolean] Whether this is the primary SAML connection for the organization.
13
+ attr_reader :primary
14
+ # @return [String] URL to redirect to when initiating SAML flows.
15
+ # IDP redirect URLs are assigned by an Identity Provider, and need to be inputted
16
+ # into SSOReady.
17
+ attr_reader :idp_redirect_url
18
+ # @return [String] Certificate to authenticate SAML assertions. This is a PEM-encoded X.509
19
+ # certificate.
20
+ # IDP certificates are assigned by an Identity Provider, and need to be inputted
21
+ # into SSOReady.
22
+ attr_reader :idp_certificate
23
+ # @return [String] Identifier for the identity provider when handling SAML operations.
24
+ # IDP entity IDs are assigned by an Identity Provider, and need to be inputted
25
+ # into SSOReady.
26
+ attr_reader :idp_entity_id
27
+ # @return [String] Identifier for the SAML connection when handling SAML operations.
28
+ # SP entity IDs are assigned by SSOReady, and need to be inputted into your
29
+ # customer's Identity Provider.
30
+ attr_reader :sp_entity_id
31
+ # @return [String] URL the Identity Provider redirects to when transmitting SAML assertions. Stands
32
+ # for "Service Provider Assertion
33
+ # Consumer Service" URL.
34
+ # SP ACS URLs are assigned by SSOReady, and need to be inputted into your
35
+ # customer's Identity Provider.
36
+ attr_reader :sp_acs_url
37
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
38
+ attr_reader :additional_properties
39
+ # @return [Object]
40
+ attr_reader :_field_set
41
+ protected :_field_set
42
+
43
+ OMIT = Object.new
44
+
45
+ # @param id [String] Unique identifier for this SAML connection.
46
+ # @param organization_id [String] The organization this SAML connection belongs to.
47
+ # @param primary [Boolean] Whether this is the primary SAML connection for the organization.
48
+ # @param idp_redirect_url [String] URL to redirect to when initiating SAML flows.
49
+ # IDP redirect URLs are assigned by an Identity Provider, and need to be inputted
50
+ # into SSOReady.
51
+ # @param idp_certificate [String] Certificate to authenticate SAML assertions. This is a PEM-encoded X.509
52
+ # certificate.
53
+ # IDP certificates are assigned by an Identity Provider, and need to be inputted
54
+ # into SSOReady.
55
+ # @param idp_entity_id [String] Identifier for the identity provider when handling SAML operations.
56
+ # IDP entity IDs are assigned by an Identity Provider, and need to be inputted
57
+ # into SSOReady.
58
+ # @param sp_entity_id [String] Identifier for the SAML connection when handling SAML operations.
59
+ # SP entity IDs are assigned by SSOReady, and need to be inputted into your
60
+ # customer's Identity Provider.
61
+ # @param sp_acs_url [String] URL the Identity Provider redirects to when transmitting SAML assertions. Stands
62
+ # for "Service Provider Assertion
63
+ # Consumer Service" URL.
64
+ # SP ACS URLs are assigned by SSOReady, and need to be inputted into your
65
+ # customer's Identity Provider.
66
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
67
+ # @return [SSOReady::SAMLConnection]
68
+ def initialize(id: OMIT, organization_id: OMIT, primary: OMIT, idp_redirect_url: OMIT, idp_certificate: OMIT,
69
+ idp_entity_id: OMIT, sp_entity_id: OMIT, sp_acs_url: OMIT, additional_properties: nil)
70
+ @id = id if id != OMIT
71
+ @organization_id = organization_id if organization_id != OMIT
72
+ @primary = primary if primary != OMIT
73
+ @idp_redirect_url = idp_redirect_url if idp_redirect_url != OMIT
74
+ @idp_certificate = idp_certificate if idp_certificate != OMIT
75
+ @idp_entity_id = idp_entity_id if idp_entity_id != OMIT
76
+ @sp_entity_id = sp_entity_id if sp_entity_id != OMIT
77
+ @sp_acs_url = sp_acs_url if sp_acs_url != OMIT
78
+ @additional_properties = additional_properties
79
+ @_field_set = {
80
+ "id": id,
81
+ "organizationId": organization_id,
82
+ "primary": primary,
83
+ "idpRedirectUrl": idp_redirect_url,
84
+ "idpCertificate": idp_certificate,
85
+ "idpEntityId": idp_entity_id,
86
+ "spEntityId": sp_entity_id,
87
+ "spAcsUrl": sp_acs_url
88
+ }.reject do |_k, v|
89
+ v == OMIT
90
+ end
91
+ end
92
+
93
+ # Deserialize a JSON object to an instance of SAMLConnection
94
+ #
95
+ # @param json_object [String]
96
+ # @return [SSOReady::SAMLConnection]
97
+ def self.from_json(json_object:)
98
+ struct = JSON.parse(json_object, object_class: OpenStruct)
99
+ id = struct["id"]
100
+ organization_id = struct["organizationId"]
101
+ primary = struct["primary"]
102
+ idp_redirect_url = struct["idpRedirectUrl"]
103
+ idp_certificate = struct["idpCertificate"]
104
+ idp_entity_id = struct["idpEntityId"]
105
+ sp_entity_id = struct["spEntityId"]
106
+ sp_acs_url = struct["spAcsUrl"]
107
+ new(
108
+ id: id,
109
+ organization_id: organization_id,
110
+ primary: primary,
111
+ idp_redirect_url: idp_redirect_url,
112
+ idp_certificate: idp_certificate,
113
+ idp_entity_id: idp_entity_id,
114
+ sp_entity_id: sp_entity_id,
115
+ sp_acs_url: sp_acs_url,
116
+ additional_properties: struct
117
+ )
118
+ end
119
+
120
+ # Serialize an instance of SAMLConnection to a JSON object
121
+ #
122
+ # @return [String]
123
+ def to_json(*_args)
124
+ @_field_set&.to_json
125
+ end
126
+
127
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
128
+ # hash and check each fields type against the current object's property
129
+ # definitions.
130
+ #
131
+ # @param obj [Object]
132
+ # @return [Void]
133
+ def self.validate_raw(obj:)
134
+ obj.id&.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
135
+ obj.organization_id&.is_a?(String) != false || raise("Passed value for field obj.organization_id is not the expected type, validation failed.")
136
+ obj.primary&.is_a?(Boolean) != false || raise("Passed value for field obj.primary is not the expected type, validation failed.")
137
+ obj.idp_redirect_url&.is_a?(String) != false || raise("Passed value for field obj.idp_redirect_url is not the expected type, validation failed.")
138
+ obj.idp_certificate&.is_a?(String) != false || raise("Passed value for field obj.idp_certificate is not the expected type, validation failed.")
139
+ obj.idp_entity_id&.is_a?(String) != false || raise("Passed value for field obj.idp_entity_id is not the expected type, validation failed.")
140
+ obj.sp_entity_id&.is_a?(String) != false || raise("Passed value for field obj.sp_entity_id is not the expected type, validation failed.")
141
+ obj.sp_acs_url&.is_a?(String) != false || raise("Passed value for field obj.sp_acs_url is not the expected type, validation failed.")
142
+ end
143
+ end
144
+ end
@@ -0,0 +1,104 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "ostruct"
4
+ require "json"
5
+
6
+ module SSOReady
7
+ class SCIMDirectory
8
+ # @return [String] Unique identifier for this SCIM directory.
9
+ attr_reader :id
10
+ # @return [String] The organization this SCIM directory belongs to.
11
+ attr_reader :organization_id
12
+ # @return [Boolean] Whether this is the primary SCIM directory for the organization.
13
+ attr_reader :primary
14
+ # @return [String] Base URL the Identity Provider uses to perform SCIM HTTP requests.
15
+ # SCIM base URLs are assigned by SSOReady, and need to be inputted into your
16
+ # customer's Identity Provider.
17
+ attr_reader :scim_base_url
18
+ # @return [Boolean] Whether this SCIM directory has a bearer token assigned.
19
+ # SSOReady only stores a hash of the bearer token. To get a bearer token value,
20
+ # you must rotate this SCIM directory's
21
+ # bearer token.
22
+ attr_reader :has_client_bearer_token
23
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
24
+ attr_reader :additional_properties
25
+ # @return [Object]
26
+ attr_reader :_field_set
27
+ protected :_field_set
28
+
29
+ OMIT = Object.new
30
+
31
+ # @param id [String] Unique identifier for this SCIM directory.
32
+ # @param organization_id [String] The organization this SCIM directory belongs to.
33
+ # @param primary [Boolean] Whether this is the primary SCIM directory for the organization.
34
+ # @param scim_base_url [String] Base URL the Identity Provider uses to perform SCIM HTTP requests.
35
+ # SCIM base URLs are assigned by SSOReady, and need to be inputted into your
36
+ # customer's Identity Provider.
37
+ # @param has_client_bearer_token [Boolean] Whether this SCIM directory has a bearer token assigned.
38
+ # SSOReady only stores a hash of the bearer token. To get a bearer token value,
39
+ # you must rotate this SCIM directory's
40
+ # bearer token.
41
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
42
+ # @return [SSOReady::SCIMDirectory]
43
+ def initialize(id: OMIT, organization_id: OMIT, primary: OMIT, scim_base_url: OMIT, has_client_bearer_token: OMIT,
44
+ additional_properties: nil)
45
+ @id = id if id != OMIT
46
+ @organization_id = organization_id if organization_id != OMIT
47
+ @primary = primary if primary != OMIT
48
+ @scim_base_url = scim_base_url if scim_base_url != OMIT
49
+ @has_client_bearer_token = has_client_bearer_token if has_client_bearer_token != OMIT
50
+ @additional_properties = additional_properties
51
+ @_field_set = {
52
+ "id": id,
53
+ "organizationId": organization_id,
54
+ "primary": primary,
55
+ "scimBaseUrl": scim_base_url,
56
+ "hasClientBearerToken": has_client_bearer_token
57
+ }.reject do |_k, v|
58
+ v == OMIT
59
+ end
60
+ end
61
+
62
+ # Deserialize a JSON object to an instance of SCIMDirectory
63
+ #
64
+ # @param json_object [String]
65
+ # @return [SSOReady::SCIMDirectory]
66
+ def self.from_json(json_object:)
67
+ struct = JSON.parse(json_object, object_class: OpenStruct)
68
+ id = struct["id"]
69
+ organization_id = struct["organizationId"]
70
+ primary = struct["primary"]
71
+ scim_base_url = struct["scimBaseUrl"]
72
+ has_client_bearer_token = struct["hasClientBearerToken"]
73
+ new(
74
+ id: id,
75
+ organization_id: organization_id,
76
+ primary: primary,
77
+ scim_base_url: scim_base_url,
78
+ has_client_bearer_token: has_client_bearer_token,
79
+ additional_properties: struct
80
+ )
81
+ end
82
+
83
+ # Serialize an instance of SCIMDirectory to a JSON object
84
+ #
85
+ # @return [String]
86
+ def to_json(*_args)
87
+ @_field_set&.to_json
88
+ end
89
+
90
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
91
+ # hash and check each fields type against the current object's property
92
+ # definitions.
93
+ #
94
+ # @param obj [Object]
95
+ # @return [Void]
96
+ def self.validate_raw(obj:)
97
+ obj.id&.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
98
+ obj.organization_id&.is_a?(String) != false || raise("Passed value for field obj.organization_id is not the expected type, validation failed.")
99
+ obj.primary&.is_a?(Boolean) != false || raise("Passed value for field obj.primary is not the expected type, validation failed.")
100
+ obj.scim_base_url&.is_a?(String) != false || raise("Passed value for field obj.scim_base_url is not the expected type, validation failed.")
101
+ 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.")
102
+ end
103
+ end
104
+ end
@@ -0,0 +1,114 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "ostruct"
4
+ require "json"
5
+
6
+ module SSOReady
7
+ class SCIMGroup
8
+ # @return [String] Unique identifier for this SCIM group.
9
+ attr_reader :id
10
+ # @return [String] SCIM directory this SCIM group belongs to.
11
+ attr_reader :scim_directory_id
12
+ # @return [String] A human-friendly name for the SCIM group.
13
+ attr_reader :display_name
14
+ # @return [Boolean] Whether the SCIM group has been deleted or deprovisioned from its SCIM
15
+ # directory.
16
+ # Identity Providers are inconsistent about reliably deleting SCIM groups. Many
17
+ # Identity Providers will deprovision
18
+ # the users inside a group, but not the group itself. For this reason, it's
19
+ # typical to ignore this field until a
20
+ # specific need arises.
21
+ attr_reader :deleted
22
+ # @return [Hash{String => Object}] Arbitrary, potentially nested, attributes the Identity Provider included about
23
+ # the group.
24
+ # Identity Providers are inconsistent about supporting sending custom attributes
25
+ # on groups. For this reason, it's
26
+ # typical to not rely on them until a specific need arises.
27
+ attr_reader :attributes
28
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
29
+ attr_reader :additional_properties
30
+ # @return [Object]
31
+ attr_reader :_field_set
32
+ protected :_field_set
33
+
34
+ OMIT = Object.new
35
+
36
+ # @param id [String] Unique identifier for this SCIM group.
37
+ # @param scim_directory_id [String] SCIM directory this SCIM group belongs to.
38
+ # @param display_name [String] A human-friendly name for the SCIM group.
39
+ # @param deleted [Boolean] Whether the SCIM group has been deleted or deprovisioned from its SCIM
40
+ # directory.
41
+ # Identity Providers are inconsistent about reliably deleting SCIM groups. Many
42
+ # Identity Providers will deprovision
43
+ # the users inside a group, but not the group itself. For this reason, it's
44
+ # typical to ignore this field until a
45
+ # specific need arises.
46
+ # @param attributes [Hash{String => Object}] Arbitrary, potentially nested, attributes the Identity Provider included about
47
+ # the group.
48
+ # Identity Providers are inconsistent about supporting sending custom attributes
49
+ # on groups. For this reason, it's
50
+ # typical to not rely on them until a specific need arises.
51
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
52
+ # @return [SSOReady::SCIMGroup]
53
+ def initialize(id: OMIT, scim_directory_id: OMIT, display_name: OMIT, deleted: OMIT, attributes: OMIT,
54
+ additional_properties: nil)
55
+ @id = id if id != OMIT
56
+ @scim_directory_id = scim_directory_id if scim_directory_id != OMIT
57
+ @display_name = display_name if display_name != OMIT
58
+ @deleted = deleted if deleted != OMIT
59
+ @attributes = attributes if attributes != OMIT
60
+ @additional_properties = additional_properties
61
+ @_field_set = {
62
+ "id": id,
63
+ "scimDirectoryId": scim_directory_id,
64
+ "displayName": display_name,
65
+ "deleted": deleted,
66
+ "attributes": attributes
67
+ }.reject do |_k, v|
68
+ v == OMIT
69
+ end
70
+ end
71
+
72
+ # Deserialize a JSON object to an instance of SCIMGroup
73
+ #
74
+ # @param json_object [String]
75
+ # @return [SSOReady::SCIMGroup]
76
+ def self.from_json(json_object:)
77
+ struct = JSON.parse(json_object, object_class: OpenStruct)
78
+ id = struct["id"]
79
+ scim_directory_id = struct["scimDirectoryId"]
80
+ display_name = struct["displayName"]
81
+ deleted = struct["deleted"]
82
+ attributes = struct["attributes"]
83
+ new(
84
+ id: id,
85
+ scim_directory_id: scim_directory_id,
86
+ display_name: display_name,
87
+ deleted: deleted,
88
+ attributes: attributes,
89
+ additional_properties: struct
90
+ )
91
+ end
92
+
93
+ # Serialize an instance of SCIMGroup to a JSON object
94
+ #
95
+ # @return [String]
96
+ def to_json(*_args)
97
+ @_field_set&.to_json
98
+ end
99
+
100
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
101
+ # hash and check each fields type against the current object's property
102
+ # definitions.
103
+ #
104
+ # @param obj [Object]
105
+ # @return [Void]
106
+ def self.validate_raw(obj:)
107
+ obj.id&.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
108
+ obj.scim_directory_id&.is_a?(String) != false || raise("Passed value for field obj.scim_directory_id is not the expected type, validation failed.")
109
+ obj.display_name&.is_a?(String) != false || raise("Passed value for field obj.display_name is not the expected type, validation failed.")
110
+ obj.deleted&.is_a?(Boolean) != false || raise("Passed value for field obj.deleted is not the expected type, validation failed.")
111
+ obj.attributes&.is_a?(Hash) != false || raise("Passed value for field obj.attributes is not the expected type, validation failed.")
112
+ end
113
+ end
114
+ end
@@ -0,0 +1,102 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "ostruct"
4
+ require "json"
5
+
6
+ module SSOReady
7
+ class SCIMUser
8
+ # @return [String] Unique identifier for this SCIM user.
9
+ attr_reader :id
10
+ # @return [String] SCIM directory this SCIM user belongs to.
11
+ attr_reader :scim_directory_id
12
+ # @return [String] The SCIM user's email address.
13
+ attr_reader :email
14
+ # @return [Boolean] Whether the SCIM user has been deleted or deprovisioned from its SCIM directory.
15
+ attr_reader :deleted
16
+ # @return [Hash{String => Object}] Arbitrary, potentially nested, attributes the Identity Provider included about
17
+ # the user.
18
+ # Typically, these `attributes` are used to pass along the user's first/last name,
19
+ # or whether they should be
20
+ # considered an admin within their company.
21
+ attr_reader :attributes
22
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
23
+ attr_reader :additional_properties
24
+ # @return [Object]
25
+ attr_reader :_field_set
26
+ protected :_field_set
27
+
28
+ OMIT = Object.new
29
+
30
+ # @param id [String] Unique identifier for this SCIM user.
31
+ # @param scim_directory_id [String] SCIM directory this SCIM user belongs to.
32
+ # @param email [String] The SCIM user's email address.
33
+ # @param deleted [Boolean] Whether the SCIM user has been deleted or deprovisioned from its SCIM directory.
34
+ # @param attributes [Hash{String => Object}] Arbitrary, potentially nested, attributes the Identity Provider included about
35
+ # the user.
36
+ # Typically, these `attributes` are used to pass along the user's first/last name,
37
+ # or whether they should be
38
+ # considered an admin within their company.
39
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
40
+ # @return [SSOReady::SCIMUser]
41
+ def initialize(id: OMIT, scim_directory_id: OMIT, email: OMIT, deleted: OMIT, attributes: OMIT,
42
+ additional_properties: nil)
43
+ @id = id if id != OMIT
44
+ @scim_directory_id = scim_directory_id if scim_directory_id != OMIT
45
+ @email = email if email != OMIT
46
+ @deleted = deleted if deleted != OMIT
47
+ @attributes = attributes if attributes != OMIT
48
+ @additional_properties = additional_properties
49
+ @_field_set = {
50
+ "id": id,
51
+ "scimDirectoryId": scim_directory_id,
52
+ "email": email,
53
+ "deleted": deleted,
54
+ "attributes": attributes
55
+ }.reject do |_k, v|
56
+ v == OMIT
57
+ end
58
+ end
59
+
60
+ # Deserialize a JSON object to an instance of SCIMUser
61
+ #
62
+ # @param json_object [String]
63
+ # @return [SSOReady::SCIMUser]
64
+ def self.from_json(json_object:)
65
+ struct = JSON.parse(json_object, object_class: OpenStruct)
66
+ id = struct["id"]
67
+ scim_directory_id = struct["scimDirectoryId"]
68
+ email = struct["email"]
69
+ deleted = struct["deleted"]
70
+ attributes = struct["attributes"]
71
+ new(
72
+ id: id,
73
+ scim_directory_id: scim_directory_id,
74
+ email: email,
75
+ deleted: deleted,
76
+ attributes: attributes,
77
+ additional_properties: struct
78
+ )
79
+ end
80
+
81
+ # Serialize an instance of SCIMUser to a JSON object
82
+ #
83
+ # @return [String]
84
+ def to_json(*_args)
85
+ @_field_set&.to_json
86
+ end
87
+
88
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
89
+ # hash and check each fields type against the current object's property
90
+ # definitions.
91
+ #
92
+ # @param obj [Object]
93
+ # @return [Void]
94
+ def self.validate_raw(obj:)
95
+ obj.id&.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
96
+ obj.scim_directory_id&.is_a?(String) != false || raise("Passed value for field obj.scim_directory_id is not the expected type, validation failed.")
97
+ obj.email&.is_a?(String) != false || raise("Passed value for field obj.email is not the expected type, validation failed.")
98
+ obj.deleted&.is_a?(Boolean) != false || raise("Passed value for field obj.deleted is not the expected type, validation failed.")
99
+ obj.attributes&.is_a?(Hash) != false || raise("Passed value for field obj.attributes is not the expected type, validation failed.")
100
+ end
101
+ end
102
+ end
@@ -0,0 +1,94 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "google_protobuf_any"
4
+ require "ostruct"
5
+ require "json"
6
+
7
+ module SSOReady
8
+ # The `Status` type defines a logical error model that is suitable for different
9
+ # programming environments, including REST APIs and RPC APIs. It is used by
10
+ # [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of
11
+ # data: error code, error message, and error details. You can find out more about
12
+ # this error model and how to work with it in the [API Design
13
+ # Guide](https://cloud.google.com/apis/design/errors).
14
+ class Status
15
+ # @return [Integer] The status code, which should be an enum value of
16
+ # [google.rpc.Code][google.rpc.code].
17
+ attr_reader :code
18
+ # @return [String] A developer-facing error message, which should be in English. Any user-facing
19
+ # error message should be localized and sent in the
20
+ # [google.rpc.Status.details][google.rpc.status.details] field, or localized by
21
+ # the client.
22
+ attr_reader :message
23
+ # @return [Array<SSOReady::GoogleProtobufAny>] A list of messages that carry the error details. There is a common set of
24
+ # message types for APIs to use.
25
+ attr_reader :details
26
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
27
+ attr_reader :additional_properties
28
+ # @return [Object]
29
+ attr_reader :_field_set
30
+ protected :_field_set
31
+
32
+ OMIT = Object.new
33
+
34
+ # @param code [Integer] The status code, which should be an enum value of
35
+ # [google.rpc.Code][google.rpc.code].
36
+ # @param message [String] A developer-facing error message, which should be in English. Any user-facing
37
+ # error message should be localized and sent in the
38
+ # [google.rpc.Status.details][google.rpc.status.details] field, or localized by
39
+ # the client.
40
+ # @param details [Array<SSOReady::GoogleProtobufAny>] A list of messages that carry the error details. There is a common set of
41
+ # message types for APIs to use.
42
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
43
+ # @return [SSOReady::Status]
44
+ def initialize(code: OMIT, message: OMIT, details: OMIT, additional_properties: nil)
45
+ @code = code if code != OMIT
46
+ @message = message if message != OMIT
47
+ @details = details if details != OMIT
48
+ @additional_properties = additional_properties
49
+ @_field_set = { "code": code, "message": message, "details": details }.reject do |_k, v|
50
+ v == OMIT
51
+ end
52
+ end
53
+
54
+ # Deserialize a JSON object to an instance of Status
55
+ #
56
+ # @param json_object [String]
57
+ # @return [SSOReady::Status]
58
+ def self.from_json(json_object:)
59
+ struct = JSON.parse(json_object, object_class: OpenStruct)
60
+ parsed_json = JSON.parse(json_object)
61
+ code = struct["code"]
62
+ message = struct["message"]
63
+ details = parsed_json["details"]&.map do |v|
64
+ v = v.to_json
65
+ SSOReady::GoogleProtobufAny.from_json(json_object: v)
66
+ end
67
+ new(
68
+ code: code,
69
+ message: message,
70
+ details: details,
71
+ additional_properties: struct
72
+ )
73
+ end
74
+
75
+ # Serialize an instance of Status to a JSON object
76
+ #
77
+ # @return [String]
78
+ def to_json(*_args)
79
+ @_field_set&.to_json
80
+ end
81
+
82
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
83
+ # hash and check each fields type against the current object's property
84
+ # definitions.
85
+ #
86
+ # @param obj [Object]
87
+ # @return [Void]
88
+ def self.validate_raw(obj:)
89
+ obj.code&.is_a?(Integer) != false || raise("Passed value for field obj.code is not the expected type, validation failed.")
90
+ obj.message&.is_a?(String) != false || raise("Passed value for field obj.message is not the expected type, validation failed.")
91
+ obj.details&.is_a?(Array) != false || raise("Passed value for field obj.details is not the expected type, validation failed.")
92
+ end
93
+ end
94
+ 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 UpdateOrganizationResponse
9
+ # @return [SSOReady::Organization] The updated 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 updated organization.
20
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
21
+ # @return [SSOReady::UpdateOrganizationResponse]
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 UpdateOrganizationResponse
31
+ #
32
+ # @param json_object [String]
33
+ # @return [SSOReady::UpdateOrganizationResponse]
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 UpdateOrganizationResponse 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 UpdateSAMLConnectionResponse
9
+ # @return [SSOReady::SAMLConnection] The updated 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 updated SAML connection.
20
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
21
+ # @return [SSOReady::UpdateSAMLConnectionResponse]
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 UpdateSAMLConnectionResponse
31
+ #
32
+ # @param json_object [String]
33
+ # @return [SSOReady::UpdateSAMLConnectionResponse]
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 UpdateSAMLConnectionResponse 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