Class: SSOReady::CreateSetupURLResponse

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

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url: OMIT, additional_properties: nil) ⇒ SSOReady::CreateSetupURLResponse

Parameters:

  • url (String) (defaults to: OMIT)

    The one-time, short-lived self-serve setup URL. Do not log or store this URL. Because this URL is one-time, loading it yourself means your customer will not be able to load it after you.

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



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

def initialize(url: OMIT, additional_properties: nil)
  @url = url if url != OMIT
  @additional_properties = additional_properties
  @_field_set = { "url": url }.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



14
15
16
# File 'lib/ssoready/types/create_setup_url_response.rb', line 14

def additional_properties
  @additional_properties
end

#urlString (readonly)

Returns The one-time, short-lived self-serve setup URL. Do not log or store this URL. Because this URL is one-time, loading it yourself means your customer will not be able to load it after you.

Returns:

  • (String)

    The one-time, short-lived self-serve setup URL. Do not log or store this URL. Because this URL is one-time, loading it yourself means your customer will not be able to load it after you.



12
13
14
# File 'lib/ssoready/types/create_setup_url_response.rb', line 12

def url
  @url
end

Class Method Details

.from_json(json_object:) ⇒ SSOReady::CreateSetupURLResponse

Deserialize a JSON object to an instance of CreateSetupURLResponse

Parameters:

  • json_object (String)

Returns:



39
40
41
42
43
44
# File 'lib/ssoready/types/create_setup_url_response.rb', line 39

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  url = parsed_json["url"]
  new(url: 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.

Parameters:

  • obj (Object)

Returns:

  • (Void)


59
60
61
# File 'lib/ssoready/types/create_setup_url_response.rb', line 59

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

Instance Method Details

#to_json(*_args) ⇒ String

Serialize an instance of CreateSetupURLResponse to a JSON object

Returns:

  • (String)


49
50
51
# File 'lib/ssoready/types/create_setup_url_response.rb', line 49

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