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_image_upload_file_request_async(unit_id, create_rental_image_upload_file_request_async_request, 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 > Rental properties and units</span> - `View` `Edit`

Parameters:

Returns:



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

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

#create_rental_unit_image_upload_file_request_async_with_http_info(unit_id, create_rental_image_upload_file_request_async_request, 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 &gt; Rental properties and units&lt;/span&gt; - &#x60;View&#x60; &#x60;Edit&#x60;

Parameters:

Returns:

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

    FileUploadTicketMessage data, response status code and response headers



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
89
90
91
92
93
94
# File 'lib/buildium-ruby/api/rental_units_api.rb', line 39

def create_rental_unit_image_upload_file_request_async_with_http_info(unit_id, create_rental_image_upload_file_request_async_request, 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 'create_rental_image_upload_file_request_async_request' is set
  if @api_client.config.client_side_validation && create_rental_image_upload_file_request_async_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_rental_image_upload_file_request_async_request' 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(create_rental_image_upload_file_request_async_request)

  # 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, create_lease_note_request, opts = {}) ⇒ NoteMessage

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

Parameters:

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

    the optional parameters

Returns:



102
103
104
105
# File 'lib/buildium-ruby/api/rental_units_api.rb', line 102

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

#create_rental_unit_note_with_http_info(unit_id, create_lease_note_request, 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 &gt; Rental properties and units&lt;/span&gt; - &#x60;View&#x60; &#x60;Edit&#x60;

Parameters:

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

    the optional parameters

Returns:

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

    NoteMessage data, response status code and response headers



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
163
164
165
166
167
168
# File 'lib/buildium-ruby/api/rental_units_api.rb', line 113

def create_rental_unit_note_with_http_info(unit_id, create_lease_note_request, 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 'create_lease_note_request' is set
  if @api_client.config.client_side_validation && create_lease_note_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_lease_note_request' 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(create_lease_note_request)

  # 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 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 > Properties and units</span> - ‘View` `Edit`

Parameters:

Returns:



176
177
178
179
# File 'lib/buildium-ruby/api/rental_units_api.rb', line 176

def create_unit_video_link_request(unit_id, create_video_link_request_request, opts = {})
  data, _status_code, _headers = create_unit_video_link_request_with_http_info(unit_id, create_video_link_request_request, 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 &gt; Properties and units&lt;/span&gt; - &#x60;View&#x60; &#x60;Edit&#x60;

Parameters:

Returns:

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

    RentalUnitImageMessage data, response status code and response headers



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
237
238
239
240
241
242
# File 'lib/buildium-ruby/api/rental_units_api.rb', line 187

def create_unit_video_link_request_with_http_info(unit_id, create_video_link_request_request, 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 'create_video_link_request_request' is set
  if @api_client.config.client_side_validation && create_video_link_request_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_video_link_request_request' 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(create_video_link_request_request)

  # 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 > Rental properties and units</span> - ‘View` `Edit` `Delete`

Parameters:

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

    the optional parameters

Returns:

  • (nil)


250
251
252
253
# File 'lib/buildium-ruby/api/rental_units_api.rb', line 250

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



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
311
# File 'lib/buildium-ruby/api/rental_units_api.rb', line 261

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_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 > Rental properties and units</span> - ‘View`

Parameters:

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

    the optional parameters

Returns:



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

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



328
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
# File 'lib/buildium-ruby/api/rental_units_api.rb', line 328

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_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 > Rental properties and units</span> - ‘View`

Parameters:

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

    the optional parameters

Returns:



382
383
384
385
# File 'lib/buildium-ruby/api/rental_units_api.rb', line 382

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



393
394
395
396
397
398
399
400
401
402
403
404
405
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
# File 'lib/buildium-ruby/api/rental_units_api.rb', line 393

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 > Rental properties and units</span> - ‘View`

Parameters:

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

    the optional parameters

Returns:



451
452
453
454
# File 'lib/buildium-ruby/api/rental_units_api.rb', line 451

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



462
463
464
465
466
467
468
469
470
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
# File 'lib/buildium-ruby/api/rental_units_api.rb', line 462

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 > 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:



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

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



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
581
582
583
584
# File 'lib/buildium-ruby/api/rental_units_api.rb', line 535

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 > Rental properties and units</span> - ‘View`

Parameters:

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

    the optional parameters

Returns:



592
593
594
595
# File 'lib/buildium-ruby/api/rental_units_api.rb', line 592

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



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
650
651
652
653
# File 'lib/buildium-ruby/api/rental_units_api.rb', line 603

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 > 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:



666
667
668
669
# File 'lib/buildium-ruby/api/rental_units_api.rb', line 666

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



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
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
# File 'lib/buildium-ruby/api/rental_units_api.rb', line 682

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, reorder_rental_images_request, 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 > Rental properties and units</span> - ‘View` `Edit`

Parameters:

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

    the optional parameters

Returns:



742
743
744
745
# File 'lib/buildium-ruby/api/rental_units_api.rb', line 742

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

#reorder_rental_unit_images_with_http_info(unit_id, reorder_rental_images_request, 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 &gt; Rental properties and units&lt;/span&gt; - &#x60;View&#x60; &#x60;Edit&#x60;

Parameters:

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

    the optional parameters

Returns:

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

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



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
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
# File 'lib/buildium-ruby/api/rental_units_api.rb', line 753

def reorder_rental_unit_images_with_http_info(unit_id, reorder_rental_images_request, 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 'reorder_rental_images_request' is set
  if @api_client.config.client_side_validation && reorder_rental_images_request.nil?
    fail ArgumentError, "Missing the required parameter 'reorder_rental_images_request' 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(reorder_rental_images_request)

  # 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, update_lease_note_request, 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 > Rental properties and units</span> - ‘View` `Edit`

Parameters:

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

    the optional parameters

Returns:



817
818
819
820
# File 'lib/buildium-ruby/api/rental_units_api.rb', line 817

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

#update_note_for_rental_unit_with_http_info(unit_id, note_id, update_lease_note_request, 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 &gt; Rental properties and units&lt;/span&gt; - &#x60;View&#x60; &#x60;Edit&#x60;

Parameters:

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

    the optional parameters

Returns:

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

    NoteMessage data, response status code and response headers



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
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
# File 'lib/buildium-ruby/api/rental_units_api.rb', line 829

def update_note_for_rental_unit_with_http_info(unit_id, note_id, update_lease_note_request, 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 'update_lease_note_request' is set
  if @api_client.config.client_side_validation && update_lease_note_request.nil?
    fail ArgumentError, "Missing the required parameter 'update_lease_note_request' 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(update_lease_note_request)

  # 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_features(unit_id, update_rental_unit_features_request, 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 > Rental properties and units</span> - ‘View` `Edit`

Parameters:

Returns:



896
897
898
899
# File 'lib/buildium-ruby/api/rental_units_api.rb', line 896

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

#update_rental_unit_features_with_http_info(unit_id, update_rental_unit_features_request, 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 &gt; Rental properties and units&lt;/span&gt; - &#x60;View&#x60; &#x60;Edit&#x60;

Parameters:

Returns:

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

    RentalUnitFeaturesMessage data, response status code and response headers



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
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
# File 'lib/buildium-ruby/api/rental_units_api.rb', line 907

def update_rental_unit_features_with_http_info(unit_id, update_rental_unit_features_request, 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 'update_rental_unit_features_request' is set
  if @api_client.config.client_side_validation && update_rental_unit_features_request.nil?
    fail ArgumentError, "Missing the required parameter 'update_rental_unit_features_request' 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(update_rental_unit_features_request)

  # 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, update_rental_unit_image_request, opts = {}) ⇒ RentalImageMessage

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

Parameters:

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

    the optional parameters

Returns:



971
972
973
974
# File 'lib/buildium-ruby/api/rental_units_api.rb', line 971

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

#update_rental_unit_image_with_http_info(unit_id, image_id, update_rental_unit_image_request, 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 &gt; Properties and units&lt;/span&gt; - &#x60;View&#x60; &#x60;Edit&#x60;

Parameters:

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

    the optional parameters

Returns:

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

    RentalImageMessage data, response status code and response headers



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
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
# File 'lib/buildium-ruby/api/rental_units_api.rb', line 983

def update_rental_unit_image_with_http_info(unit_id, image_id, update_rental_unit_image_request, 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 'update_rental_unit_image_request' is set
  if @api_client.config.client_side_validation && update_rental_unit_image_request.nil?
    fail ArgumentError, "Missing the required parameter 'update_rental_unit_image_request' 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(update_rental_unit_image_request)

  # 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