Class: Buildium::RentalUnitsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/buildium-ruby/api/rental_units_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ RentalUnitsApi

Returns a new instance of RentalUnitsApi.



19
20
21
# File 'lib/buildium-ruby/api/rental_units_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/buildium-ruby/api/rental_units_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#create_rental_unit(rental_units_post_message, opts = {}) ⇒ RentalUnitMessage

Create a unit Creates a rental unit. <br /><br /><h4>Required permission(s):</h4><span class="permissionBlock">Rentals &gt; Rental properties and units</span> - ‘View` `Edit`

Parameters:

  • rental_units_post_message (RentalUnitsPostMessage)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



27
28
29
30
# File 'lib/buildium-ruby/api/rental_units_api.rb', line 27

def create_rental_unit(rental_units_post_message, opts = {})
  data, _status_code, _headers = create_rental_unit_with_http_info(rental_units_post_message, opts)
  data
end

#create_rental_unit_image_upload_file_request_async(unit_id, listing_entity_file_post_message, opts = {}) ⇒ FileUploadTicketMessage

Upload a unit image Uploads an image and associates it to the specified unit record. <br /><br />Uploading a file requires making two API requests. Each step is outlined below. <br /><br /><strong>Step 1 - Save file metadata</strong><br /> The first step in the file upload process is to submit the file metadata to ‘/v1/rentals/units/unitId:int/images/uploadrequests`. The response of this call will contain a URL and a collection of form data that will be used in step 2 to generate the request for the file binary upload. <br /><br /><strong>NOTE:</strong> The response data will expire after 5 minutes. The file metadata will not be saved in the Buildium system if step 2 of this process is not completed successfully. <br /><br /><strong>Step 2 - Upload the file binary</strong><br /> Uploading the file binary will require using the response from step 1 to form a POST request to the Buildium file provider. Follow these steps to create the request: <br /> 1. Form a POST request using the value of the `BucketUrl` property as the URL. <br /><br /> 2. Set the `Content-Type` header to `multipart/form-data`. <br /><br /> 3. Copy the fields from the `FormData` property to this request as form-data key/value pairs. <br /><strong>NOTE:</strong> These values must added to the request form-data in the order they were received in the response. <br /><br /> 4. Lastly create a form-data key named `file` and set the value to the file binary. <br /><strong>NOTE:</strong> This must be the last field in the form-data list. <br /><br />This image shows what the POST request should look like if you’re using Postman: <img src="file-upload-example.png" /><br /><br /> 5. Send the POST request! A successful request will return with a ‘204 - NO CONTENT` HTTP response code. For any failure responses, please refer to <a target="_blank" href="docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#RESTErrorResponses">AWS documentation</a> on REST error responses. <br /><br /><strong>NOTE:</strong> The file identifier is not generated in this response. To retrieve the file identifier, call `/v1/files` and pass the `PhysicalFileName` value received from the response of this endpoint into the `physicalfilenames` query parameter. <br /><br /><h4>Required permission(s):</h4><span class="permissionBlock">Rentals &gt; Rental properties and units</span> - `View` `Edit`

Parameters:

  • unit_id (Integer)
  • listing_entity_file_post_message (ListingEntityFilePostMessage)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



96
97
98
99
# File 'lib/buildium-ruby/api/rental_units_api.rb', line 96

def create_rental_unit_image_upload_file_request_async(unit_id, listing_entity_file_post_message, opts = {})
  data, _status_code, _headers = create_rental_unit_image_upload_file_request_async_with_http_info(unit_id, listing_entity_file_post_message, opts)
  data
end

#create_rental_unit_image_upload_file_request_async_with_http_info(unit_id, listing_entity_file_post_message, opts = {}) ⇒ Array<(FileUploadTicketMessage, Integer, Hash)>

Upload a unit image Uploads an image and associates it to the specified unit record. &lt;br /&gt;&lt;br /&gt;Uploading a file requires making two API requests. Each step is outlined below. &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Step 1 - Save file metadata&lt;/strong&gt;&lt;br /&gt; The first step in the file upload process is to submit the file metadata to &#x60;/v1/rentals/units/unitId:int/images/uploadrequests&#x60;. The response of this call will contain a URL and a collection of form data that will be used in step 2 to generate the request for the file binary upload. &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; The response data will expire after 5 minutes. The file metadata will not be saved in the Buildium system if step 2 of this process is not completed successfully. &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Step 2 - Upload the file binary&lt;/strong&gt;&lt;br /&gt; Uploading the file binary will require using the response from step 1 to form a POST request to the Buildium file provider. Follow these steps to create the request: &lt;br /&gt; 1. Form a POST request using the value of the &#x60;BucketUrl&#x60; property as the URL. &lt;br /&gt;&lt;br /&gt; 2. Set the &#x60;Content-Type&#x60; header to &#x60;multipart/form-data&#x60;. &lt;br /&gt;&lt;br /&gt; 3. Copy the fields from the &#x60;FormData&#x60; property to this request as form-data key/value pairs. &lt;br /&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; These values must added to the request form-data in the order they were received in the response. &lt;br /&gt;&lt;br /&gt; 4. Lastly create a form-data key named &#x60;file&#x60; and set the value to the file binary. &lt;br /&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; This must be the last field in the form-data list. &lt;br /&gt;&lt;br /&gt;This image shows what the POST request should look like if you&#39;re using Postman: &lt;img src&#x3D;&quot;file-upload-example.png&quot; /&gt;&lt;br /&gt;&lt;br /&gt; 5. Send the POST request! A successful request will return with a &#x60;204 - NO CONTENT&#x60; HTTP response code. For any failure responses, please refer to &lt;a target&#x3D;&quot;_blank&quot; href&#x3D;&quot;docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#RESTErrorResponses&quot;&gt;AWS documentation&lt;/a&gt; on REST error responses. &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; The file identifier is not generated in this response. To retrieve the file identifier, call &#x60;/v1/files&#x60; and pass the &#x60;PhysicalFileName&#x60; value received from the response of this endpoint into the &#x60;physicalfilenames&#x60; query parameter. &lt;br /&gt;&lt;br /&gt;&lt;h4&gt;Required permission(s):&lt;/h4&gt;&lt;span class&#x3D;&quot;permissionBlock&quot;&gt;Rentals &amp;gt; Rental properties and units&lt;/span&gt; - &#x60;View&#x60; &#x60;Edit&#x60;

Parameters:

  • unit_id (Integer)
  • listing_entity_file_post_message (ListingEntityFilePostMessage)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(FileUploadTicketMessage, Integer, Hash)>)

    FileUploadTicketMessage data, response status code and response headers



107
108
109
110
111
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
162
# File 'lib/buildium-ruby/api/rental_units_api.rb', line 107

def create_rental_unit_image_upload_file_request_async_with_http_info(unit_id, listing_entity_file_post_message, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RentalUnitsApi.create_rental_unit_image_upload_file_request_async ...'
  end
  # verify the required parameter 'unit_id' is set
  if @api_client.config.client_side_validation && unit_id.nil?
    fail ArgumentError, "Missing the required parameter 'unit_id' when calling RentalUnitsApi.create_rental_unit_image_upload_file_request_async"
  end
  # verify the required parameter 'listing_entity_file_post_message' is set
  if @api_client.config.client_side_validation && listing_entity_file_post_message.nil?
    fail ArgumentError, "Missing the required parameter 'listing_entity_file_post_message' when calling RentalUnitsApi.create_rental_unit_image_upload_file_request_async"
  end
  # resource path
  local_var_path = '/v1/rentals/units/{unitId}/images/uploadrequests'.sub('{' + 'unitId' + '}', CGI.escape(unit_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
    header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(listing_entity_file_post_message)

  # return_type
  return_type = opts[:debug_return_type] || 'FileUploadTicketMessage'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['clientId', 'clientSecret']

  new_options = opts.merge(
    :operation => :"RentalUnitsApi.create_rental_unit_image_upload_file_request_async",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: RentalUnitsApi#create_rental_unit_image_upload_file_request_async\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_rental_unit_note(unit_id, note_post_message, opts = {}) ⇒ NoteMessage

Create a note Creates a rental unit note. <br /><br /><h4>Required permission(s):</h4><span class="permissionBlock">Rentals &gt; Rental properties and units</span> - ‘View` `Edit`

