Class: Buildium::AssociationMeterReadingsApi
- Inherits:
-
Object
- Object
- Buildium::AssociationMeterReadingsApi
- Defined in:
- lib/buildium-ruby/api/association_meter_readings_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#delete_meter_reading_details_for_association(association_id, readingdate, metertype, opts = {}) ⇒ nil
Delete meter reading details for a given date Delete meter reading details for an association for a given date.
-
#delete_meter_reading_details_for_association_with_http_info(association_id, readingdate, metertype, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Delete meter reading details for a given date Delete meter reading details for an association for a given date.
-
#get_association_meter_reading_details_async(association_id, readingdate, metertype, opts = {}) ⇒ MeterReadingDetailsMessage
Retrieve all meter reading details Retrieves all meter reading details for an association.
-
#get_association_meter_reading_details_async_with_http_info(association_id, readingdate, metertype, opts = {}) ⇒ Array<(MeterReadingDetailsMessage, Integer, Hash)>
Retrieve all meter reading details Retrieves all meter reading details for an association.
-
#get_meter_readings_for_association(association_id, readingdatefrom, readingdateto, opts = {}) ⇒ Array<MeterReadingMessage>
Retrieve all meter readings Retrieves all meter readings for an association.
-
#get_meter_readings_for_association_with_http_info(association_id, readingdatefrom, readingdateto, opts = {}) ⇒ Array<(Array<MeterReadingMessage>, Integer, Hash)>
Retrieve all meter readings Retrieves all meter readings for an association.
-
#initialize(api_client = ApiClient.default) ⇒ AssociationMeterReadingsApi
constructor
A new instance of AssociationMeterReadingsApi.
-
#upsert_association_meter_reading_details_async(association_id, meter_reading_details_put_message, opts = {}) ⇒ MeterReadingDetailsMessage
Create/Update meter reading details This endpoint can be used to both create and update a meter reading detail for an association.
-
#upsert_association_meter_reading_details_async_with_http_info(association_id, meter_reading_details_put_message, opts = {}) ⇒ Array<(MeterReadingDetailsMessage, Integer, Hash)>
Create/Update meter reading details This endpoint can be used to both create and update a meter reading detail for an association.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ AssociationMeterReadingsApi
Returns a new instance of AssociationMeterReadingsApi.
19 20 21 |
# File 'lib/buildium-ruby/api/association_meter_readings_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/buildium-ruby/api/association_meter_readings_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#delete_meter_reading_details_for_association(association_id, readingdate, metertype, opts = {}) ⇒ nil
Delete meter reading details for a given date Delete meter reading details for an association for a given date. <br /><br /><h4>Required permission(s):</h4><span class="permissionBlock">Associations > Ownership account transactions</span> - ‘View` `Edit` `Delete`
29 30 31 32 |
# File 'lib/buildium-ruby/api/association_meter_readings_api.rb', line 29 def delete_meter_reading_details_for_association(association_id, readingdate, metertype, opts = {}) delete_meter_reading_details_for_association_with_http_info(association_id, readingdate, metertype, opts) nil end |
#delete_meter_reading_details_for_association_with_http_info(association_id, readingdate, metertype, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Delete meter reading details for a given date Delete meter reading details for an association for a given date. <br /><br /><h4>Required permission(s):</h4><span class="permissionBlock">Associations &gt; Ownership account transactions</span> - `View` `Edit` `Delete`
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 95 96 97 98 99 100 101 102 |
# File 'lib/buildium-ruby/api/association_meter_readings_api.rb', line 41 def delete_meter_reading_details_for_association_with_http_info(association_id, readingdate, metertype, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AssociationMeterReadingsApi.delete_meter_reading_details_for_association ...' end # verify the required parameter 'association_id' is set if @api_client.config.client_side_validation && association_id.nil? fail ArgumentError, "Missing the required parameter 'association_id' when calling AssociationMeterReadingsApi.delete_meter_reading_details_for_association" end # verify the required parameter 'readingdate' is set if @api_client.config.client_side_validation && readingdate.nil? fail ArgumentError, "Missing the required parameter 'readingdate' when calling AssociationMeterReadingsApi.delete_meter_reading_details_for_association" end # verify the required parameter 'metertype' is set if @api_client.config.client_side_validation && metertype.nil? fail ArgumentError, "Missing the required parameter 'metertype' when calling AssociationMeterReadingsApi.delete_meter_reading_details_for_association" end # verify enum value allowable_values = ["Electric", "Gas", "Oil", "Water", "Sewer"] if @api_client.config.client_side_validation && !allowable_values.include?(metertype) fail ArgumentError, "invalid value for \"metertype\", must be one of #{allowable_values}" end # resource path local_var_path = '/v1/associations/{associationId}/meterreadings/summary'.sub('{' + 'associationId' + '}', CGI.escape(association_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'readingdate'] = readingdate query_params[:'metertype'] = metertype # 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'] = opts.merge( :operation => :"AssociationMeterReadingsApi.delete_meter_reading_details_for_association", :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AssociationMeterReadingsApi#delete_meter_reading_details_for_association\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_association_meter_reading_details_async(association_id, readingdate, metertype, opts = {}) ⇒ MeterReadingDetailsMessage
Retrieve all meter reading details Retrieves all meter reading details for an association. <br /><br /><h4>Required permission(s):</h4><span class="permissionBlock">Associations > Associations and units</span> - ‘View`
111 112 113 114 |
# File 'lib/buildium-ruby/api/association_meter_readings_api.rb', line 111 def get_association_meter_reading_details_async(association_id, readingdate, metertype, opts = {}) data, _status_code, _headers = get_association_meter_reading_details_async_with_http_info(association_id, readingdate, metertype, opts) data end |
#get_association_meter_reading_details_async_with_http_info(association_id, readingdate, metertype, opts = {}) ⇒ Array<(MeterReadingDetailsMessage, Integer, Hash)>
Retrieve all meter reading details Retrieves all meter reading details for an association. <br /><br /><h4>Required permission(s):</h4><span class="permissionBlock">Associations &gt; Associations and units</span> - `View`
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 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 |
# File 'lib/buildium-ruby/api/association_meter_readings_api.rb', line 123 def get_association_meter_reading_details_async_with_http_info(association_id, readingdate, metertype, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AssociationMeterReadingsApi.get_association_meter_reading_details_async ...' end # verify the required parameter 'association_id' is set if @api_client.config.client_side_validation && association_id.nil? fail ArgumentError, "Missing the required parameter 'association_id' when calling AssociationMeterReadingsApi.get_association_meter_reading_details_async" end # verify the required parameter 'readingdate' is set if @api_client.config.client_side_validation && readingdate.nil? fail ArgumentError, "Missing the required parameter 'readingdate' when calling AssociationMeterReadingsApi.get_association_meter_reading_details_async" end # verify the required parameter 'metertype' is set if @api_client.config.client_side_validation && metertype.nil? fail ArgumentError, "Missing the required parameter 'metertype' when calling AssociationMeterReadingsApi.get_association_meter_reading_details_async" end # verify enum value allowable_values = ["Electric", "Gas", "Oil", "Water", "Sewer"] if @api_client.config.client_side_validation && !allowable_values.include?(metertype) fail ArgumentError, "invalid value for \"metertype\", must be one of #{allowable_values}" end # resource path local_var_path = '/v1/associations/{associationId}/meterreadings/summary'.sub('{' + 'associationId' + '}', CGI.escape(association_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'readingdate'] = readingdate query_params[:'metertype'] = metertype # 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] || 'MeterReadingDetailsMessage' # auth_names auth_names = opts[:debug_auth_names] || ['clientId', 'clientSecret'] = opts.merge( :operation => :"AssociationMeterReadingsApi.get_association_meter_reading_details_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(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AssociationMeterReadingsApi#get_association_meter_reading_details_async\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_meter_readings_for_association(association_id, readingdatefrom, readingdateto, opts = {}) ⇒ Array<MeterReadingMessage>
Retrieve all meter readings Retrieves all meter readings for an association. <br /><br /><h4>Required permission(s):</h4><span class="permissionBlock">Associations > Associations and units</span> - ‘View`
197 198 199 200 |
# File 'lib/buildium-ruby/api/association_meter_readings_api.rb', line 197 def get_meter_readings_for_association(association_id, readingdatefrom, readingdateto, opts = {}) data, _status_code, _headers = get_meter_readings_for_association_with_http_info(association_id, readingdatefrom, readingdateto, opts) data end |
#get_meter_readings_for_association_with_http_info(association_id, readingdatefrom, readingdateto, opts = {}) ⇒ Array<(Array<MeterReadingMessage>, Integer, Hash)>
Retrieve all meter readings Retrieves all meter readings for an association. <br /><br /><h4>Required permission(s):</h4><span class="permissionBlock">Associations &gt; Associations and units</span> - `View`
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 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 |
# File 'lib/buildium-ruby/api/association_meter_readings_api.rb', line 213 def get_meter_readings_for_association_with_http_info(association_id, readingdatefrom, readingdateto, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AssociationMeterReadingsApi.get_meter_readings_for_association ...' end # verify the required parameter 'association_id' is set if @api_client.config.client_side_validation && association_id.nil? fail ArgumentError, "Missing the required parameter 'association_id' when calling AssociationMeterReadingsApi.get_meter_readings_for_association" end # verify the required parameter 'readingdatefrom' is set if @api_client.config.client_side_validation && readingdatefrom.nil? fail ArgumentError, "Missing the required parameter 'readingdatefrom' when calling AssociationMeterReadingsApi.get_meter_readings_for_association" end # verify the required parameter 'readingdateto' is set if @api_client.config.client_side_validation && readingdateto.nil? fail ArgumentError, "Missing the required parameter 'readingdateto' when calling AssociationMeterReadingsApi.get_meter_readings_for_association" end allowable_values = ["Electric", "Gas", "Oil", "Water", "Sewer"] if @api_client.config.client_side_validation && opts[:'metertypes'] && !opts[:'metertypes'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"metertypes\", must include one of #{allowable_values}" end # resource path local_var_path = '/v1/associations/{associationId}/meterreadings'.sub('{' + 'associationId' + '}', CGI.escape(association_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'readingdatefrom'] = readingdatefrom query_params[:'readingdateto'] = readingdateto query_params[:'metertypes'] = @api_client.build_collection_param(opts[:'metertypes'], :multi) if !opts[:'metertypes'].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<MeterReadingMessage>' # auth_names auth_names = opts[:debug_auth_names] || ['clientId', 'clientSecret'] = opts.merge( :operation => :"AssociationMeterReadingsApi.get_meter_readings_for_association", :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AssociationMeterReadingsApi#get_meter_readings_for_association\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#upsert_association_meter_reading_details_async(association_id, meter_reading_details_put_message, opts = {}) ⇒ MeterReadingDetailsMessage
Create/Update meter reading details This endpoint can be used to both create and update a meter reading detail for an association. <ul><li>There can only be one meter reading detail for a given combination of MeterType and ReadingDate for an association</li><li>If you are updating an existing meter reading detail, use the query parameters to specify the existing meter reading detail to update.</li><li>If you are creating a new meter reading detail, do not pass any query parameters.</li><li>When adding a new item to the Details array, leave out the ‘Id` field.</li><li>When updating an existing item in the Details array, the `Id` field of the existing item must be included.</li></ul><br /><br /><h4>Required permission(s):</h4><span class="permissionBlock">Associations > Associations and units</span> - `View` `Edit`
287 288 289 290 |
# File 'lib/buildium-ruby/api/association_meter_readings_api.rb', line 287 def upsert_association_meter_reading_details_async(association_id, , opts = {}) data, _status_code, _headers = upsert_association_meter_reading_details_async_with_http_info(association_id, , opts) data end |
#upsert_association_meter_reading_details_async_with_http_info(association_id, meter_reading_details_put_message, opts = {}) ⇒ Array<(MeterReadingDetailsMessage, Integer, Hash)>
Create/Update meter reading details This endpoint can be used to both create and update a meter reading detail for an association. <ul><li>There can only be one meter reading detail for a given combination of MeterType and ReadingDate for an association</li><li>If you are updating an existing meter reading detail, use the query parameters to specify the existing meter reading detail to update.</li><li>If you are creating a new meter reading detail, do not pass any query parameters.</li><li>When adding a new item to the Details array, leave out the `Id` field.</li><li>When updating an existing item in the Details array, the `Id` field of the existing item must be included.</li></ul><br /><br /><h4>Required permission(s):</h4><span class="permissionBlock">Associations &gt; Associations and units</span> - `View` `Edit`
300 301 302 303 304 305 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 353 354 355 356 357 358 359 360 361 |
# File 'lib/buildium-ruby/api/association_meter_readings_api.rb', line 300 def upsert_association_meter_reading_details_async_with_http_info(association_id, , opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AssociationMeterReadingsApi.upsert_association_meter_reading_details_async ...' end # verify the required parameter 'association_id' is set if @api_client.config.client_side_validation && association_id.nil? fail ArgumentError, "Missing the required parameter 'association_id' when calling AssociationMeterReadingsApi.upsert_association_meter_reading_details_async" end # verify the required parameter 'meter_reading_details_put_message' is set if @api_client.config.client_side_validation && .nil? fail ArgumentError, "Missing the required parameter 'meter_reading_details_put_message' when calling AssociationMeterReadingsApi.upsert_association_meter_reading_details_async" end allowable_values = ["Electric", "Gas", "Oil", "Water", "Sewer"] if @api_client.config.client_side_validation && opts[:'metertype'] && !allowable_values.include?(opts[:'metertype']) fail ArgumentError, "invalid value for \"metertype\", must be one of #{allowable_values}" end # resource path local_var_path = '/v1/associations/{associationId}/meterreadings/summary'.sub('{' + 'associationId' + '}', CGI.escape(association_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'readingdate'] = opts[:'readingdate'] if !opts[:'readingdate'].nil? query_params[:'metertype'] = opts[:'metertype'] if !opts[:'metertype'].nil? # 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() # return_type return_type = opts[:debug_return_type] || 'MeterReadingDetailsMessage' # auth_names auth_names = opts[:debug_auth_names] || ['clientId', 'clientSecret'] = opts.merge( :operation => :"AssociationMeterReadingsApi.upsert_association_meter_reading_details_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(:PUT, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AssociationMeterReadingsApi#upsert_association_meter_reading_details_async\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |