Class: SSOReady::SAMLConnection

Inherits:
Object
  • Object
show all
Defined in:
lib/ssoready/types/saml_connection.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, idp_redirect_url: OMIT, idp_certificate: OMIT, idp_entity_id: OMIT, sp_entity_id: OMIT, sp_acs_url: OMIT, additional_properties: nil) ⇒ SSOReady::SAMLConnection



68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/ssoready/types/saml_connection.rb', line 68

def initialize(id: OMIT, organization_id: OMIT, primary: OMIT, idp_redirect_url: OMIT, idp_certificate: OMIT,
               idp_entity_id: OMIT, sp_entity_id: OMIT, sp_acs_url: OMIT, additional_properties: nil)
  @id = id if id != OMIT
  @organization_id = organization_id if organization_id != OMIT
  @primary = primary if primary != OMIT
  @idp_redirect_url = idp_redirect_url if idp_redirect_url != OMIT
  @idp_certificate = idp_certificate if idp_certificate != OMIT
  @idp_entity_id = idp_entity_id if idp_entity_id != OMIT
  @sp_entity_id = sp_entity_id if sp_entity_id != OMIT
  @sp_acs_url = sp_acs_url if sp_acs_url != OMIT
  @additional_properties = additional_properties
  @_field_set = {
    "id": id,
    "organizationId": organization_id,
    "primary": primary,
    "idpRedirectUrl": idp_redirect_url,
    "idpCertificate": idp_certificate,
    "idpEntityId": idp_entity_id,
    "spEntityId": sp_entity_id,
    "spAcsUrl": sp_acs_url
  }.reject do |_k, v|
    v == OMIT
  end
end

Instance Attribute Details

#additional_propertiesOpenStruct (readonly)



38
39
40
# File 'lib/ssoready/types/saml_connection.rb', line 38

def additional_properties
  @additional_properties
end

#idString (readonly)



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

def id
  @id
end

#idp_certificateString (readonly)



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

def idp_certificate
  @idp_certificate
end

#idp_entity_idString (readonly)



26
27
28
# File 'lib/ssoready/types/saml_connection.rb', line 26

def idp_entity_id
  @idp_entity_id
end

#idp_redirect_urlString (readonly)



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

def idp_redirect_url
  @idp_redirect_url
end

#organization_idString (readonly)



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

def organization_id
  @organization_id
end

#primaryBoolean (readonly)



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

def primary
  @primary
end

#sp_acs_urlString (readonly)



36
37
38
# File 'lib/ssoready/types/saml_connection.rb', line 36

def sp_acs_url
  @sp_acs_url
end

#sp_entity_idString (readonly)



30
31
32
# File 'lib/ssoready/types/saml_connection.rb', line 30

def sp_entity_id
  @sp_entity_id
end

Class Method Details

.from_json(json_object:) ⇒ SSOReady::SAMLConnection

Deserialize a JSON object to an instance of SAMLConnection



97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# File 'lib/ssoready/types/saml_connection.rb', line 97

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"]
  idp_redirect_url = parsed_json["idpRedirectUrl"]
  idp_certificate = parsed_json["idpCertificate"]
  idp_entity_id = parsed_json["idpEntityId"]
  sp_entity_id = parsed_json["spEntityId"]
  sp_acs_url = parsed_json["spAcsUrl"]
  new(
    id: id,
    organization_id: organization_id,
    primary: primary,
    idp_redirect_url: idp_redirect_url,
    idp_certificate: idp_certificate,
    idp_entity_id: idp_entity_id,
    sp_entity_id: sp_entity_id,
    sp_acs_url: sp_acs_url,
    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.


134
135
136
137
138
139
140
141
142
143
# File 'lib/ssoready/types/saml_connection.rb', line 134

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.idp_redirect_url&.is_a?(String) != false || raise("Passed value for field obj.idp_redirect_url is not the expected type, validation failed.")
  obj.idp_certificate&.is_a?(String) != false || raise("Passed value for field obj.idp_certificate is not the expected type, validation failed.")
  obj.idp_entity_id&.is_a?(String) != false || raise("Passed value for field obj.idp_entity_id is not the expected type, validation failed.")
  obj.sp_entity_id&.is_a?(String) != false || raise("Passed value for field obj.sp_entity_id is not the expected type, validation failed.")
  obj.sp_acs_url&.is_a?(String) != false || raise("Passed value for field obj.sp_acs_url is not the expected type, validation failed.")
end

Instance Method Details

#to_json(*_args) ⇒ String

Serialize an instance of SAMLConnection to a JSON object



124
125
126
# File 'lib/ssoready/types/saml_connection.rb', line 124

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