Parameters:

  • unit_id (Integer)
  • note_post_message (NotePostMessage)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



170
171
172
173
# File 'lib/buildium-ruby/api/rental_units_api.rb', line 170

def create_rental_unit_note(unit_id, note_post_message, opts = {})
  data, _status_code, _headers = create_rental_unit_note_with_http_info(unit_id, note_post_message, opts)
  data
end

#create_rental_unit_note_with_http_info(unit_id, note_post_message, opts = {}) ⇒ Array<(NoteMessage, Integer, Hash)>

Create a note Creates a rental unit note. &lt;br /&gt;&lt;br /&gt;&lt;h4&gt;Required permission(s):&lt;/h4&gt;&lt;span class&#x3D;&quot;permissionBlock&quot;&gt;Rentals &amp;gt; Rental properties and units&lt;/span&gt; - &#x60;View&#x60; &#x60;Edit&#x60;

Parameters:

  • unit_id (Integer)
  • note_post_message (NotePostMessage)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(NoteMessage, Integer, Hash)>)

    NoteMessage data, response status code and response headers



181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
# File 'lib/buildium-ruby/api/rental_units_api.rb', line 181

def create_rental_unit_note_with_http_info(unit_id, note_post_message, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RentalUnitsApi.create_rental_unit_note ...'
  end
  # verify the required parameter 'unit_id' is set
  if @api_client.config.client_side_validation && unit_id.nil?
    fail ArgumentError, "Missing the required parameter 'unit_id' when calling RentalUnitsApi.create_rental_unit_note"
  end
  # verify the required parameter 'note_post_message' is set
  if @api_client.config.client_side_validation && note_post_message.nil?
    fail ArgumentError, "Missing the required parameter 'note_post_message' when calling RentalUnitsApi.create_rental_unit_note"
  end
  # resource path
  local_var_path = '/v1/rentals/units/{unitId}/notes'.sub('{' + 'unitId' + '}', CGI.escape(unit_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
    header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(note_post_message)

  # return_type
  return_type = opts[:debug_return_type] || 'NoteMessage'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['clientId', 'clientSecret']

  new_options = opts.merge(
    :operation => :"RentalUnitsApi.create_rental_unit_note",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: RentalUnitsApi#create_rental_unit_note\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_rental_unit_with_http_info(rental_units_post_message, opts = {}) ⇒ Array<(RentalUnitMessage, Integer, Hash)>

Create a unit Creates a rental unit. &lt;br /&gt;&lt;br /&gt;&lt;h4&gt;Required permission(s):&lt;/h4&gt;&lt;span class&#x3D;&quot;permissionBlock&quot;&gt;Rentals &amp;gt; Rental properties and units&lt;/span&gt; - &#x60;View&#x60; &#x60;Edit&#x60;

Parameters:

  • rental_units_post_message (RentalUnitsPostMessage)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(RentalUnitMessage, Integer, Hash)>)

    RentalUnitMessage data, response status code and response headers



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/buildium-ruby/api/rental_units_api.rb', line 37

def create_rental_unit_with_http_info(rental_units_post_message, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RentalUnitsApi.create_rental_unit ...'
  end
  # verify the required parameter 'rental_units_post_message' is set
  if @api_client.config.client_side_validation && rental_units_post_message.nil?
    fail ArgumentError, "Missing the required parameter 'rental_units_post_message' when calling RentalUnitsApi.create_rental_unit"
  end
  # resource path
  local_var_path = '/v1/rentals/units'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
    header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(rental_units_post_message)

  # return_type
  return_type = opts[:debug_return_type] || 'RentalUnitMessage'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['clientId', 'clientSecret']

  new_options = opts.merge(
    :operation => :"RentalUnitsApi.create_rental_unit",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: RentalUnitsApi#create_rental_unit\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

Create an image for a unit using a video link Creates an image for a rental unit using a video link. <br /><br /><h4>Required permission(s):</h4><span class="permissionBlock">Rentals &gt; Properties and units</span> - ‘View` `Edit`

Parameters:

  • unit_id (Integer)
  • video_link_request_post_message (VideoLinkRequestPostMessage)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



244
245
246
247
# File 'lib/buildium-ruby/api/rental_units_api.rb', line 244

def create_unit_video_link_request(unit_id, video_link_request_post_message, opts = {})
  data, _status_code, _headers = create_unit_video_link_request_with_http_info(unit_id, video_link_request_post_message, opts)
  data
end

Create an image for a unit using a video link Creates an image for a rental unit using a video link. &lt;br /&gt;&lt;br /&gt;&lt;h4&gt;Required permission(s):&lt;/h4&gt;&lt;span class&#x3D;&quot;permissionBlock&quot;&gt;Rentals &amp;gt; Properties and units&lt;/span&gt; - &#x60;View&#x60; &#x60;Edit&#x60;

Parameters:

  • unit_id (Integer)
  • video_link_request_post_message (VideoLinkRequestPostMessage)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(RentalUnitImageMessage, Integer, Hash)>)

    RentalUnitImageMessage data, response status code and response headers



255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
# File 'lib/buildium-ruby/api/rental_units_api.rb', line 255

def create_unit_video_link_request_with_http_info(unit_id, video_link_request_post_message, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RentalUnitsApi.create_unit_video_link_request ...'
  end
  # verify the required parameter 'unit_id' is set
  if @api_client.config.client_side_validation && unit_id.nil?
    fail ArgumentError, "Missing the required parameter 'unit_id' when calling RentalUnitsApi.create_unit_video_link_request"
  end
  # verify the required parameter 'video_link_request_post_message' is set
  if @api_client.config.client_side_validation && video_link_request_post_message.nil?
    fail ArgumentError, "Missing the required parameter 'video_link_request_post_message' when calling RentalUnitsApi.create_unit_video_link_request"
  end
  # resource path
  local_var_path = '/v1/rentals/units/{unitId}/images/videolinkrequests'.sub('{' + 'unitId' + '}', CGI.escape(unit_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
    header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(video_link_request_post_message)

  # return_type
  return_type = opts[:debug_return_type] || 'RentalUnitImageMessage'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['clientId', 'clientSecret']

  new_options = opts.merge(
    :operation => :"RentalUnitsApi.create_unit_video_link_request",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: RentalUnitsApi#create_unit_video_link_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_rental_unit_image(unit_id, image_id, opts = {}) ⇒ nil

Delete a unit image Deletes a unit image. <br /><br /><h4>Required permission(s):</h4><span class="permissionBlock">Rentals &gt; Rental properties and units</span> - ‘View` `Edit` `Delete`

Parameters:

  • unit_id (Integer)
  • image_id (Integer)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


318
319
320
321
# File 'lib/buildium-ruby/api/rental_units_api.rb', line 318

def delete_rental_unit_image(unit_id, image_id, opts = {})
  delete_rental_unit_image_with_http_info(unit_id, image_id, opts)
  nil
end

#delete_rental_unit_image_with_http_info(unit_id, image_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete a unit image Deletes a unit image. &lt;br /&gt;&lt;br /&gt;&lt;h4&gt;Required permission(s):&lt;/h4&gt;&lt;span class&#x3D;&quot;permissionBlock&quot;&gt;Rentals &amp;gt; Rental properties and units&lt;/span&gt; - &#x60;View&#x60; &#x60;Edit&#x60; &#x60;Delete&#x60;

Parameters:

  • unit_id (Integer)
  • image_id (Integer)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
# File 'lib/buildium-ruby/api/rental_units_api.rb', line 329

def delete_rental_unit_image_with_http_info(unit_id, image_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RentalUnitsApi.delete_rental_unit_image ...'
  end
  # verify the required parameter 'unit_id' is set
  if @api_client.config.client_side_validation && unit_id.nil?
    fail ArgumentError, "Missing the required parameter 'unit_id' when calling RentalUnitsApi.delete_rental_unit_image"
  end
  # verify the required parameter 'image_id' is set
  if @api_client.config.client_side_validation && image_id.nil?
    fail ArgumentError, "Missing the required parameter 'image_id' when calling RentalUnitsApi.delete_rental_unit_image"
  end
  # resource path
  local_var_path = '/v1/rentals/units/{unitId}/images/{imageId}'.sub('{' + 'unitId' + '}', CGI.escape(unit_id.to_s)).sub('{' + 'imageId' + '}', CGI.escape(image_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['clientId', 'clientSecret']

  new_options = opts.merge(
    :operation => :"RentalUnitsApi.delete_rental_unit_image",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: RentalUnitsApi#delete_rental_unit_image\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_all_rental_units(opts = {}) ⇒ Array<RentalUnitMessage>

Retrieve all units Retrieves a list of rental property units. <br /><br /><h4>Required permission(s):</h4><span class="permissionBlock">Rentals &gt; Rental properties and units</span> - ‘View`

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :propertyids (Array<Integer>)

    Filters results to rental units that belong to the specified set of property ids.

  • :lastupdatedfrom (Time)

    Filters results to any rental units that were updated on or after the specified date. The value must be in UTC and formatted as YYYY-MM-DDTHH:MM:SSZ.

  • :lastupdatedto (Time)

    Filters results to any rental units that were updated on or before the specified date. The value must be in UTC and formatted as YYYY-MM-DDTHH:MM:SSZ.

  • :orderby (String)

    &#x60;orderby&#x60; indicates the field(s) and direction to sort the results in the response. See &lt;a href&#x3D;&quot;#section/API-Overview/Bulk-Request-Options&quot;&gt;Bulk Request Options&lt;/a&gt; for more information.

  • :offset (Integer)

    &#x60;offset&#x60; indicates the position of the first record to return. The &#x60;offset&#x60; is zero-based and the default is 0.

  • :limit (Integer)

    &#x60;limit&#x60; indicates the maximum number of results to be returned in the response. &#x60;limit&#x60; can range between 1 and 1000 and the default is 50.

Returns:



391
392
393
394
# File 'lib/buildium-ruby/api/rental_units_api.rb', line 391

def get_all_rental_units(opts = {})
  data, _status_code, _headers = get_all_rental_units_with_http_info(opts)
  data
end

#get_all_rental_units_with_http_info(opts = {}) ⇒ Array<(Array<RentalUnitMessage>, Integer, Hash)>

Retrieve all units Retrieves a list of rental property units. &lt;br /&gt;&lt;br /&gt;&lt;h4&gt;Required permission(s):&lt;/h4&gt;&lt;span class&#x3D;&quot;permissionBlock&quot;&gt;Rentals &amp;gt; Rental properties and units&lt;/span&gt; - &#x60;View&#x60;

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :propertyids (Array<Integer>)

    Filters results to rental units that belong to the specified set of property ids.

  • :lastupdatedfrom (Time)

    Filters results to any rental units that were updated on or after the specified date. The value must be in UTC and formatted as YYYY-MM-DDTHH:MM:SSZ.

  • :lastupdatedto (Time)

    Filters results to any rental units that were updated on or before the specified date. The value must be in UTC and formatted as YYYY-MM-DDTHH:MM:SSZ.

  • :orderby (String)

    &#x60;orderby&#x60; indicates the field(s) and direction to sort the results in the response. See &lt;a href&#x3D;&quot;#section/API-Overview/Bulk-Request-Options&quot;&gt;Bulk Request Options&lt;/a&gt; for more information.

  • :offset (Integer)

    &#x60;offset&#x60; indicates the position of the first record to return. The &#x60;offset&#x60; is zero-based and the default is 0.

  • :limit (Integer)

    &#x60;limit&#x60; indicates the maximum number of results to be returned in the response. &#x60;limit&#x60; can range between 1 and 1000 and the default is 50.

Returns:

  • (Array<(Array<RentalUnitMessage>, Integer, Hash)>)

    Array<RentalUnitMessage> data, response status code and response headers



406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
# File 'lib/buildium-ruby/api/rental_units_api.rb', line 406

def get_all_rental_units_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RentalUnitsApi.get_all_rental_units ...'
  end
  # resource path
  local_var_path = '/v1/rentals/units'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'propertyids'] = @api_client.build_collection_param(opts[:'propertyids'], :multi) if !opts[:'propertyids'].nil?
  query_params[:'lastupdatedfrom'] = opts[:'lastupdatedfrom'] if !opts[:'lastupdatedfrom'].nil?
  query_params[:'lastupdatedto'] = opts[:'lastupdatedto'] if !opts[:'lastupdatedto'].nil?
  query_params[:'orderby'] = opts[:'orderby'] if !opts[:'orderby'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Array<RentalUnitMessage>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['clientId', 'clientSecret']

  new_options = opts.merge(
    :operation => :"RentalUnitsApi.get_all_rental_units",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: RentalUnitsApi#get_all_rental_units\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_features_for_rental_unit_by_id(unit_id, opts = {}) ⇒ RentalUnitFeaturesMessage

Retrieve all amenities Retrieves all amenities for a rental unit. <br /><br /><h4>Required permission(s):</h4><span class="permissionBlock">Rentals &gt; Rental properties and units</span> - ‘View`

Parameters:

  • unit_id (Integer)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



461
462
463
464
# File 'lib/buildium-ruby/api/rental_units_api.rb', line 461

def get_features_for_rental_unit_by_id(unit_id, opts = {})
  data, _status_code, _headers = get_features_for_rental_unit_by_id_with_http_info(unit_id, opts)
  data
end

#get_features_for_rental_unit_by_id_with_http_info(unit_id, opts = {}) ⇒ Array<(RentalUnitFeaturesMessage, Integer, Hash)>

Retrieve all amenities Retrieves all amenities for a rental unit. &lt;br /&gt;&lt;br /&gt;&lt;h4&gt;Required permission(s):&lt;/h4&gt;&lt;span class&#x3D;&quot;permissionBlock&quot;&gt;Rentals &amp;gt; Rental properties and units&lt;/span&gt; - &#x60;View&#x60;

Parameters:

  • unit_id (Integer)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(RentalUnitFeaturesMessage, Integer, Hash)>)

    RentalUnitFeaturesMessage data, response status code and response headers



471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
# File 'lib/buildium-ruby/api/rental_units_api.rb', line 471

def get_features_for_rental_unit_by_id_with_http_info(unit_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RentalUnitsApi.get_features_for_rental_unit_by_id ...'
  end
  # verify the required parameter 'unit_id' is set
  if @api_client.config.client_side_validation && unit_id.nil?
    fail ArgumentError, "Missing the required parameter 'unit_id' when calling RentalUnitsApi.get_features_for_rental_unit_by_id"
  end
  # resource path
  local_var_path = '/v1/rentals/units/{unitId}/amenities'.sub('{' + 'unitId' + '}', CGI.escape(unit_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'RentalUnitFeaturesMessage'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['clientId', 'clientSecret']

  new_options = opts.merge(
    :operation => :"RentalUnitsApi.get_features_for_rental_unit_by_id",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: RentalUnitsApi#get_features_for_rental_unit_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_rental_unit_by_id(unit_id, opts = {}) ⇒ RentalUnitMessage

Retrieve a unit Retrieves a specific rental property unit. <br /><br /><h4>Required permission(s):</h4><span class="permissionBlock">Rentals &gt; Rental properties and units</span> - ‘View`

Parameters:

  • unit_id (Integer)

    The rental unit identifier.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



524
525
526
527
# File 'lib/buildium-ruby/api/rental_units_api.rb', line 524

def get_rental_unit_by_id(unit_id, opts = {})
  data, _status_code, _headers = get_rental_unit_by_id_with_http_info(unit_id, opts)
  data
end

#get_rental_unit_by_id_with_http_info(unit_id, opts = {}) ⇒ Array<(RentalUnitMessage, Integer, Hash)>

Retrieve a unit Retrieves a specific rental property unit. &lt;br /&gt;&lt;br /&gt;&lt;h4&gt;Required permission(s):&lt;/h4&gt;&lt;span class&#x3D;&quot;permissionBlock&quot;&gt;Rentals &amp;gt; Rental properties and units&lt;/span&gt; - &#x60;View&#x60;

Parameters:

  • unit_id (Integer)

    The rental unit identifier.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(RentalUnitMessage, Integer, Hash)>)

    RentalUnitMessage data, response status code and response headers



534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
# File 'lib/buildium-ruby/api/rental_units_api.rb', line 534

def get_rental_unit_by_id_with_http_info(unit_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RentalUnitsApi.get_rental_unit_by_id ...'
  end
  # verify the required parameter 'unit_id' is set
  if @api_client.config.client_side_validation && unit_id.nil?
    fail ArgumentError, "Missing the required parameter 'unit_id' when calling RentalUnitsApi.get_rental_unit_by_id"
  end
  # resource path
  local_var_path = '/v1/rentals/units/{unitId}'.sub('{' + 'unitId' + '}', CGI.escape(unit_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'RentalUnitMessage'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['clientId', 'clientSecret']

  new_options = opts.merge(
    :operation => :"RentalUnitsApi.get_rental_unit_by_id",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: RentalUnitsApi#get_rental_unit_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_rental_unit_image_by_id(unit_id, image_id, opts = {}) ⇒ RentalUnitImageMessage

Retrieve a unit image Retrieves a unit image. <br /><br /><h4>Required permission(s):</h4><span class="permissionBlock">Rentals &gt; Rental properties and units</span> - ‘View`

Parameters:

  • unit_id (Integer)
  • image_id (Integer)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



588
589
590
591
# File 'lib/buildium-ruby/api/rental_units_api.rb', line 588

def get_rental_unit_image_by_id(unit_id, image_id, opts = {})
  data, _status_code, _headers = get_rental_unit_image_by_id_with_http_info(unit_id, image_id, opts)
  data
end

#get_rental_unit_image_by_id_with_http_info(unit_id, image_id, opts = {}) ⇒ Array<(RentalUnitImageMessage, Integer, Hash)>

Retrieve a unit image Retrieves a unit image. &lt;br /&gt;&lt;br /&gt;&lt;h4&gt;Required permission(s):&lt;/h4&gt;&lt;span class&#x3D;&quot;permissionBlock&quot;&gt;Rentals &amp;gt; Rental properties and units&lt;/span&gt; - &#x60;View&#x60;

Parameters:

  • unit_id (Integer)
  • image_id (Integer)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(RentalUnitImageMessage, Integer, Hash)>)

    RentalUnitImageMessage data, response status code and response headers



599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
# File 'lib/buildium-ruby/api/rental_units_api.rb', line 599

def get_rental_unit_image_by_id_with_http_info(unit_id, image_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RentalUnitsApi.get_rental_unit_image_by_id ...'
  end
  # verify the required parameter 'unit_id' is set
  if @api_client.config.client_side_validation && unit_id.nil?
    fail ArgumentError, "Missing the required parameter 'unit_id' when calling RentalUnitsApi.get_rental_unit_image_by_id"
  end
  # verify the required parameter 'image_id' is set
  if @api_client.config.client_side_validation && image_id.nil?
    fail ArgumentError, "Missing the required parameter 'image_id' when calling RentalUnitsApi.get_rental_unit_image_by_id"
  end
  # resource path
  local_var_path = '/v1/rentals/units/{unitId}/images/{imageId}'.sub('{' + 'unitId' + '}', CGI.escape(unit_id.to_s)).sub('{' + 'imageId' + '}', CGI.escape(image_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'RentalUnitImageMessage'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['clientId', 'clientSecret']

  new_options = opts.merge(
    :operation => :"RentalUnitsApi.get_rental_unit_image_by_id",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: RentalUnitsApi#get_rental_unit_image_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_rental_unit_image_download_url_by_id(unit_id, image_id, opts = {}) ⇒ FileDownloadMessage

Download a unit image Use this endpoint to create a temporary URL that can be used to download a unit image. This URL expires after 5 minutes. <br /><br /><h4>Required permission(s):</h4><span class="permissionBlock">Rentals &gt; Rental properties and units</span> - ‘View`

Parameters:

  • unit_id (Integer)
  • image_id (Integer)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



657
658
659
660
# File 'lib/buildium-ruby/api/rental_units_api.rb', line 657

def get_rental_unit_image_download_url_by_id(unit_id, image_id, opts = {})
  data, _status_code, _headers = get_rental_unit_image_download_url_by_id_with_http_info(unit_id, image_id, opts)
  data
end

#get_rental_unit_image_download_url_by_id_with_http_info(unit_id, image_id, opts = {}) ⇒ Array<(FileDownloadMessage, Integer, Hash)>

Download a unit image Use this endpoint to create a temporary URL that can be used to download a unit image. This URL expires after 5 minutes. &lt;br /&gt;&lt;br /&gt;&lt;h4&gt;Required permission(s):&lt;/h4&gt;&lt;span class&#x3D;&quot;permissionBlock&quot;&gt;Rentals &amp;gt; Rental properties and units&lt;/span&gt; - &#x60;View&#x60;

Parameters:

  • unit_id (Integer)
  • image_id (Integer)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(FileDownloadMessage, Integer, Hash)>)

    FileDownloadMessage data, response status code and response headers



668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
# File 'lib/buildium-ruby/api/rental_units_api.rb', line 668

def get_rental_unit_image_download_url_by_id_with_http_info(unit_id, image_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RentalUnitsApi.get_rental_unit_image_download_url_by_id ...'
  end
  # verify the required parameter 'unit_id' is set
  if @api_client.config.client_side_validation && unit_id.nil?
    fail ArgumentError, "Missing the required parameter 'unit_id' when calling RentalUnitsApi.get_rental_unit_image_download_url_by_id"
  end
  # verify the required parameter 'image_id' is set
  if @api_client.config.client_side_validation && image_id.nil?
    fail ArgumentError, "Missing the required parameter 'image_id' when calling RentalUnitsApi.get_rental_unit_image_download_url_by_id"
  end
  # resource path
  local_var_path = '/v1/rentals/units/{unitId}/images/{imageId}/downloadrequests'.sub('{' + 'unitId' + '}', CGI.escape(unit_id.to_s)).sub('{' + 'imageId' + '}', CGI.escape(image_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'FileDownloadMessage'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['clientId', 'clientSecret']

  new_options = opts.merge(
    :operation => :"RentalUnitsApi.get_rental_unit_image_download_url_by_id",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: RentalUnitsApi#get_rental_unit_image_download_url_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_rental_unit_images(unit_id, opts = {}) ⇒ Array<RentalUnitImageMessage>

Retrieve all unit images Retrieves all images for a unit. Note this endpoint will only return file metadata such as file names and descriptions. To download files make requests to the [Download File](#tag/Rental-Units/operation/GetRentalUnitImageDownloadUrlById) endpoint. <br /><br /><h4>Required permission(s):</h4><span class="permissionBlock">Rentals &gt; Rental properties and units</span> - ‘View`

Parameters:

  • unit_id (Integer)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :orderby (String)

    &#x60;orderby&#x60; indicates the field(s) and direction to sort the results in the response. See &lt;a href&#x3D;&quot;#section/API-Overview/Bulk-Request-Options&quot;&gt;Bulk Request Options&lt;/a&gt; for more information.

  • :offset (Integer)

    &#x60;offset&#x60; indicates the position of the first record to return. The &#x60;offset&#x60; is zero-based and the default is 0.

  • :limit (Integer)

    &#x60;limit&#x60; indicates the maximum number of results to be returned in the response. &#x60;limit&#x60; can range between 1 and 1000 and the default is 50.

Returns:



728
729
730
731
# File 'lib/buildium-ruby/api/rental_units_api.rb', line 728

def get_rental_unit_images(unit_id, opts = {})
  data, _status_code, _headers = get_rental_unit_images_with_http_info(unit_id, opts)
  data
end

#get_rental_unit_images_with_http_info(unit_id, opts = {}) ⇒ Array<(Array<RentalUnitImageMessage>, Integer, Hash)>

Retrieve all unit images Retrieves all images for a unit. Note this endpoint will only return file metadata such as file names and descriptions. To download files make requests to the [Download File](#tag/Rental-Units/operation/GetRentalUnitImageDownloadUrlById) endpoint. &lt;br /&gt;&lt;br /&gt;&lt;h4&gt;Required permission(s):&lt;/h4&gt;&lt;span class&#x3D;&quot;permissionBlock&quot;&gt;Rentals &amp;gt; Rental properties and units&lt;/span&gt; - &#x60;View&#x60;

Parameters:

  • unit_id (Integer)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :orderby (String)

    &#x60;orderby&#x60; indicates the field(s) and direction to sort the results in the response. See &lt;a href&#x3D;&quot;#section/API-Overview/Bulk-Request-Options&quot;&gt;Bulk Request Options&lt;/a&gt; for more information.

  • :offset (Integer)

    &#x60;offset&#x60; indicates the position of the first record to return. The &#x60;offset&#x60; is zero-based and the default is 0.

  • :limit (Integer)

    &#x60;limit&#x60; indicates the maximum number of results to be returned in the response. &#x60;limit&#x60; can range between 1 and 1000 and the default is 50.

Returns:

  • (Array<(Array<RentalUnitImageMessage>, Integer, Hash)>)

    Array<RentalUnitImageMessage> data, response status code and response headers



741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
# File 'lib/buildium-ruby/api/rental_units_api.rb', line 741

def get_rental_unit_images_with_http_info(unit_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RentalUnitsApi.get_rental_unit_images ...'
  end
  # verify the required parameter 'unit_id' is set
  if @api_client.config.client_side_validation && unit_id.nil?
    fail ArgumentError, "Missing the required parameter 'unit_id' when calling RentalUnitsApi.get_rental_unit_images"
  end
  # resource path
  local_var_path = '/v1/rentals/units/{unitId}/images'.sub('{' + 'unitId' + '}', CGI.escape(unit_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'orderby'] = opts[:'orderby'] if !opts[:'orderby'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Array<RentalUnitImageMessage>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['clientId', 'clientSecret']

  new_options = opts.merge(
    :operation => :"RentalUnitsApi.get_rental_unit_images",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: RentalUnitsApi#get_rental_unit_images\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_rental_unit_note_by_note_id(unit_id, note_id, opts = {}) ⇒ NoteMessage

Retrieve a note Retrieves a rental unit note. <br /><br /><h4>Required permission(s):</h4><span class="permissionBlock">Rentals &gt; Rental properties and units</span> - ‘View`

Parameters:

  • unit_id (Integer)
  • note_id (Integer)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



798
799
800
801
# File 'lib/buildium-ruby/api/rental_units_api.rb', line 798

def get_rental_unit_note_by_note_id(unit_id, note_id, opts = {})
  data, _status_code, _headers = get_rental_unit_note_by_note_id_with_http_info(unit_id, note_id, opts)
  data
end

#get_rental_unit_note_by_note_id_with_http_info(unit_id, note_id, opts = {}) ⇒ Array<(NoteMessage, Integer, Hash)>

Retrieve a note Retrieves a rental unit note. &lt;br /&gt;&lt;br /&gt;&lt;h4&gt;Required permission(s):&lt;/h4&gt;&lt;span class&#x3D;&quot;permissionBlock&quot;&gt;Rentals &amp;gt; Rental properties and units&lt;/span&gt; - &#x60;View&#x60;

Parameters:

  • unit_id (Integer)
  • note_id (Integer)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(NoteMessage, Integer, Hash)>)

    NoteMessage data, response status code and response headers



809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
# File 'lib/buildium-ruby/api/rental_units_api.rb', line 809

def get_rental_unit_note_by_note_id_with_http_info(unit_id, note_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RentalUnitsApi.get_rental_unit_note_by_note_id ...'
  end
  # verify the required parameter 'unit_id' is set
  if @api_client.config.client_side_validation && unit_id.nil?
    fail ArgumentError, "Missing the required parameter 'unit_id' when calling RentalUnitsApi.get_rental_unit_note_by_note_id"
  end
  # verify the required parameter 'note_id' is set
  if @api_client.config.client_side_validation && note_id.nil?
    fail ArgumentError, "Missing the required parameter 'note_id' when calling RentalUnitsApi.get_rental_unit_note_by_note_id"
  end
  # resource path
  local_var_path = '/v1/rentals/units/{unitId}/notes/{noteId}'.sub('{' + 'unitId' + '}', CGI.escape(unit_id.to_s)).sub('{' + 'noteId' + '}', CGI.escape(note_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'NoteMessage'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['clientId', 'clientSecret']

  new_options = opts.merge(
    :operation => :"RentalUnitsApi.get_rental_unit_note_by_note_id",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: RentalUnitsApi#get_rental_unit_note_by_note_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_rental_unit_notes(unit_id, opts = {}) ⇒ Array<NoteMessage>

Retrieve all notes Retrieves all rental unit notes. <br /><br /><h4>Required permission(s):</h4><span class="permissionBlock">Rentals &gt; Rental properties and units</span> - ‘View`

Parameters:

  • unit_id (Integer)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :updateddatetimefrom (Time)

    Filters results to any note whose updated date and time are greater than or equal to the specified value. The value must be formatted as YYYY-MM-DD HH:MM:SS.

  • :updateddatetimeto (Time)

    Filters results to any note whose updated date and time are less than or equal to the specified value. The value must be formatted as YYYY-MM-DD HH:MM:SS.

  • :lastupdatedbyuserid (Integer)

    Filters results to only notes that were last updated by the specified user identifier.

  • :orderby (String)

    &#x60;orderby&#x60; indicates the field(s) and direction to sort the results in the response. See &lt;a href&#x3D;&quot;#section/API-Overview/Bulk-Request-Options&quot;&gt;Bulk Request Options&lt;/a&gt; for more information.

  • :offset (Integer)

    &#x60;offset&#x60; indicates the position of the first record to return. The &#x60;offset&#x60; is zero-based and the default is 0.

  • :limit (Integer)

    &#x60;limit&#x60; indicates the maximum number of results to be returned in the response. &#x60;limit&#x60; can range between 1 and 1000 and the default is 50.

Returns:



872
873
874
875
# File 'lib/buildium-ruby/api/rental_units_api.rb', line 872

def get_rental_unit_notes(unit_id, opts = {})
  data, _status_code, _headers = get_rental_unit_notes_with_http_info(unit_id, opts)
  data
end

#get_rental_unit_notes_with_http_info(unit_id, opts = {}) ⇒ Array<(Array<NoteMessage>, Integer, Hash)>

Retrieve all notes Retrieves all rental unit notes. &lt;br /&gt;&lt;br /&gt;&lt;h4&gt;Required permission(s):&lt;/h4&gt;&lt;span class&#x3D;&quot;permissionBlock&quot;&gt;Rentals &amp;gt; Rental properties and units&lt;/span&gt; - &#x60;View&#x60;

Parameters:

  • unit_id (Integer)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :updateddatetimefrom (Time)

    Filters results to any note whose updated date and time are greater than or equal to the specified value. The value must be formatted as YYYY-MM-DD HH:MM:SS.

  • :updateddatetimeto (Time)

    Filters results to any note whose updated date and time are less than or equal to the specified value. The value must be formatted as YYYY-MM-DD HH:MM:SS.

  • :lastupdatedbyuserid (Integer)

    Filters results to only notes that were last updated by the specified user identifier.

  • :orderby (String)

    &#x60;orderby&#x60; indicates the field(s) and direction to sort the results in the response. See &lt;a href&#x3D;&quot;#section/API-Overview/Bulk-Request-Options&quot;&gt;Bulk Request Options&lt;/a&gt; for more information.

  • :offset (Integer)

    &#x60;offset&#x60; indicates the position of the first record to return. The &#x60;offset&#x60; is zero-based and the default is 0.

  • :limit (Integer)

    &#x60;limit&#x60; indicates the maximum number of results to be returned in the response. &#x60;limit&#x60; can range between 1 and 1000 and the default is 50.

Returns:

  • (Array<(Array<NoteMessage>, Integer, Hash)>)

    Array<NoteMessage> data, response status code and response headers



888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
# File 'lib/buildium-ruby/api/rental_units_api.rb', line 888

def get_rental_unit_notes_with_http_info(unit_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RentalUnitsApi.get_rental_unit_notes ...'
  end
  # verify the required parameter 'unit_id' is set
  if @api_client.config.client_side_validation && unit_id.nil?
    fail ArgumentError, "Missing the required parameter 'unit_id' when calling RentalUnitsApi.get_rental_unit_notes"
  end
  # resource path
  local_var_path = '/v1/rentals/units/{unitId}/notes'.sub('{' + 'unitId' + '}', CGI.escape(unit_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'updateddatetimefrom'] = opts[:'updateddatetimefrom'] if !opts[:'updateddatetimefrom'].nil?
  query_params[:'updateddatetimeto'] = opts[:'updateddatetimeto'] if !opts[:'updateddatetimeto'].nil?
  query_params[:'lastupdatedbyuserid'] = opts[:'lastupdatedbyuserid'] if !opts[:'lastupdatedbyuserid'].nil?
  query_params[:'orderby'] = opts[:'orderby'] if !opts[:'orderby'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Array<NoteMessage>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['clientId', 'clientSecret']

  new_options = opts.merge(
    :operation => :"RentalUnitsApi.get_rental_unit_notes",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: RentalUnitsApi#get_rental_unit_notes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#reorder_rental_unit_images(unit_id, image_reorder_request_put_message, opts = {}) ⇒ Array<RentalUnitImageMessage>

Update unit image order Updates the image display order within the Buildium web application and in any associated rental listings. <br /><br /><h4>Required permission(s):</h4><span class="permissionBlock">Rentals &gt; Rental properties and units</span> - ‘View` `Edit`

Parameters:

Returns:



948
949
950
951
# File 'lib/buildium-ruby/api/rental_units_api.rb', line 948

def reorder_rental_unit_images(unit_id, image_reorder_request_put_message, opts = {})
  data, _status_code, _headers = reorder_rental_unit_images_with_http_info(unit_id, image_reorder_request_put_message, opts)
  data
end

#reorder_rental_unit_images_with_http_info(unit_id, image_reorder_request_put_message, opts = {}) ⇒ Array<(Array<RentalUnitImageMessage>, Integer, Hash)>

Update unit image order Updates the image display order within the Buildium web application and in any associated rental listings. &lt;br /&gt;&lt;br /&gt;&lt;h4&gt;Required permission(s):&lt;/h4&gt;&lt;span class&#x3D;&quot;permissionBlock&quot;&gt;Rentals &amp;gt; Rental properties and units&lt;/span&gt; - &#x60;View&#x60; &#x60;Edit&#x60;

Parameters:

Returns:

  • (Array<(Array<RentalUnitImageMessage>, Integer, Hash)>)

    Array<RentalUnitImageMessage> data, response status code and response headers



959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
# File 'lib/buildium-ruby/api/rental_units_api.rb', line 959

def reorder_rental_unit_images_with_http_info(unit_id, image_reorder_request_put_message, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RentalUnitsApi.reorder_rental_unit_images ...'
  end
  # verify the required parameter 'unit_id' is set
  if @api_client.config.client_side_validation && unit_id.nil?
    fail ArgumentError, "Missing the required parameter 'unit_id' when calling RentalUnitsApi.reorder_rental_unit_images"
  end
  # verify the required parameter 'image_reorder_request_put_message' is set
  if @api_client.config.client_side_validation && image_reorder_request_put_message.nil?
    fail ArgumentError, "Missing the required parameter 'image_reorder_request_put_message' when calling RentalUnitsApi.reorder_rental_unit_images"
  end
  # resource path
  local_var_path = '/v1/rentals/units/{unitId}/images/order'.sub('{' + 'unitId' + '}', CGI.escape(unit_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
    header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(image_reorder_request_put_message)

  # return_type
  return_type = opts[:debug_return_type] || 'Array<RentalUnitImageMessage>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['clientId', 'clientSecret']

  new_options = opts.merge(
    :operation => :"RentalUnitsApi.reorder_rental_unit_images",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: RentalUnitsApi#reorder_rental_unit_images\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_note_for_rental_unit(unit_id, note_id, note_put_message, opts = {}) ⇒ NoteMessage

Update a note Updates a rental unit note. <br /><br /><strong>NOTE:</strong> Any field not included in the update request will be set to either an empty string or ‘null` in the database depending on the field definition. <br />The recommended workflow to ensure no data is inadvertently overwritten is to execute a `GET` request for the resource you’re about to update and then use this response to fill any of the fields that are not being updated. <br /><br /><h4>Required permission(s):</h4><span class="permissionBlock">Rentals &gt; Rental properties and units</span> - ‘View` `Edit`

Parameters:

  • unit_id (Integer)
  • note_id (Integer)
  • note_put_message (NotePutMessage)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1023
1024
1025
1026
# File 'lib/buildium-ruby/api/rental_units_api.rb', line 1023

def update_note_for_rental_unit(unit_id, note_id, note_put_message, opts = {})
  data, _status_code, _headers = update_note_for_rental_unit_with_http_info(unit_id, note_id, note_put_message, opts)
  data
end

#update_note_for_rental_unit_with_http_info(unit_id, note_id, note_put_message, opts = {}) ⇒ Array<(NoteMessage, Integer, Hash)>

Update a note Updates a rental unit note. &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; Any field not included in the update request will be set to either an empty string or &#x60;null&#x60; in the database depending on the field definition. &lt;br /&gt;The recommended workflow to ensure no data is inadvertently overwritten is to execute a &#x60;GET&#x60; request for the resource you&#39;re about to update and then use this response to fill any of the fields that are not being updated. &lt;br /&gt;&lt;br /&gt;&lt;h4&gt;Required permission(s):&lt;/h4&gt;&lt;span class&#x3D;&quot;permissionBlock&quot;&gt;Rentals &amp;gt; Rental properties and units&lt;/span&gt; - &#x60;View&#x60; &#x60;Edit&#x60;

Parameters:

  • unit_id (Integer)
  • note_id (Integer)
  • note_put_message (NotePutMessage)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(NoteMessage, Integer, Hash)>)

    NoteMessage data, response status code and response headers



1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
# File 'lib/buildium-ruby/api/rental_units_api.rb', line 1035

def update_note_for_rental_unit_with_http_info(unit_id, note_id, note_put_message, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RentalUnitsApi.update_note_for_rental_unit ...'
  end
  # verify the required parameter 'unit_id' is set
  if @api_client.config.client_side_validation && unit_id.nil?
    fail ArgumentError, "Missing the required parameter 'unit_id' when calling RentalUnitsApi.update_note_for_rental_unit"
  end
  # verify the required parameter 'note_id' is set
  if @api_client.config.client_side_validation && note_id.nil?
    fail ArgumentError, "Missing the required parameter 'note_id' when calling RentalUnitsApi.update_note_for_rental_unit"
  end
  # verify the required parameter 'note_put_message' is set
  if @api_client.config.client_side_validation && note_put_message.nil?
    fail ArgumentError, "Missing the required parameter 'note_put_message' when calling RentalUnitsApi.update_note_for_rental_unit"
  end
  # resource path
  local_var_path = '/v1/rentals/units/{unitId}/notes/{noteId}'.sub('{' + 'unitId' + '}', CGI.escape(unit_id.to_s)).sub('{' + 'noteId' + '}', CGI.escape(note_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
    header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(note_put_message)

  # return_type
  return_type = opts[:debug_return_type] || 'NoteMessage'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['clientId', 'clientSecret']

  new_options = opts.merge(
    :operation => :"RentalUnitsApi.update_note_for_rental_unit",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: RentalUnitsApi#update_note_for_rental_unit\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_rental_unit(unit_id, rental_unit_put_message, opts = {}) ⇒ RentalUnitMessage

Update a unit Updates a rental unit. <br /><br /><strong>NOTE:</strong> Any field not included in the update request will be set to either an empty string or ‘null` in the database depending on the field definition. <br />The recommended workflow to ensure no data is inadvertently overwritten is to execute a `GET` request for the resource you’re about to update and then use this response to fill any of the fields that are not being updated. <br /><br /><h4>Required permission(s):</h4><span class="permissionBlock">Rentals &gt; Rental properties and units</span> - ‘View` `Edit`

Parameters:

  • unit_id (Integer)

    The identifier of the unit to update.

  • rental_unit_put_message (RentalUnitPutMessage)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1102
1103
1104
1105
# File 'lib/buildium-ruby/api/rental_units_api.rb', line 1102

def update_rental_unit(unit_id, rental_unit_put_message, opts = {})
  data, _status_code, _headers = update_rental_unit_with_http_info(unit_id, rental_unit_put_message, opts)
  data
end

#update_rental_unit_features(unit_id, rental_unit_features_put_message, opts = {}) ⇒ RentalUnitFeaturesMessage

Update amenities Updates the amenities for a rental unit. <br /><br /><strong>NOTE:</strong> Any field not included in the update request will be set to either an empty string or ‘null` in the database depending on the field definition. <br />The recommended workflow to ensure no data is inadvertently overwritten is to execute a `GET` request for the resource you’re about to update and then use this response to fill any of the fields that are not being updated. <br /><br /><h4>Required permission(s):</h4><span class="permissionBlock">Rentals &gt; Rental properties and units</span> - ‘View` `Edit`

Parameters:

  • unit_id (Integer)
  • rental_unit_features_put_message (RentalUnitFeaturesPutMessage)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1176
1177
1178
1179
# File 'lib/buildium-ruby/api/rental_units_api.rb', line 1176

def update_rental_unit_features(unit_id, rental_unit_features_put_message, opts = {})
  data, _status_code, _headers = update_rental_unit_features_with_http_info(unit_id, rental_unit_features_put_message, opts)
  data
end

#update_rental_unit_features_with_http_info(unit_id, rental_unit_features_put_message, opts = {}) ⇒ Array<(RentalUnitFeaturesMessage, Integer, Hash)>

Update amenities Updates the amenities for a rental unit. &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; Any field not included in the update request will be set to either an empty string or &#x60;null&#x60; in the database depending on the field definition. &lt;br /&gt;The recommended workflow to ensure no data is inadvertently overwritten is to execute a &#x60;GET&#x60; request for the resource you&#39;re about to update and then use this response to fill any of the fields that are not being updated. &lt;br /&gt;&lt;br /&gt;&lt;h4&gt;Required permission(s):&lt;/h4&gt;&lt;span class&#x3D;&quot;permissionBlock&quot;&gt;Rentals &amp;gt; Rental properties and units&lt;/span&gt; - &#x60;View&#x60; &#x60;Edit&#x60;

Parameters:

  • unit_id (Integer)
  • rental_unit_features_put_message (RentalUnitFeaturesPutMessage)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(RentalUnitFeaturesMessage, Integer, Hash)>)

    RentalUnitFeaturesMessage data, response status code and response headers



1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
# File 'lib/buildium-ruby/api/rental_units_api.rb', line 1187

def update_rental_unit_features_with_http_info(unit_id, rental_unit_features_put_message, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RentalUnitsApi.update_rental_unit_features ...'
  end
  # verify the required parameter 'unit_id' is set
  if @api_client.config.client_side_validation && unit_id.nil?
    fail ArgumentError, "Missing the required parameter 'unit_id' when calling RentalUnitsApi.update_rental_unit_features"
  end
  # verify the required parameter 'rental_unit_features_put_message' is set
  if @api_client.config.client_side_validation && rental_unit_features_put_message.nil?
    fail ArgumentError, "Missing the required parameter 'rental_unit_features_put_message' when calling RentalUnitsApi.update_rental_unit_features"
  end
  # resource path
  local_var_path = '/v1/rentals/units/{unitId}/amenities'.sub('{' + 'unitId' + '}', CGI.escape(unit_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
    header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(rental_unit_features_put_message)

  # return_type
  return_type = opts[:debug_return_type] || 'RentalUnitFeaturesMessage'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['clientId', 'clientSecret']

  new_options = opts.merge(
    :operation => :"RentalUnitsApi.update_rental_unit_features",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: RentalUnitsApi#update_rental_unit_features\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_rental_unit_image(unit_id, image_id, rental_unit_image_put_message, opts = {}) ⇒ RentalImageMessage

Update a unit image Updates a unit image. <br /><br /><h4>Required permission(s):</h4><span class="permissionBlock">Rentals &gt; Properties and units</span> - ‘View` `Edit`

Parameters:

  • unit_id (Integer)
  • image_id (Integer)
  • rental_unit_image_put_message (RentalUnitImagePutMessage)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1251
1252
1253
1254
# File 'lib/buildium-ruby/api/rental_units_api.rb', line 1251

def update_rental_unit_image(unit_id, image_id, rental_unit_image_put_message, opts = {})
  data, _status_code, _headers = update_rental_unit_image_with_http_info(unit_id, image_id, rental_unit_image_put_message, opts)
  data
end

#update_rental_unit_image_with_http_info(unit_id, image_id, rental_unit_image_put_message, opts = {}) ⇒ Array<(RentalImageMessage, Integer, Hash)>

Update a unit image Updates a unit image. &lt;br /&gt;&lt;br /&gt;&lt;h4&gt;Required permission(s):&lt;/h4&gt;&lt;span class&#x3D;&quot;permissionBlock&quot;&gt;Rentals &amp;gt; Properties and units&lt;/span&gt; - &#x60;View&#x60; &#x60;Edit&#x60;

Parameters:

  • unit_id (Integer)
  • image_id (Integer)
  • rental_unit_image_put_message (RentalUnitImagePutMessage)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(RentalImageMessage, Integer, Hash)>)

    RentalImageMessage data, response status code and response headers



1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
# File 'lib/buildium-ruby/api/rental_units_api.rb', line 1263

def update_rental_unit_image_with_http_info(unit_id, image_id, rental_unit_image_put_message, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RentalUnitsApi.update_rental_unit_image ...'
  end
  # verify the required parameter 'unit_id' is set
  if @api_client.config.client_side_validation && unit_id.nil?
    fail ArgumentError, "Missing the required parameter 'unit_id' when calling RentalUnitsApi.update_rental_unit_image"
  end
  # verify the required parameter 'image_id' is set
  if @api_client.config.client_side_validation && image_id.nil?
    fail ArgumentError, "Missing the required parameter 'image_id' when calling RentalUnitsApi.update_rental_unit_image"
  end
  # verify the required parameter 'rental_unit_image_put_message' is set
  if @api_client.config.client_side_validation && rental_unit_image_put_message.nil?
    fail ArgumentError, "Missing the required parameter 'rental_unit_image_put_message' when calling RentalUnitsApi.update_rental_unit_image"
  end
  # resource path
  local_var_path = '/v1/rentals/units/{unitId}/images/{imageId}'.sub('{' + 'unitId' + '}', CGI.escape(unit_id.to_s)).sub('{' + 'imageId' + '}', CGI.escape(image_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
    header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(rental_unit_image_put_message)

  # return_type
  return_type = opts[:debug_return_type] || 'RentalImageMessage'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['clientId', 'clientSecret']

  new_options = opts.merge(
    :operation => :"RentalUnitsApi.update_rental_unit_image",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: RentalUnitsApi#update_rental_unit_image\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_rental_unit_with_http_info(unit_id, rental_unit_put_message, opts = {}) ⇒ Array<(RentalUnitMessage, Integer, Hash)>

Update a unit Updates a rental unit. &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; Any field not included in the update request will be set to either an empty string or &#x60;null&#x60; in the database depending on the field definition. &lt;br /&gt;The recommended workflow to ensure no data is inadvertently overwritten is to execute a &#x60;GET&#x60; request for the resource you&#39;re about to update and then use this response to fill any of the fields that are not being updated. &lt;br /&gt;&lt;br /&gt;&lt;h4&gt;Required permission(s):&lt;/h4&gt;&lt;span class&#x3D;&quot;permissionBlock&quot;&gt;Rentals &amp;gt; Rental properties and units&lt;/span&gt; - &#x60;View&#x60; &#x60;Edit&#x60;

Parameters:

  • unit_id (Integer)

    The identifier of the unit to update.

  • rental_unit_put_message (RentalUnitPutMessage)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(RentalUnitMessage, Integer, Hash)>)

    RentalUnitMessage data, response status code and response headers



1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
# File 'lib/buildium-ruby/api/rental_units_api.rb', line 1113

def update_rental_unit_with_http_info(unit_id, rental_unit_put_message, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RentalUnitsApi.update_rental_unit ...'
  end
  # verify the required parameter 'unit_id' is set
  if @api_client.config.client_side_validation && unit_id.nil?
    fail ArgumentError, "Missing the required parameter 'unit_id' when calling RentalUnitsApi.update_rental_unit"
  end
  # verify the required parameter 'rental_unit_put_message' is set
  if @api_client.config.client_side_validation && rental_unit_put_message.nil?
    fail ArgumentError, "Missing the required parameter 'rental_unit_put_message' when calling RentalUnitsApi.update_rental_unit"
  end
  # resource path
  local_var_path = '/v1/rentals/units/{unitId}'.sub('{' + 'unitId' + '}', CGI.escape(unit_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
    header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(rental_unit_put_message)

  # return_type
  return_type = opts[:debug_return_type] || 'RentalUnitMessage'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['clientId', 'clientSecret']

  new_options = opts.merge(
    :operation => :"RentalUnitsApi.update_rental_unit",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: RentalUnitsApi#update_rental_unit\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end