Class: Buildium::AdministrationApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ AdministrationApi

Returns a new instance of AdministrationApi.



19
20
21
# File 'lib/buildium-ruby/api/administration_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/administration_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#get_account_info(opts = {}) ⇒ AccountInfoMessage

Retrieve account info Retrieves information related to the Buildium account. <br /><br /><h4>Required permission(s):</h4><span class="permissionBlock">Administration &gt; Account Information</span> - ‘View`

Parameters:

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

    the optional parameters

Returns:



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

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

#get_account_info_with_http_info(opts = {}) ⇒ Array<(AccountInfoMessage, Integer, Hash)>

Retrieve account info Retrieves information related to the Buildium account. &lt;br /&gt;&lt;br /&gt;&lt;h4&gt;Required permission(s):&lt;/h4&gt;&lt;span class&#x3D;&quot;permissionBlock&quot;&gt;Administration &amp;gt; Account Information&lt;/span&gt; - &#x60;View&#x60;

Parameters:

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

    the optional parameters

Returns:

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

    AccountInfoMessage data, response status code and response headers



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

def (opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AdministrationApi.get_account_info ...'
  end
  # resource path
  local_var_path = '/v1/administration/account'

  # 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] || 'AccountInfoMessage'

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

  new_options = opts.merge(
    :operation => :"AdministrationApi.get_account_info",
    :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: AdministrationApi#get_account_info\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_accounting_lock_period_settings(opts = {}) ⇒ AccountingLockPeriodMessage

Retrieve accounting lock periods Retrieves accounting lock periods. <br /><br /><h4>Required permission(s):</h4><span class="permissionBlock">Administration &gt; Application Settings</span> - ‘View`

Parameters:

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

    the optional parameters

Returns:



83
84
85
86
# File 'lib/buildium-ruby/api/administration_api.rb', line 83

def get_accounting_lock_period_settings(opts = {})
  data, _status_code, _headers = get_accounting_lock_period_settings_with_http_info(opts)
  data
end

#get_accounting_lock_period_settings_with_http_info(opts = {}) ⇒ Array<(AccountingLockPeriodMessage, Integer, Hash)>

Retrieve accounting lock periods Retrieves accounting lock periods. &lt;br /&gt;&lt;br /&gt;&lt;h4&gt;Required permission(s):&lt;/h4&gt;&lt;span class&#x3D;&quot;permissionBlock&quot;&gt;Administration &amp;gt; Application Settings&lt;/span&gt; - &#x60;View&#x60;

Parameters:

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

    the optional parameters

Returns:

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

    AccountingLockPeriodMessage data, response status code and response headers



92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
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
# File 'lib/buildium-ruby/api/administration_api.rb', line 92

def get_accounting_lock_period_settings_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AdministrationApi.get_accounting_lock_period_settings ...'
  end
  # resource path
  local_var_path = '/v1/administration/accountinglockperiod'

  # 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] || 'AccountingLockPeriodMessage'

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

  new_options = opts.merge(
    :operation => :"AdministrationApi.get_accounting_lock_period_settings",
    :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: AdministrationApi#get_accounting_lock_period_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_all_user_roles(opts = {}) ⇒ Array<UserRoleMessage>

Retrieve all user roles Retrieves a list of user roles. <br /><br /><h4>Required permission(s):</h4><span class="permissionBlock">Administration &gt; User Roles</span> - ‘View`

Parameters:

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



143
144
145
146
# File 'lib/buildium-ruby/api/administration_api.rb', line 143

def get_all_user_roles(opts = {})
  data, _status_code, _headers = get_all_user_roles_with_http_info(opts)
  data
end

#get_all_user_roles_with_http_info(opts = {}) ⇒ Array<(Array<UserRoleMessage>, Integer, Hash)>

Retrieve all user roles Retrieves a list of user roles. &lt;br /&gt;&lt;br /&gt;&lt;h4&gt;Required permission(s):&lt;/h4&gt;&lt;span class&#x3D;&quot;permissionBlock&quot;&gt;Administration &amp;gt; User Roles&lt;/span&gt; - &#x60;View&#x60;

Parameters:

  • 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<UserRoleMessage>, Integer, Hash)>)

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



155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
# File 'lib/buildium-ruby/api/administration_api.rb', line 155

def get_all_user_roles_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AdministrationApi.get_all_user_roles ...'
  end
  # resource path
  local_var_path = '/v1/userroles'

  # 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<UserRoleMessage>'

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

  new_options = opts.merge(
    :operation => :"AdministrationApi.get_all_user_roles",
    :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: AdministrationApi#get_all_user_roles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_all_users(opts = {}) ⇒ Array<UserMessage>

Retrieve all users Retrieves a list of users. <br /><br /><h4>Required permission(s):</h4><span class="permissionBlock">Administration &gt; Users</span> - ‘View`

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :roleids (Array<Integer>)

    Describes the role of the user.

  • :usertypes (Array<String>)

    Describes the user type of the user.

  • :status (String)

    Filters results by the status of the user. If no status is specified both &#x60;active&#x60; and &#x60;inactive&#x60; staff members will be returned.

  • :name (String)

    Filters results to only records whose name contains the specified value.

  • :email (String)

    Filters results to only records whose email contains the specified value.

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



214
215
216
217
# File 'lib/buildium-ruby/api/administration_api.rb', line 214

def get_all_users(opts = {})
  data, _status_code, _headers = get_all_users_with_http_info(opts)
  data
end

#get_all_users_with_http_info(opts = {}) ⇒ Array<(Array<UserMessage>, Integer, Hash)>

Retrieve all users Retrieves a list of users. &lt;br /&gt;&lt;br /&gt;&lt;h4&gt;Required permission(s):&lt;/h4&gt;&lt;span class&#x3D;&quot;permissionBlock&quot;&gt;Administration &amp;gt; Users&lt;/span&gt; - &#x60;View&#x60;

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :roleids (Array<Integer>)

    Describes the role of the user.

  • :usertypes (Array<String>)

    Describes the user type of the user.

  • :status (String)

    Filters results by the status of the user. If no status is specified both &#x60;active&#x60; and &#x60;inactive&#x60; staff members will be returned.

  • :name (String)

    Filters results to only records whose name contains the specified value.

  • :email (String)

    Filters results to only records whose email contains the specified value.

  • :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<UserMessage>, Integer, Hash)>)

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



