@@ -44,7 +44,7 @@ public class AssetApi {
4444 private ApiClient apiClient ;
4545 private static AssetApi instance = null ;
4646 private String userAgent = "Default" ;
47- private String version = "3.1.6 " ;
47+ private String version = "3.1.7 " ;
4848
4949 public AssetApi () {
5050 this (new ApiClient ());
@@ -88,19 +88,21 @@ public String getUserAgent() {
8888 * @return Asset
8989 * @throws IOException if an error occurs while attempting to invoke the API
9090 **/
91- public Asset createAsset (String accessToken , String xeroTenantId , Asset asset ) throws IOException {
92- TypeReference <Asset > typeRef = new TypeReference <Asset >() {};
91+ public Asset createAsset (String accessToken , String xeroTenantId , Asset asset ) throws IOException {
9392 try {
94- HttpResponse response = createAssetForHttpResponse (accessToken , xeroTenantId , asset );
93+ TypeReference <Asset > typeRef = new TypeReference <Asset >() {};
94+ HttpResponse response = createAssetForHttpResponse (accessToken , xeroTenantId , asset );
9595 return apiClient .getObjectMapper ().readValue (response .getContent (), typeRef );
9696 } catch (HttpResponseException e ) {
97- return apiClient .getObjectMapper ().readValue (e .getContent (), typeRef );
97+ XeroApiExceptionHandler handler = new XeroApiExceptionHandler ();
98+ handler .execute (e ,apiClient );
9899 } catch (IOException ioe ) {
99100 throw ioe ;
100101 }
102+ return null ;
101103 }
102104
103- public HttpResponse createAssetForHttpResponse (String accessToken , String xeroTenantId , Asset asset ) throws IOException {
105+ public HttpResponse createAssetForHttpResponse (String accessToken , String xeroTenantId , Asset asset ) throws IOException {
104106 // verify the required parameter 'xeroTenantId' is set
105107 if (xeroTenantId == null ) {
106108 throw new IllegalArgumentException ("Missing the required parameter 'xeroTenantId' when calling createAsset" );
@@ -112,7 +114,7 @@ public HttpResponse createAssetForHttpResponse(String accessToken, String xero
112114 throw new IllegalArgumentException ("Missing the required parameter 'accessToken' when calling createAsset" );
113115 }
114116 HttpHeaders headers = new HttpHeaders ();
115- headers .set ("xero-tenant-id " , xeroTenantId );
117+ headers .set ("Xero-Tenant-Id " , xeroTenantId );
116118 headers .setAccept ("application/json" );
117119 headers .setUserAgent (this .getUserAgent ());
118120
@@ -141,19 +143,21 @@ public HttpResponse createAssetForHttpResponse(String accessToken, String xero
141143 * @return AssetType
142144 * @throws IOException if an error occurs while attempting to invoke the API
143145 **/
144- public AssetType createAssetType (String accessToken , String xeroTenantId , AssetType assetType ) throws IOException {
145- TypeReference <AssetType > typeRef = new TypeReference <AssetType >() {};
146+ public AssetType createAssetType (String accessToken , String xeroTenantId , AssetType assetType ) throws IOException {
146147 try {
147- HttpResponse response = createAssetTypeForHttpResponse (accessToken , xeroTenantId , assetType );
148+ TypeReference <AssetType > typeRef = new TypeReference <AssetType >() {};
149+ HttpResponse response = createAssetTypeForHttpResponse (accessToken , xeroTenantId , assetType );
148150 return apiClient .getObjectMapper ().readValue (response .getContent (), typeRef );
149151 } catch (HttpResponseException e ) {
150- return apiClient .getObjectMapper ().readValue (e .getContent (), typeRef );
152+ XeroApiExceptionHandler handler = new XeroApiExceptionHandler ();
153+ handler .execute (e ,apiClient );
151154 } catch (IOException ioe ) {
152155 throw ioe ;
153156 }
157+ return null ;
154158 }
155159
156- public HttpResponse createAssetTypeForHttpResponse (String accessToken , String xeroTenantId , AssetType assetType ) throws IOException {
160+ public HttpResponse createAssetTypeForHttpResponse (String accessToken , String xeroTenantId , AssetType assetType ) throws IOException {
157161 // verify the required parameter 'xeroTenantId' is set
158162 if (xeroTenantId == null ) {
159163 throw new IllegalArgumentException ("Missing the required parameter 'xeroTenantId' when calling createAssetType" );
@@ -162,7 +166,7 @@ public HttpResponse createAssetTypeForHttpResponse(String accessToken, String
162166 throw new IllegalArgumentException ("Missing the required parameter 'accessToken' when calling createAssetType" );
163167 }
164168 HttpHeaders headers = new HttpHeaders ();
165- headers .set ("xero-tenant-id " , xeroTenantId );
169+ headers .set ("Xero-Tenant-Id " , xeroTenantId );
166170 headers .setAccept ("application/json" );
167171 headers .setUserAgent (this .getUserAgent ());
168172
@@ -190,19 +194,21 @@ public HttpResponse createAssetTypeForHttpResponse(String accessToken, String
190194 * @return Asset
191195 * @throws IOException if an error occurs while attempting to invoke the API
192196 **/
193- public Asset getAssetById (String accessToken , String xeroTenantId , UUID id ) throws IOException {
194- TypeReference <Asset > typeRef = new TypeReference <Asset >() {};
197+ public Asset getAssetById (String accessToken , String xeroTenantId , UUID id ) throws IOException {
195198 try {
196- HttpResponse response = getAssetByIdForHttpResponse (accessToken , xeroTenantId , id );
199+ TypeReference <Asset > typeRef = new TypeReference <Asset >() {};
200+ HttpResponse response = getAssetByIdForHttpResponse (accessToken , xeroTenantId , id );
197201 return apiClient .getObjectMapper ().readValue (response .getContent (), typeRef );
198202 } catch (HttpResponseException e ) {
199- return apiClient .getObjectMapper ().readValue (e .getContent (), typeRef );
203+ XeroApiExceptionHandler handler = new XeroApiExceptionHandler ();
204+ handler .execute (e ,apiClient );
200205 } catch (IOException ioe ) {
201206 throw ioe ;
202207 }
208+ return null ;
203209 }
204210
205- public HttpResponse getAssetByIdForHttpResponse (String accessToken , String xeroTenantId , UUID id ) throws IOException {
211+ public HttpResponse getAssetByIdForHttpResponse (String accessToken , String xeroTenantId , UUID id ) throws IOException {
206212 // verify the required parameter 'xeroTenantId' is set
207213 if (xeroTenantId == null ) {
208214 throw new IllegalArgumentException ("Missing the required parameter 'xeroTenantId' when calling getAssetById" );
@@ -214,7 +220,7 @@ public HttpResponse getAssetByIdForHttpResponse(String accessToken, String xer
214220 throw new IllegalArgumentException ("Missing the required parameter 'accessToken' when calling getAssetById" );
215221 }
216222 HttpHeaders headers = new HttpHeaders ();
217- headers .set ("xero-tenant-id " , xeroTenantId );
223+ headers .set ("Xero-Tenant-Id " , xeroTenantId );
218224 headers .setAccept ("application/json" );
219225 headers .setUserAgent (this .getUserAgent ());
220226
@@ -245,19 +251,21 @@ public HttpResponse getAssetByIdForHttpResponse(String accessToken, String xer
245251 * @return Setting
246252 * @throws IOException if an error occurs while attempting to invoke the API
247253 **/
248- public Setting getAssetSettings (String accessToken , String xeroTenantId ) throws IOException {
249- TypeReference <Setting > typeRef = new TypeReference <Setting >() {};
254+ public Setting getAssetSettings (String accessToken , String xeroTenantId ) throws IOException {
250255 try {
251- HttpResponse response = getAssetSettingsForHttpResponse (accessToken , xeroTenantId );
256+ TypeReference <Setting > typeRef = new TypeReference <Setting >() {};
257+ HttpResponse response = getAssetSettingsForHttpResponse (accessToken , xeroTenantId );
252258 return apiClient .getObjectMapper ().readValue (response .getContent (), typeRef );
253259 } catch (HttpResponseException e ) {
254- return apiClient .getObjectMapper ().readValue (e .getContent (), typeRef );
260+ XeroApiExceptionHandler handler = new XeroApiExceptionHandler ();
261+ handler .execute (e ,apiClient );
255262 } catch (IOException ioe ) {
256263 throw ioe ;
257264 }
265+ return null ;
258266 }
259267
260- public HttpResponse getAssetSettingsForHttpResponse (String accessToken , String xeroTenantId ) throws IOException {
268+ public HttpResponse getAssetSettingsForHttpResponse (String accessToken , String xeroTenantId ) throws IOException {
261269 // verify the required parameter 'xeroTenantId' is set
262270 if (xeroTenantId == null ) {
263271 throw new IllegalArgumentException ("Missing the required parameter 'xeroTenantId' when calling getAssetSettings" );
@@ -266,7 +274,7 @@ public HttpResponse getAssetSettingsForHttpResponse(String accessToken, String
266274 throw new IllegalArgumentException ("Missing the required parameter 'accessToken' when calling getAssetSettings" );
267275 }
268276 HttpHeaders headers = new HttpHeaders ();
269- headers .set ("xero-tenant-id " , xeroTenantId );
277+ headers .set ("Xero-Tenant-Id " , xeroTenantId );
270278 headers .setAccept ("application/json" );
271279 headers .setUserAgent (this .getUserAgent ());
272280
@@ -292,19 +300,21 @@ public HttpResponse getAssetSettingsForHttpResponse(String accessToken, String
292300 * @return List<AssetType>
293301 * @throws IOException if an error occurs while attempting to invoke the API
294302 **/
295- public List <AssetType > getAssetTypes (String accessToken , String xeroTenantId ) throws IOException {
296- TypeReference <List <AssetType >> typeRef = new TypeReference <List <AssetType >>() {};
303+ public List <AssetType > getAssetTypes (String accessToken , String xeroTenantId ) throws IOException {
297304 try {
298- HttpResponse response = getAssetTypesForHttpResponse (accessToken , xeroTenantId );
305+ TypeReference <List <AssetType >> typeRef = new TypeReference <List <AssetType >>() {};
306+ HttpResponse response = getAssetTypesForHttpResponse (accessToken , xeroTenantId );
299307 return apiClient .getObjectMapper ().readValue (response .getContent (), typeRef );
300308 } catch (HttpResponseException e ) {
301- return apiClient .getObjectMapper ().readValue (e .getContent (), typeRef );
309+ XeroApiExceptionHandler handler = new XeroApiExceptionHandler ();
310+ handler .execute (e ,apiClient );
302311 } catch (IOException ioe ) {
303312 throw ioe ;
304313 }
314+ return null ;
305315 }
306316
307- public HttpResponse getAssetTypesForHttpResponse (String accessToken , String xeroTenantId ) throws IOException {
317+ public HttpResponse getAssetTypesForHttpResponse (String accessToken , String xeroTenantId ) throws IOException {
308318 // verify the required parameter 'xeroTenantId' is set
309319 if (xeroTenantId == null ) {
310320 throw new IllegalArgumentException ("Missing the required parameter 'xeroTenantId' when calling getAssetTypes" );
@@ -313,7 +323,7 @@ public HttpResponse getAssetTypesForHttpResponse(String accessToken, String xe
313323 throw new IllegalArgumentException ("Missing the required parameter 'accessToken' when calling getAssetTypes" );
314324 }
315325 HttpHeaders headers = new HttpHeaders ();
316- headers .set ("xero-tenant-id " , xeroTenantId );
326+ headers .set ("Xero-Tenant-Id " , xeroTenantId );
317327 headers .setAccept ("application/json" );
318328 headers .setUserAgent (this .getUserAgent ());
319329
@@ -345,19 +355,21 @@ public HttpResponse getAssetTypesForHttpResponse(String accessToken, String xe
345355 * @return Assets
346356 * @throws IOException if an error occurs while attempting to invoke the API
347357 **/
348- public Assets getAssets (String accessToken , String xeroTenantId , String status , Integer page , Integer pageSize , String orderBy , String sortDirection , String filterBy ) throws IOException {
349- TypeReference <Assets > typeRef = new TypeReference <Assets >() {};
358+ public Assets getAssets (String accessToken , String xeroTenantId , String status , Integer page , Integer pageSize , String orderBy , String sortDirection , String filterBy ) throws IOException {
350359 try {
351- HttpResponse response = getAssetsForHttpResponse (accessToken , xeroTenantId , status , page , pageSize , orderBy , sortDirection , filterBy );
360+ TypeReference <Assets > typeRef = new TypeReference <Assets >() {};
361+ HttpResponse response = getAssetsForHttpResponse (accessToken , xeroTenantId , status , page , pageSize , orderBy , sortDirection , filterBy );
352362 return apiClient .getObjectMapper ().readValue (response .getContent (), typeRef );
353363 } catch (HttpResponseException e ) {
354- return apiClient .getObjectMapper ().readValue (e .getContent (), typeRef );
364+ XeroApiExceptionHandler handler = new XeroApiExceptionHandler ();
365+ handler .execute (e ,apiClient );
355366 } catch (IOException ioe ) {
356367 throw ioe ;
357368 }
369+ return null ;
358370 }
359371
360- public HttpResponse getAssetsForHttpResponse (String accessToken , String xeroTenantId , String status , Integer page , Integer pageSize , String orderBy , String sortDirection , String filterBy ) throws IOException {
372+ public HttpResponse getAssetsForHttpResponse (String accessToken , String xeroTenantId , String status , Integer page , Integer pageSize , String orderBy , String sortDirection , String filterBy ) throws IOException {
361373 // verify the required parameter 'xeroTenantId' is set
362374 if (xeroTenantId == null ) {
363375 throw new IllegalArgumentException ("Missing the required parameter 'xeroTenantId' when calling getAssets" );
@@ -369,7 +381,7 @@ public HttpResponse getAssetsForHttpResponse(String accessToken, String xeroTe
369381 throw new IllegalArgumentException ("Missing the required parameter 'accessToken' when calling getAssets" );
370382 }
371383 HttpHeaders headers = new HttpHeaders ();
372- headers .set ("xero-tenant-id " , xeroTenantId );
384+ headers .set ("Xero-Tenant-Id " , xeroTenantId );
373385 headers .setAccept ("application/json" );
374386 headers .setUserAgent (this .getUserAgent ());
375387
0 commit comments