Class: SSOReady::RedeemSAMLAccessCodeResponse
- Inherits:
-
Object
- Object
- SSOReady::RedeemSAMLAccessCodeResponse
- Defined in:
- lib/ssoready/types/redeem_saml_access_code_response.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#attributes ⇒ Hash{String => String}
readonly
Arbitrary key-value pairs the Identity Provider included about the user.
-
#email ⇒ String
readonly
The user’s email address.
-
#organization_external_id ⇒ String
readonly
The ‘externalId`, if any, of the organization this user belongs to.
-
#organization_id ⇒ String
readonly
The ID of the organization this user belongs to.
-
#saml_flow_id ⇒ String
readonly
A unique identifier of this particular SAML login.
-
#state ⇒ String
readonly
The ‘state` you provided when getting a SAML initiation URL, if any.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ SSOReady::RedeemSAMLAccessCodeResponse
Deserialize a JSON object to an instance of RedeemSAMLAccessCodeResponse.
-
.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.
Instance Method Summary collapse
- #initialize(email: OMIT, state: OMIT, attributes: OMIT, organization_id: OMIT, organization_external_id: OMIT, saml_flow_id: OMIT, additional_properties: nil) ⇒ SSOReady::RedeemSAMLAccessCodeResponse constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of RedeemSAMLAccessCodeResponse to a JSON object.
Constructor Details
#initialize(email: OMIT, state: OMIT, attributes: OMIT, organization_id: OMIT, organization_external_id: OMIT, saml_flow_id: OMIT, additional_properties: nil) ⇒ SSOReady::RedeemSAMLAccessCodeResponse
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/ssoready/types/redeem_saml_access_code_response.rb', line 60 def initialize(email: OMIT, state: OMIT, attributes: OMIT, organization_id: OMIT, organization_external_id: OMIT, saml_flow_id: OMIT, additional_properties: nil) @email = email if email != OMIT @state = state if state != OMIT @attributes = attributes if attributes != OMIT @organization_id = organization_id if organization_id != OMIT @organization_external_id = organization_external_id if organization_external_id != OMIT @saml_flow_id = saml_flow_id if saml_flow_id != OMIT @additional_properties = additional_properties @_field_set = { "email": email, "state": state, "attributes": attributes, "organizationId": organization_id, "organizationExternalId": organization_external_id, "samlFlowId": saml_flow_id }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
33 34 35 |
# File 'lib/ssoready/types/redeem_saml_access_code_response.rb', line 33 def additional_properties @additional_properties end |
#attributes ⇒ Hash{String => String} (readonly)
22 23 24 |
# File 'lib/ssoready/types/redeem_saml_access_code_response.rb', line 22 def attributes @attributes end |
#email ⇒ String (readonly)
9 10 11 |
# File 'lib/ssoready/types/redeem_saml_access_code_response.rb', line 9 def email @email end |
#organization_external_id ⇒ String (readonly)
26 27 28 |
# File 'lib/ssoready/types/redeem_saml_access_code_response.rb', line 26 def organization_external_id @organization_external_id end |
#organization_id ⇒ String (readonly)
24 25 26 |
# File 'lib/ssoready/types/redeem_saml_access_code_response.rb', line 24 def organization_id @organization_id end |
#saml_flow_id ⇒ String (readonly)
31 32 33 |
# File 'lib/ssoready/types/redeem_saml_access_code_response.rb', line 31 def saml_flow_id @saml_flow_id end |
#state ⇒ String (readonly)
17 18 19 |
# File 'lib/ssoready/types/redeem_saml_access_code_response.rb', line 17 def state @state end |
Class Method Details
.from_json(json_object:) ⇒ SSOReady::RedeemSAMLAccessCodeResponse
Deserialize a JSON object to an instance of RedeemSAMLAccessCodeResponse
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
# File 'lib/ssoready/types/redeem_saml_access_code_response.rb', line 85 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) email = parsed_json["email"] state = parsed_json["state"] attributes = parsed_json["attributes"] organization_id = parsed_json["organizationId"] organization_external_id = parsed_json["organizationExternalId"] saml_flow_id = parsed_json["samlFlowId"] new( email: email, state: state, attributes: attributes, organization_id: organization_id, organization_external_id: organization_external_id, saml_flow_id: saml_flow_id, 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.
118 119 120 121 122 123 124 125 |
# File 'lib/ssoready/types/redeem_saml_access_code_response.rb', line 118 def self.validate_raw(obj:) obj.email&.is_a?(String) != false || raise("Passed value for field obj.email is not the expected type, validation failed.") obj.state&.is_a?(String) != false || raise("Passed value for field obj.state is not the expected type, validation failed.") obj.attributes&.is_a?(Hash) != false || raise("Passed value for field obj.attributes 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.organization_external_id&.is_a?(String) != false || raise("Passed value for field obj.organization_external_id is not the expected type, validation failed.") obj.saml_flow_id&.is_a?(String) != false || raise("Passed value for field obj.saml_flow_id is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of RedeemSAMLAccessCodeResponse to a JSON object
108 109 110 |
# File 'lib/ssoready/types/redeem_saml_access_code_response.rb', line 108 def to_json(*_args) @_field_set&.to_json end |