Class: NewDemoApiClient::CreateFileForSignedURLResponse
- Inherits:
-
Object
- Object
- NewDemoApiClient::CreateFileForSignedURLResponse
- Defined in:
- lib/test_sdk/types/create_file_for_signed_url_response.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #created_at ⇒ DateTime readonly
- #deal_id ⇒ Integer readonly
- #id ⇒ Integer readonly
- #is_archived ⇒ Boolean readonly
- #name ⇒ String readonly
- #signed_url ⇒ NewDemoApiClient::GcsSignedURLResponse readonly
-
#type ⇒ NewDemoApiClient::FileType
readonly
The type of the file.
- #updated_at ⇒ DateTime readonly
Class Method Summary collapse
-
.from_json(json_object:) ⇒ NewDemoApiClient::CreateFileForSignedURLResponse
Deserialize a JSON object to an instance of CreateFileForSignedURLResponse.
-
.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(name:, id:, signed_url:, type: OMIT, created_at: OMIT, updated_at: OMIT, is_archived: OMIT, deal_id: OMIT, additional_properties: nil) ⇒ NewDemoApiClient::CreateFileForSignedURLResponse constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of CreateFileForSignedURLResponse to a JSON object.
Constructor Details
#initialize(name:, id:, signed_url:, type: OMIT, created_at: OMIT, updated_at: OMIT, is_archived: OMIT, deal_id: OMIT, additional_properties: nil) ⇒ NewDemoApiClient::CreateFileForSignedURLResponse
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/test_sdk/types/create_file_for_signed_url_response.rb', line 45 def initialize(name:, id:, signed_url:, type: OMIT, created_at: OMIT, updated_at: OMIT, is_archived: OMIT, deal_id: OMIT, additional_properties: nil) @name = name @type = type if type != OMIT @id = id @created_at = created_at if created_at != OMIT @updated_at = updated_at if updated_at != OMIT @is_archived = is_archived if is_archived != OMIT @deal_id = deal_id if deal_id != OMIT @signed_url = signed_url @additional_properties = additional_properties @_field_set = { "name": name, "type": type, "id": id, "created_at": created_at, "updated_at": updated_at, "is_archived": is_archived, "deal_id": deal_id, "signed_url": signed_url }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
28 29 30 |
# File 'lib/test_sdk/types/create_file_for_signed_url_response.rb', line 28 def additional_properties @additional_properties end |
#created_at ⇒ DateTime (readonly)
18 19 20 |
# File 'lib/test_sdk/types/create_file_for_signed_url_response.rb', line 18 def created_at @created_at end |
#deal_id ⇒ Integer (readonly)
24 25 26 |
# File 'lib/test_sdk/types/create_file_for_signed_url_response.rb', line 24 def deal_id @deal_id end |
#id ⇒ Integer (readonly)
16 17 18 |
# File 'lib/test_sdk/types/create_file_for_signed_url_response.rb', line 16 def id @id end |
#is_archived ⇒ Boolean (readonly)
22 23 24 |
# File 'lib/test_sdk/types/create_file_for_signed_url_response.rb', line 22 def is_archived @is_archived end |
#name ⇒ String (readonly)
12 13 14 |
# File 'lib/test_sdk/types/create_file_for_signed_url_response.rb', line 12 def name @name end |
#signed_url ⇒ NewDemoApiClient::GcsSignedURLResponse (readonly)
26 27 28 |
# File 'lib/test_sdk/types/create_file_for_signed_url_response.rb', line 26 def signed_url @signed_url end |
#type ⇒ NewDemoApiClient::FileType (readonly)
Returns The type of the file.
14 15 16 |
# File 'lib/test_sdk/types/create_file_for_signed_url_response.rb', line 14 def type @type end |
#updated_at ⇒ DateTime (readonly)
20 21 22 |
# File 'lib/test_sdk/types/create_file_for_signed_url_response.rb', line 20 def updated_at @updated_at end |
Class Method Details
.from_json(json_object:) ⇒ NewDemoApiClient::CreateFileForSignedURLResponse
Deserialize a JSON object to an instance of CreateFileForSignedURLResponse
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
# File 'lib/test_sdk/types/create_file_for_signed_url_response.rb', line 74 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) name = parsed_json["name"] type = parsed_json["type"] id = parsed_json["id"] created_at = (DateTime.parse(parsed_json["created_at"]) unless parsed_json["created_at"].nil?) updated_at = (DateTime.parse(parsed_json["updated_at"]) unless parsed_json["updated_at"].nil?) is_archived = parsed_json["is_archived"] deal_id = parsed_json["deal_id"] if parsed_json["signed_url"].nil? signed_url = nil else signed_url = parsed_json["signed_url"].to_json signed_url = NewDemoApiClient::GcsSignedURLResponse.from_json(json_object: signed_url) end new( name: name, type: type, id: id, created_at: created_at, updated_at: updated_at, is_archived: is_archived, deal_id: deal_id, signed_url: signed_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.
116 117 118 119 120 121 122 123 124 125 |
# File 'lib/test_sdk/types/create_file_for_signed_url_response.rb', line 116 def self.validate_raw(obj:) obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.") obj.type&.is_a?(NewDemoApiClient::FileType) != false || raise("Passed value for field obj.type is not the expected type, validation failed.") obj.id.is_a?(Integer) != false || raise("Passed value for field obj.id is not the expected type, validation failed.") obj.created_at&.is_a?(DateTime) != false || raise("Passed value for field obj.created_at is not the expected type, validation failed.") obj.updated_at&.is_a?(DateTime) != false || raise("Passed value for field obj.updated_at is not the expected type, validation failed.") obj.is_archived&.is_a?(Boolean) != false || raise("Passed value for field obj.is_archived is not the expected type, validation failed.") obj.deal_id&.is_a?(Integer) != false || raise("Passed value for field obj.deal_id is not the expected type, validation failed.") NewDemoApiClient::GcsSignedURLResponse.validate_raw(obj: obj.signed_url) end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of CreateFileForSignedURLResponse to a JSON object
106 107 108 |
# File 'lib/test_sdk/types/create_file_for_signed_url_response.rb', line 106 def to_json(*_args) @_field_set&.to_json end |