Class: NewDemoApiClient::DealWithFilesResponse
- Inherits:
-
Object
- Object
- NewDemoApiClient::DealWithFilesResponse
- Defined in:
- lib/test_sdk/types/deal_with_files_response.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #company ⇒ NewDemoApiClient::CompanyResponse readonly
- #created_at ⇒ DateTime readonly
- #data ⇒ NewDemoApiClient::DealDataAvailablityResponse readonly
- #files ⇒ Array<NewDemoApiClient::FileResponse> readonly
- #id ⇒ Integer readonly
- #is_archived ⇒ Boolean readonly
- #name ⇒ String readonly
-
#notes ⇒ String
readonly
Notes about the deal.
-
#priority ⇒ NewDemoApiClient::Priority
readonly
The priority of the deal.
-
#round_amount ⇒ Integer
readonly
The dollar amount to be raised of the round.
-
#round_name ⇒ String
readonly
The name of the round.
-
#round_target ⇒ Integer
readonly
The target post-money dollar amount of the round.
-
#status ⇒ NewDemoApiClient::Status
readonly
The status of the deal.
-
#tags ⇒ Array<String>
readonly
The tags associated with the deal.
- #updated_at ⇒ DateTime readonly
Class Method Summary collapse
-
.from_json(json_object:) ⇒ NewDemoApiClient::DealWithFilesResponse
Deserialize a JSON object to an instance of DealWithFilesResponse.
-
.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:, round_name:, status:, id:, company:, notes: OMIT, priority: OMIT, round_amount: OMIT, round_target: OMIT, tags: OMIT, created_at: OMIT, updated_at: OMIT, is_archived: OMIT, files: OMIT, data: OMIT, additional_properties: nil) ⇒ NewDemoApiClient::DealWithFilesResponse constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of DealWithFilesResponse to a JSON object.
Constructor Details
#initialize(name:, round_name:, status:, id:, company:, notes: OMIT, priority: OMIT, round_amount: OMIT, round_target: OMIT, tags: OMIT, created_at: OMIT, updated_at: OMIT, is_archived: OMIT, files: OMIT, data: OMIT, additional_properties: nil) ⇒ NewDemoApiClient::DealWithFilesResponse
69 70 71 72 73 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 102 103 104 105 106 |
# File 'lib/test_sdk/types/deal_with_files_response.rb', line 69 def initialize(name:, round_name:, status:, id:, company:, notes: OMIT, priority: OMIT, round_amount: OMIT, round_target: OMIT, tags: OMIT, created_at: OMIT, updated_at: OMIT, is_archived: OMIT, files: OMIT, data: OMIT, additional_properties: nil) @name = name @round_name = round_name @status = status @notes = notes if notes != OMIT @priority = priority if priority != OMIT @round_amount = round_amount if round_amount != OMIT @round_target = round_target if round_target != OMIT @tags = if != 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 @company = company @files = files if files != OMIT @data = data if data != OMIT @additional_properties = additional_properties @_field_set = { "name": name, "round_name": round_name, "status": status, "notes": notes, "priority": priority, "round_amount": round_amount, "round_target": round_target, "tags": , "id": id, "created_at": created_at, "updated_at": updated_at, "is_archived": is_archived, "company": company, "files": files, "data": data }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
45 46 47 |
# File 'lib/test_sdk/types/deal_with_files_response.rb', line 45 def additional_properties @additional_properties end |
#company ⇒ NewDemoApiClient::CompanyResponse (readonly)
39 40 41 |
# File 'lib/test_sdk/types/deal_with_files_response.rb', line 39 def company @company end |
#created_at ⇒ DateTime (readonly)
33 34 35 |
# File 'lib/test_sdk/types/deal_with_files_response.rb', line 33 def created_at @created_at end |
#data ⇒ NewDemoApiClient::DealDataAvailablityResponse (readonly)
43 44 45 |
# File 'lib/test_sdk/types/deal_with_files_response.rb', line 43 def data @data end |
#files ⇒ Array<NewDemoApiClient::FileResponse> (readonly)
41 42 43 |
# File 'lib/test_sdk/types/deal_with_files_response.rb', line 41 def files @files end |
#id ⇒ Integer (readonly)
31 32 33 |
# File 'lib/test_sdk/types/deal_with_files_response.rb', line 31 def id @id end |
#is_archived ⇒ Boolean (readonly)
37 38 39 |
# File 'lib/test_sdk/types/deal_with_files_response.rb', line 37 def is_archived @is_archived end |
#name ⇒ String (readonly)
15 16 17 |
# File 'lib/test_sdk/types/deal_with_files_response.rb', line 15 def name @name end |
#notes ⇒ String (readonly)
Returns Notes about the deal.
21 22 23 |
# File 'lib/test_sdk/types/deal_with_files_response.rb', line 21 def notes @notes end |
#priority ⇒ NewDemoApiClient::Priority (readonly)
Returns The priority of the deal.
23 24 25 |
# File 'lib/test_sdk/types/deal_with_files_response.rb', line 23 def priority @priority end |
#round_amount ⇒ Integer (readonly)
Returns The dollar amount to be raised of the round.
25 26 27 |
# File 'lib/test_sdk/types/deal_with_files_response.rb', line 25 def round_amount @round_amount end |
#round_name ⇒ String (readonly)
Returns The name of the round.
17 18 19 |
# File 'lib/test_sdk/types/deal_with_files_response.rb', line 17 def round_name @round_name end |
#round_target ⇒ Integer (readonly)
Returns The target post-money dollar amount of the round.
27 28 29 |
# File 'lib/test_sdk/types/deal_with_files_response.rb', line 27 def round_target @round_target end |
#status ⇒ NewDemoApiClient::Status (readonly)
Returns The status of the deal.
19 20 21 |
# File 'lib/test_sdk/types/deal_with_files_response.rb', line 19 def status @status end |
#tags ⇒ Array<String> (readonly)
Returns The tags associated with the deal.
29 30 31 |
# File 'lib/test_sdk/types/deal_with_files_response.rb', line 29 def @tags end |
#updated_at ⇒ DateTime (readonly)
35 36 37 |
# File 'lib/test_sdk/types/deal_with_files_response.rb', line 35 def updated_at @updated_at end |
Class Method Details
.from_json(json_object:) ⇒ NewDemoApiClient::DealWithFilesResponse
Deserialize a JSON object to an instance of DealWithFilesResponse
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 |
# File 'lib/test_sdk/types/deal_with_files_response.rb', line 112 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) name = parsed_json["name"] round_name = parsed_json["round_name"] status = parsed_json["status"] notes = parsed_json["notes"] priority = parsed_json["priority"] round_amount = parsed_json["round_amount"] round_target = parsed_json["round_target"] = parsed_json["tags"] 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"] if parsed_json["company"].nil? company = nil else company = parsed_json["company"].to_json company = NewDemoApiClient::CompanyResponse.from_json(json_object: company) end files = parsed_json["files"]&.map do |item| item = item.to_json NewDemoApiClient::FileResponse.from_json(json_object: item) end if parsed_json["data"].nil? data = nil else data = parsed_json["data"].to_json data = NewDemoApiClient::DealDataAvailablityResponse.from_json(json_object: data) end new( name: name, round_name: round_name, status: status, notes: notes, priority: priority, round_amount: round_amount, round_target: round_target, tags: , id: id, created_at: created_at, updated_at: updated_at, is_archived: is_archived, company: company, files: files, data: data, 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.
176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 |
# File 'lib/test_sdk/types/deal_with_files_response.rb', line 176 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.round_name.is_a?(String) != false || raise("Passed value for field obj.round_name is not the expected type, validation failed.") obj.status.is_a?(NewDemoApiClient::Status) != false || raise("Passed value for field obj.status is not the expected type, validation failed.") obj.notes&.is_a?(String) != false || raise("Passed value for field obj.notes is not the expected type, validation failed.") obj.priority&.is_a?(NewDemoApiClient::Priority) != false || raise("Passed value for field obj.priority is not the expected type, validation failed.") obj.round_amount&.is_a?(Integer) != false || raise("Passed value for field obj.round_amount is not the expected type, validation failed.") obj.round_target&.is_a?(Integer) != false || raise("Passed value for field obj.round_target is not the expected type, validation failed.") obj.&.is_a?(Array) != false || raise("Passed value for field obj.tags 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.") NewDemoApiClient::CompanyResponse.validate_raw(obj: obj.company) obj.files&.is_a?(Array) != false || raise("Passed value for field obj.files is not the expected type, validation failed.") obj.data.nil? || NewDemoApiClient::DealDataAvailablityResponse.validate_raw(obj: obj.data) end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of DealWithFilesResponse to a JSON object
166 167 168 |
# File 'lib/test_sdk/types/deal_with_files_response.rb', line 166 def to_json(*_args) @_field_set&.to_json end |