Class: Ittybit::Signatures::SignaturesCreateResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/ittybit/signatures/types/signatures_create_response.rb

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(domain:, filename:, expiry:, method:, signature:, url:, folder: OMIT, additional_properties: nil) ⇒ Ittybit::Signatures::SignaturesCreateResponse

Parameters:

  • domain (String)
  • filename (String)
  • folder (String) (defaults to: OMIT)
  • expiry (Integer)
  • method (String)
  • signature (String)
  • url (String)
  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/ittybit/signatures/types/signatures_create_response.rb', line 40

def initialize(domain:, filename:, expiry:, method:, signature:, url:, folder: OMIT, additional_properties: nil)
  @domain = domain
  @filename = filename
  @folder = folder if folder != OMIT
  @expiry = expiry
  @method = method
  @signature = signature
  @url = url
  @additional_properties = additional_properties
  @_field_set = {
    "domain": domain,
    "filename": filename,
    "folder": folder,
    "expiry": expiry,
    "method": method,
    "signature": signature,
    "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



24
25
26
# File 'lib/ittybit/signatures/types/signatures_create_response.rb', line 24

def additional_properties
  @additional_properties
end

#domainString (readonly)

Returns:

  • (String)


10
11
12
# File 'lib/ittybit/signatures/types/signatures_create_response.rb', line 10

def domain
  @domain
end

#expiryInteger (readonly)

Returns:

  • (Integer)


16
17
18
# File 'lib/ittybit/signatures/types/signatures_create_response.rb', line 16

def expiry
  @expiry
end

#filenameString (readonly)

Returns:

  • (String)


12
13
14
# File 'lib/ittybit/signatures/types/signatures_create_response.rb', line 12

def filename
  @filename
end

#folderString (readonly)

Returns:

  • (String)


14
15
16
# File 'lib/ittybit/signatures/types/signatures_create_response.rb', line 14

def folder
  @folder
end

#methodString (readonly)

Returns:

  • (String)


18
19
20
# File 'lib/ittybit/signatures/types/signatures_create_response.rb', line 18

def method
  @method
end

#signatureString (readonly)

Returns:

  • (String)


20
21
22
# File 'lib/ittybit/signatures/types/signatures_create_response.rb', line 20

def signature
  @signature
end

#urlString (readonly)

Returns:

  • (String)


22
23
24
# File 'lib/ittybit/signatures/types/signatures_create_response.rb', line 22

def url
  @url
end

Class Method Details

.from_json(json_object:) ⇒ Ittybit::Signatures::SignaturesCreateResponse

Deserialize a JSON object to an instance of SignaturesCreateResponse

Parameters:

  • json_object (String)

Returns:



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/ittybit/signatures/types/signatures_create_response.rb', line 66

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


101
102
103
104
105
106
107
108
109
# File 'lib/ittybit/signatures/types/signatures_create_response.rb', line 101

def self.validate_raw(obj:)
  obj.domain.is_a?(String) != false || raise("Passed value for field obj.domain is not the expected type, validation failed.")
  obj.filename.is_a?(String) != false || raise("Passed value for field obj.filename is not the expected type, validation failed.")
  obj.folder&.is_a?(String) != false || raise("Passed value for field obj.folder is not the expected type, validation failed.")
  obj.expiry.is_a?(Integer) != false || raise("Passed value for field obj.expiry is not the expected type, validation failed.")
  obj.method.is_a?(String) != false || raise("Passed value for field obj.method is not the expected type, validation failed.")
  obj.signature.is_a?(String) != false || raise("Passed value for field obj.signature is not the expected type, validation failed.")
  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 SignaturesCreateResponse to a JSON object

Returns:

  • (String)


91
92
93
# File 'lib/ittybit/signatures/types/signatures_create_response.rb', line 91

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