Class: Buildium::ResidentCenterApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ResidentCenterApi

Returns a new instance of ResidentCenterApi.



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

def api_client
  @api_client
end

Instance Method Details

#get_resident_center_users(opts = {}) ⇒ Array<ResidentCenterUserMessage>

Retrieve all resident center users Retrieves all resident center users for both rentals and associations. <br /><br /><h4>Required permission(s):</h4><span class="permissionBlock">Communications &gt; Resident Center Users</span> - ‘View` <br /><span class="permissionBlock">Rentals &gt; Tenants</span> - `View` is required to retrieve resident center users that are tenants. <br /><span class="permissionBlock">Associations &gt; Association owners and tenants</span> - `View` is required to retrieve resident center users that are association owners.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :unitagreementids (Array<Integer>)

    Filters results to any resident center user who is associated with the specified lease and/or association ownership account identifiers.

  • :userids (Array<Integer>)

    Filters results to any resident center user with the specified tenant and/or association owner identifiers.

  • :usertypes (Array<String>)

    Filters results to any resident center user with the specified types.

  • :residentcenteruserstatuses (Array<String>)

    Filters results to any resident center user with the specified resident center user statuses.

  • :isautopayenabled (Boolean)

    If true, filters results to any resident center users who have automatic payments scheduled for the future. If false, filters results to any resident center users who do not have automatic payments scheduled for the future. If not provided, will not filter results based on automatic payments.

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



34
35
36
37
# File 'lib/buildium-ruby/api/resident_center_api.rb', line 34

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

#get_resident_center_users_with_http_info(opts = {}) ⇒ Array<(Array<ResidentCenterUserMessage>, Integer, Hash)>

Retrieve all resident center users Retrieves all resident center users for both rentals and associations. &lt;br /&gt;&lt;br /&gt;&lt;h4&gt;Required permission(s):&lt;/h4&gt;&lt;span class&#x3D;&quot;permissionBlock&quot;&gt;Communications &amp;gt; Resident Center Users&lt;/span&gt; - &#x60;View&#x60; &lt;br /&gt;&lt;span class&#x3D;&quot;permissionBlock&quot;&gt;Rentals &amp;gt; Tenants&lt;/span&gt; - &#x60;View&#x60; is required to retrieve resident center users that are tenants. &lt;br /&gt;&lt;span class&#x3D;&quot;permissionBlock&quot;&gt;Associations &amp;gt; Association owners and tenants&lt;/span&gt; - &#x60;View&#x60; is required to retrieve resident center users that are association owners.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :unitagreementids (Array<Integer>)

    Filters results to any resident center user who is associated with the specified lease and/or association ownership account identifiers.

  • :userids (Array<Integer>)

    Filters results to any resident center user with the specified tenant and/or association owner identifiers.

  • :usertypes (Array<String>)

    Filters results to any resident center user with the specified types.

  • :residentcenteruserstatuses (Array<String>)

    Filters results to any resident center user with the specified resident center user statuses.

  • :isautopayenabled (Boolean)

    If true, filters results to any resident center users who have automatic payments scheduled for the future. If false, filters results to any resident center users who do not have automatic payments scheduled for the future. If not provided, will not filter results based on automatic payments.

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

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



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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# File 'lib/buildium-ruby/api/resident_center_api.rb', line 51

def get_resident_center_users_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ResidentCenterApi.get_resident_center_users ...'
  end
  allowable_values = ["Tenant", "AssociationOwner"]
  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 = ["AccountExistsButNoEmailSent", "PasswordSent", "EmailFailed", "SignedIn", "Blocked"]
  if @api_client.config.client_side_validation && opts[:'residentcenteruserstatuses'] && !opts[:'residentcenteruserstatuses'].all? { |item| allowable_values.include?(item) }
    fail ArgumentError, "invalid value for \"residentcenteruserstatuses\", must include one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/v1/residentCenterUsers'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'unitagreementids'] = @api_client.build_collection_param(opts[:'unitagreementids'], :multi) if !opts[:'unitagreementids'].nil?
  query_params[:'userids'] = @api_client.build_collection_param(opts[:'userids'], :multi) if !opts[:'userids'].nil?
  query_params[:'usertypes'] = @api_client.build_collection_param(opts[:'usertypes'], :multi) if !opts[:'usertypes'].nil?
  query_params[:'residentcenteruserstatuses'] = @api_client.build_collection_param(opts[:'residentcenteruserstatuses'], :multi) if !opts[:'residentcenteruserstatuses'].nil?
  query_params[:'isautopayenabled'] = opts[:'isautopayenabled'] if !opts[:'isautopayenabled'].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<ResidentCenterUserMessage>'

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

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