231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
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
# File 'lib/buildium-ruby/api/administration_api.rb', line 231

def get_all_users_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AdministrationApi.get_all_users ...'
  end
  allowable_values = ["Staff", "RentalOwner", "Vendor"]
  if @api_client.config.client_side_validation && opts[:'usertypes'] && !opts[:'usertypes'].all? { |item| allowable_values.include?(item) }
    fail ArgumentError, "invalid value for \"usertypes\", must include one of #{allowable_values}"
  end
  allowable_values = ["Inactive", "Active"]
  if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status'])
    fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/v1/users'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'roleids'] = @api_client.build_collection_param(opts[:'roleids'], :multi) if !opts[:'roleids'].nil?
  query_params[:'usertypes'] = @api_client.build_collection_param(opts[:'usertypes'], :multi) if !opts[:'usertypes'].nil?
  query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
  query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?
  query_params[:'email'] = opts[:'email'] if !opts[:'email'].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<UserMessage>'

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

  new_options = opts.merge(
    :operation => :"AdministrationApi.get_all_users",
    :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: AdministrationApi#get_all_users\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_user_by_id(user_id, opts = {}) ⇒ UserMessage

Retrieve a user Retrieve a specific user. <br /><br /><h4>Required permission(s):</h4><span class="permissionBlock">Administration &gt; Users</span> - ‘View`

Parameters:

  • user_id (Integer)

    The user identifier.

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

    the optional parameters

Returns:



296
297
298
299
# File 'lib/buildium-ruby/api/administration_api.rb', line 296

def get_user_by_id(user_id, opts = {})
  data, _status_code, _headers = get_user_by_id_with_http_info(user_id, opts)
  data
end

#get_user_by_id_with_http_info(user_id, opts = {}) ⇒ Array<(UserMessage, Integer, Hash)>

Retrieve a user Retrieve a specific user. &lt;br /&gt;&lt;br /&gt;&lt;h4&gt;Required permission(s):&lt;/h4&gt;&lt;span class&#x3D;&quot;permissionBlock&quot;&gt;Administration &amp;gt; Users&lt;/span&gt; - &#x60;View&#x60;

Parameters:

  • user_id (Integer)

    The user identifier.

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

    the optional parameters

Returns:

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

    UserMessage data, response status code and response headers



306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
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
# File 'lib/buildium-ruby/api/administration_api.rb', line 306

def get_user_by_id_with_http_info(user_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AdministrationApi.get_user_by_id ...'
  end
  # verify the required parameter 'user_id' is set
  if @api_client.config.client_side_validation && user_id.nil?
    fail ArgumentError, "Missing the required parameter 'user_id' when calling AdministrationApi.get_user_by_id"
  end
  # resource path
  local_var_path = '/v1/users/{userId}'.sub('{' + 'userId' + '}', CGI.escape(user_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] || 'UserMessage'

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

  new_options = opts.merge(
    :operation => :"AdministrationApi.get_user_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: AdministrationApi#get_user_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_user_role_by_id(user_role_id, opts = {}) ⇒ UserRoleMessage

Retrieve a user role Retrieve a specific user role. <br /><br /><h4>Required permission(s):</h4><span class="permissionBlock">Administration &gt; User Roles</span> - ‘View`

Parameters:

  • user_role_id (Integer)

    The user role identifier.

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

    the optional parameters

Returns:



359
360
361
362
# File 'lib/buildium-ruby/api/administration_api.rb', line 359

def get_user_role_by_id(user_role_id, opts = {})
  data, _status_code, _headers = get_user_role_by_id_with_http_info(user_role_id, opts)
  data
end

#get_user_role_by_id_with_http_info(user_role_id, opts = {}) ⇒ Array<(UserRoleMessage, Integer, Hash)>

Retrieve a user role Retrieve a specific user role. &lt;br /&gt;&lt;br /&gt;&lt;h4&gt;Required permission(s):&lt;/h4&gt;&lt;span class&#x3D;&quot;permissionBlock&quot;&gt;Administration &amp;gt; User Roles&lt;/span&gt; - &#x60;View&#x60;

Parameters:

  • user_role_id (Integer)

    The user role identifier.

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

    the optional parameters

Returns:

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

    UserRoleMessage data, response status code and response headers



369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
# File 'lib/buildium-ruby/api/administration_api.rb', line 369

def get_user_role_by_id_with_http_info(user_role_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AdministrationApi.get_user_role_by_id ...'
  end
  # verify the required parameter 'user_role_id' is set
  if @api_client.config.client_side_validation && user_role_id.nil?
    fail ArgumentError, "Missing the required parameter 'user_role_id' when calling AdministrationApi.get_user_role_by_id"
  end
  # resource path
  local_var_path = '/v1/userroles/{userRoleId}'.sub('{' + 'userRoleId' + '}', CGI.escape(user_role_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] || 'UserRoleMessage'

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

  new_options = opts.merge(
    :operation => :"AdministrationApi.get_user_role_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: AdministrationApi#get_user_role_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end