Class: NewDemoApiClient::DealWithFilesResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/test_sdk/types/deal_with_files_response.rb

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

Parameters:

  • name (String)
  • round_name (String)

    The name of the round

  • status (NewDemoApiClient::Status)

    The status of the deal

  • notes (String) (defaults to: OMIT)

    Notes about the deal

  • priority (NewDemoApiClient::Priority) (defaults to: OMIT)

    The priority of the deal

  • round_amount (Integer) (defaults to: OMIT)

    The dollar amount to be raised of the round

  • round_target (Integer) (defaults to: OMIT)

    The target post-money dollar amount of the round

  • tags (Array<String>) (defaults to: OMIT)

    The tags associated with the deal

  • id (Integer)
  • created_at (DateTime) (defaults to: OMIT)
  • updated_at (DateTime) (defaults to: OMIT)
  • is_archived (Boolean) (defaults to: OMIT)
  • company (NewDemoApiClient::CompanyResponse)
  • files (Array<NewDemoApiClient::FileResponse>) (defaults to: OMIT)
  • data (NewDemoApiClient::DealDataAvailablityResponse) (defaults to: OMIT)
  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



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 = tags if tags != 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": 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_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    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

#companyNewDemoApiClient::CompanyResponse (readonly)



39
40
41
# File 'lib/test_sdk/types/deal_with_files_response.rb', line 39

def company
  @company
end

#created_atDateTime (readonly)

Returns:

  • (DateTime)


33
34
35
# File 'lib/test_sdk/types/deal_with_files_response.rb', line 33

def created_at
  @created_at
end

#dataNewDemoApiClient::DealDataAvailablityResponse (readonly)



43
44
45
# File 'lib/test_sdk/types/deal_with_files_response.rb', line 43

def data
  @data
end

#filesArray<NewDemoApiClient::FileResponse> (readonly)

Returns:



41
42
43
# File 'lib/test_sdk/types/deal_with_files_response.rb', line 41

def files
  @files
end

#idInteger (readonly)

Returns:

  • (Integer)


31
32
33
# File 'lib/test_sdk/types/deal_with_files_response.rb', line 31

def id
  @id
end

#is_archivedBoolean (readonly)

Returns:

  • (Boolean)


37
38
39
# File 'lib/test_sdk/types/deal_with_files_response.rb', line 37

def is_archived
  @is_archived
end

#nameString (readonly)

Returns:

  • (String)


15
16
17
# File 'lib/test_sdk/types/deal_with_files_response.rb', line 15

def name
  @name
end

#notesString (readonly)

Returns Notes about the deal.

Returns:

  • (String)

    Notes about the deal



21
22
23
# File 'lib/test_sdk/types/deal_with_files_response.rb', line 21

def notes
  @notes
end

#priorityNewDemoApiClient::Priority (readonly)

Returns The priority of the deal.

Returns:



23
24
25
# File 'lib/test_sdk/types/deal_with_files_response.rb', line 23

def priority
  @priority
end

#round_amountInteger (readonly)

Returns The dollar amount to be raised of the round.

Returns:

  • (Integer)

    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_nameString (readonly)

Returns The name of the round.

Returns:

  • (String)

    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_targetInteger (readonly)

Returns The target post-money dollar amount of the round.

Returns:

  • (Integer)

    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

#statusNewDemoApiClient::Status (readonly)

Returns The status of the deal.

Returns:



19
20
21
# File 'lib/test_sdk/types/deal_with_files_response.rb', line 19

def status
  @status
end

#tagsArray<String> (readonly)

Returns The tags associated with the deal.

Returns:

  • (Array<String>)

    The tags associated with the deal



29
30
31
# File 'lib/test_sdk/types/deal_with_files_response.rb', line 29

def tags
  @tags
end

#updated_atDateTime (readonly)

Returns:

  • (DateTime)


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

Parameters:

  • json_object (String)

Returns:



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"]
  tags = 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: 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.

Parameters:

  • obj (Object)

Returns:

  • (Void)


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.tags&.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

Returns:

  • (String)


166
167
168
# File 'lib/test_sdk/types/deal_with_files_response.rb', line 166

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