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.default) ⇒ AssetApi
constructor
A new instance of AssetApi.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ AssetApi
Returns a new instance of AssetApi.
19 20 21 |
# File 'lib/xero-ruby/api/asset_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/xero-ruby/api/asset_api.rb', line 17 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
28 29 30 31 |
# File 'lib/xero-ruby/api/asset_api.rb', line 28 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
99 100 101 102 |
# File 'lib/xero-ruby/api/asset_api.rb', line 99 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
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 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 |
# File 'lib/xero-ruby/api/asset_api.rb', line 110 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' # 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' 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, ) 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
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 |
# File 'lib/xero-ruby/api/asset_api.rb', line 39 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' # 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' 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, ) 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
166 167 168 169 |
# File 'lib/xero-ruby/api/asset_api.rb', line 166 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
177 178 179 180 181 182 183 184 185 186 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 |
# File 'lib/xero-ruby/api/asset_api.rb', line 177 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) # 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']) 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, ) 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
234 235 236 237 |
# File 'lib/xero-ruby/api/asset_api.rb', line 234 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
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 290 |
# File 'lib/xero-ruby/api/asset_api.rb', line 244 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' # 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']) 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, ) 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
297 298 299 300 |
# File 'lib/xero-ruby/api/asset_api.rb', line 297 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
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 |
# File 'lib/xero-ruby/api/asset_api.rb', line 307 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' # 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']) 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, ) 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
366 367 368 369 |
# File 'lib/xero-ruby/api/asset_api.rb', line 366 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
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 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 |
# File 'lib/xero-ruby/api/asset_api.rb', line 382 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 allowable_values = ["AssetName", "AssetNumber", "Description", "AssetTypeName"] if @api_client.config.client_side_validation && opts[:'filter_by'] && !allowable_values.include?(opts[:'filter_by']) fail ArgumentError, "invalid value for \"filter_by\", must be one of #{allowable_values}" end # resource path local_var_path = '/Assets' # 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? # 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, ) 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 |