Class: XeroRuby::AssetApi
- Inherits:
-
Object
- Object
- XeroRuby::AssetApi
- Defined in:
- lib/xero-ruby/api/asset_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#create_asset(xero_tenant_id, asset, opts = {}) ⇒ Asset
adds a fixed asset Adds an asset to the system.
-
#create_asset_type(xero_tenant_id, opts = {}) ⇒ AssetType
adds a fixed asset type Adds an fixed asset type to the system.
-
#create_asset_type_with_http_info(xero_tenant_id, opts = {}) ⇒ Array<(AssetType, Integer, Hash)>
adds a fixed asset type Adds an fixed asset type to the system.
-
#create_asset_with_http_info(xero_tenant_id, asset, opts = {}) ⇒ Array<(Asset, Integer, Hash)>
adds a fixed asset Adds an asset to the system.
-
#get_asset_by_id(xero_tenant_id, id, opts = {}) ⇒ Asset
Retrieves fixed asset by id By passing in the appropriate asset id, you can search for a specific fixed asset in the system.
-
#get_asset_by_id_with_http_info(xero_tenant_id, id, opts = {}) ⇒ Array<(Asset, Integer, Hash)>
Retrieves fixed asset by id By passing in the appropriate asset id, you can search for a specific fixed asset in the system.
-
#get_asset_settings(xero_tenant_id, opts = {}) ⇒ Setting
searches fixed asset settings By passing in the appropriate options, you can search for available fixed asset types in the system.
-
#get_asset_settings_with_http_info(xero_tenant_id, opts = {}) ⇒ Array<(Setting, Integer, Hash)>
searches fixed asset settings By passing in the appropriate options, you can search for available fixed asset types in the system.
-
#get_asset_types(xero_tenant_id, opts = {}) ⇒ Array<AssetType>
searches fixed asset types By passing in the appropriate options, you can search for available fixed asset types in the system.
-
#get_asset_types_with_http_info(xero_tenant_id, opts = {}) ⇒ Array<(Array<AssetType>, Integer, Hash)>
searches fixed asset types By passing in the appropriate options, you can search for available fixed asset types in the system.
-
#get_assets(xero_tenant_id, status, opts = {}) ⇒ Assets
searches fixed asset By passing in the appropriate options, you can search for available fixed asset in the system.
-
#get_assets_with_http_info(xero_tenant_id, status, opts = {}) ⇒ Array<(Assets, Integer, Hash)>
searches fixed asset By passing in the appropriate options, you can search for available fixed asset in the system.
-
#initialize(api_client = ApiClient.new) ⇒ AssetApi
constructor
A new instance of AssetApi.
Constructor Details
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
14 15 16 |
# File 'lib/xero-ruby/api/asset_api.rb', line 14 def api_client @api_client end |
Instance Method Details
#create_asset(xero_tenant_id, asset, opts = {}) ⇒ Asset
adds a fixed asset Adds an asset to the system
25 26 27 28 |
# File 'lib/xero-ruby/api/asset_api.rb', line 25 def create_asset(xero_tenant_id, asset, opts = {}) data, _status_code, _headers = create_asset_with_http_info(xero_tenant_id, asset, opts) data end |
#create_asset_type(xero_tenant_id, opts = {}) ⇒ AssetType
adds a fixed asset type Adds an fixed asset type to the system
103 104 105 106 |
# File 'lib/xero-ruby/api/asset_api.rb', line 103 def create_asset_type(xero_tenant_id, opts = {}) data, _status_code, _headers = create_asset_type_with_http_info(xero_tenant_id, opts) data end |
#create_asset_type_with_http_info(xero_tenant_id, opts = {}) ⇒ Array<(AssetType, Integer, Hash)>
adds a fixed asset type Adds an fixed asset type to the system
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 169 |
# File 'lib/xero-ruby/api/asset_api.rb', line 114 def create_asset_type_with_http_info(xero_tenant_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AssetApi.create_asset_type ...' end # verify the required parameter 'xero_tenant_id' is set if @api_client.config.client_side_validation && xero_tenant_id.nil? fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AssetApi.create_asset_type" end # resource path local_var_path = '/AssetTypes' # camelize keys of incoming `where` opts opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? # query parameters query_params = opts[:query_params] || {} # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].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' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) header_params[:'xero-tenant-id'] = xero_tenant_id # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(opts[:'asset_type']) # return_type return_type = opts[:return_type] || 'AssetType' # auth_names auth_names = opts[:auth_names] || ['OAuth2'] = opts.merge( :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, "AssetApi", ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AssetApi#create_asset_type\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#create_asset_with_http_info(xero_tenant_id, asset, opts = {}) ⇒ Array<(Asset, Integer, Hash)>
adds a fixed asset Adds an asset to the system
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 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
# File 'lib/xero-ruby/api/asset_api.rb', line 36 def create_asset_with_http_info(xero_tenant_id, asset, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AssetApi.create_asset ...' end # verify the required parameter 'xero_tenant_id' is set if @api_client.config.client_side_validation && xero_tenant_id.nil? fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AssetApi.create_asset" end # verify the required parameter 'asset' is set if @api_client.config.client_side_validation && asset.nil? fail ArgumentError, "Missing the required parameter 'asset' when calling AssetApi.create_asset" end # resource path local_var_path = '/Assets' # camelize keys of incoming `where` opts opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? # query parameters query_params = opts[:query_params] || {} # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].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' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) header_params[:'xero-tenant-id'] = xero_tenant_id # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(asset) # return_type return_type = opts[:return_type] || 'Asset' # auth_names auth_names = opts[:auth_names] || ['OAuth2'] = opts.merge( :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, "AssetApi", ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AssetApi#create_asset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_asset_by_id(xero_tenant_id, id, opts = {}) ⇒ Asset
Retrieves fixed asset by id By passing in the appropriate asset id, you can search for a specific fixed asset in the system
177 178 179 180 |
# File 'lib/xero-ruby/api/asset_api.rb', line 177 def get_asset_by_id(xero_tenant_id, id, opts = {}) data, _status_code, _headers = get_asset_by_id_with_http_info(xero_tenant_id, id, opts) data end |
#get_asset_by_id_with_http_info(xero_tenant_id, id, opts = {}) ⇒ Array<(Asset, Integer, Hash)>
Retrieves fixed asset by id By passing in the appropriate asset id, you can search for a specific fixed asset in the system
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 243 244 245 |
# File 'lib/xero-ruby/api/asset_api.rb', line 188 def get_asset_by_id_with_http_info(xero_tenant_id, id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AssetApi.get_asset_by_id ...' end # verify the required parameter 'xero_tenant_id' is set if @api_client.config.client_side_validation && xero_tenant_id.nil? fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AssetApi.get_asset_by_id" end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling AssetApi.get_asset_by_id" end # resource path local_var_path = '/Assets/{id}'.sub('{' + 'id' + '}', id.to_s) # camelize keys of incoming `where` opts opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? # query parameters query_params = opts[:query_params] || {} # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) header_params[:'xero-tenant-id'] = xero_tenant_id # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'Asset' # auth_names auth_names = opts[:auth_names] || ['OAuth2'] = opts.merge( :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, "AssetApi", ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AssetApi#get_asset_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_asset_settings(xero_tenant_id, opts = {}) ⇒ Setting
searches fixed asset settings By passing in the appropriate options, you can search for available fixed asset types in the system
252 253 254 255 |
# File 'lib/xero-ruby/api/asset_api.rb', line 252 def get_asset_settings(xero_tenant_id, opts = {}) data, _status_code, _headers = get_asset_settings_with_http_info(xero_tenant_id, opts) data end |
#get_asset_settings_with_http_info(xero_tenant_id, opts = {}) ⇒ Array<(Setting, Integer, Hash)>
searches fixed asset settings By passing in the appropriate options, you can search for available fixed asset types in the system
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 312 313 314 315 |
# File 'lib/xero-ruby/api/asset_api.rb', line 262 def get_asset_settings_with_http_info(xero_tenant_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AssetApi.get_asset_settings ...' end # verify the required parameter 'xero_tenant_id' is set if @api_client.config.client_side_validation && xero_tenant_id.nil? fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AssetApi.get_asset_settings" end # resource path local_var_path = '/Settings' # camelize keys of incoming `where` opts opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? # query parameters query_params = opts[:query_params] || {} # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) header_params[:'xero-tenant-id'] = xero_tenant_id # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'Setting' # auth_names auth_names = opts[:auth_names] || ['OAuth2'] = opts.merge( :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, "AssetApi", ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AssetApi#get_asset_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_asset_types(xero_tenant_id, opts = {}) ⇒ Array<AssetType>
searches fixed asset types By passing in the appropriate options, you can search for available fixed asset types in the system
322 323 324 325 |
# File 'lib/xero-ruby/api/asset_api.rb', line 322 def get_asset_types(xero_tenant_id, opts = {}) data, _status_code, _headers = get_asset_types_with_http_info(xero_tenant_id, opts) data end |
#get_asset_types_with_http_info(xero_tenant_id, opts = {}) ⇒ Array<(Array<AssetType>, Integer, Hash)>
searches fixed asset types By passing in the appropriate options, you can search for available fixed asset types in the system
332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 |
# File 'lib/xero-ruby/api/asset_api.rb', line 332 def get_asset_types_with_http_info(xero_tenant_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AssetApi.get_asset_types ...' end # verify the required parameter 'xero_tenant_id' is set if @api_client.config.client_side_validation && xero_tenant_id.nil? fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AssetApi.get_asset_types" end # resource path local_var_path = '/AssetTypes' # camelize keys of incoming `where` opts opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? # query parameters query_params = opts[:query_params] || {} # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) header_params[:'xero-tenant-id'] = xero_tenant_id # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'Array<AssetType>' # auth_names auth_names = opts[:auth_names] || ['OAuth2'] = opts.merge( :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, "AssetApi", ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AssetApi#get_asset_types\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_assets(xero_tenant_id, status, opts = {}) ⇒ Assets
searches fixed asset By passing in the appropriate options, you can search for available fixed asset in the system
398 399 400 401 |
# File 'lib/xero-ruby/api/asset_api.rb', line 398 def get_assets(xero_tenant_id, status, opts = {}) data, _status_code, _headers = get_assets_with_http_info(xero_tenant_id, status, opts) data end |
#get_assets_with_http_info(xero_tenant_id, status, opts = {}) ⇒ Array<(Assets, Integer, Hash)>
searches fixed asset By passing in the appropriate options, you can search for available fixed asset in the system
414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 |
# File 'lib/xero-ruby/api/asset_api.rb', line 414 def get_assets_with_http_info(xero_tenant_id, status, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AssetApi.get_assets ...' end # verify the required parameter 'xero_tenant_id' is set if @api_client.config.client_side_validation && xero_tenant_id.nil? fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AssetApi.get_assets" end # verify the required parameter 'status' is set if @api_client.config.client_side_validation && status.nil? fail ArgumentError, "Missing the required parameter 'status' when calling AssetApi.get_assets" end allowable_values = ["AssetType", "AssetName", "AssetNumber", "PurchaseDate", "PurchasePrice", "DisposalDate", "DisposalPrice"] if @api_client.config.client_side_validation && opts[:'order_by'] && !allowable_values.include?(opts[:'order_by']) fail ArgumentError, "invalid value for \"order_by\", must be one of #{allowable_values}" end allowable_values = ["asc", "desc"] if @api_client.config.client_side_validation && opts[:'sort_direction'] && !allowable_values.include?(opts[:'sort_direction']) fail ArgumentError, "invalid value for \"sort_direction\", must be one of #{allowable_values}" end # resource path local_var_path = '/Assets' # camelize keys of incoming `where` opts opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? # query parameters query_params = opts[:query_params] || {} query_params[:'status'] = status query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'orderBy'] = opts[:'order_by'] if !opts[:'order_by'].nil? query_params[:'sortDirection'] = opts[:'sort_direction'] if !opts[:'sort_direction'].nil? query_params[:'filterBy'] = opts[:'filter_by'] if !opts[:'filter_by'].nil? # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) header_params[:'xero-tenant-id'] = xero_tenant_id # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'Assets' # auth_names auth_names = opts[:auth_names] || ['OAuth2'] = opts.merge( :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, "AssetApi", ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AssetApi#get_assets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |