1
1
/*
2
- * (C) Copyright IBM Corp. 2023 .
2
+ * (C) Copyright IBM Corp. 2024 .
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
5
5
* the License. You may obtain a copy of the License at
12
12
*/
13
13
14
14
/*
15
- * IBM OpenAPI SDK Code Generator Version: 3.60.2-95dc7721-20221102-203229
15
+ * IBM OpenAPI SDK Code Generator Version: 3.80.0-29334a73-20230925-151553
16
16
*/
17
17
18
18
package com .ibm .cloud .networking .direct_link .v1 ;
42
42
import com .ibm .cloud .networking .direct_link .v1 .model .GetGatewayExportRouteFilterOptions ;
43
43
import com .ibm .cloud .networking .direct_link .v1 .model .GetGatewayImportRouteFilterOptions ;
44
44
import com .ibm .cloud .networking .direct_link .v1 .model .GetGatewayOptions ;
45
+ import com .ibm .cloud .networking .direct_link .v1 .model .GetGatewayResponse ;
45
46
import com .ibm .cloud .networking .direct_link .v1 .model .GetGatewayRouteReportOptions ;
46
47
import com .ibm .cloud .networking .direct_link .v1 .model .GetGatewayStatisticsOptions ;
47
48
import com .ibm .cloud .networking .direct_link .v1 .model .GetGatewayStatusOptions ;
@@ -260,9 +261,9 @@ public ServiceCall<Void> deleteGateway(DeleteGatewayOptions deleteGatewayOptions
260
261
* Retrieve a Direct Link gateway.
261
262
*
262
263
* @param getGatewayOptions the {@link GetGatewayOptions} containing the options for the call
263
- * @return a {@link ServiceCall} with a result of type {@link Gateway }
264
+ * @return a {@link ServiceCall} with a result of type {@link GetGatewayResponse }
264
265
*/
265
- public ServiceCall <Gateway > getGateway (GetGatewayOptions getGatewayOptions ) {
266
+ public ServiceCall <GetGatewayResponse > getGateway (GetGatewayOptions getGatewayOptions ) {
266
267
com .ibm .cloud .sdk .core .util .Validator .notNull (getGatewayOptions ,
267
268
"getGatewayOptions cannot be null" );
268
269
Map <String , String > pathParamsMap = new HashMap <String , String >();
@@ -274,8 +275,8 @@ public ServiceCall<Gateway> getGateway(GetGatewayOptions getGatewayOptions) {
274
275
}
275
276
builder .header ("Accept" , "application/json" );
276
277
builder .query ("version" , String .valueOf (this .version ));
277
- ResponseConverter <Gateway > responseConverter =
278
- ResponseConverterUtils .getValue (new com .google .gson .reflect .TypeToken <Gateway >() { }.getType ());
278
+ ResponseConverter <GetGatewayResponse > responseConverter =
279
+ ResponseConverterUtils .getValue (new com .google .gson .reflect .TypeToken <GetGatewayResponse >() { }.getType ());
279
280
return createServiceCall (builder .build (), responseConverter );
280
281
}
281
282
@@ -299,56 +300,11 @@ public ServiceCall<Gateway> updateGateway(UpdateGatewayOptions updateGatewayOpti
299
300
}
300
301
builder .header ("Accept" , "application/json" );
301
302
builder .query ("version" , String .valueOf (this .version ));
302
- final JsonObject contentJson = new JsonObject ();
303
- if (updateGatewayOptions .authenticationKey () != null ) {
304
- contentJson .add ("authentication_key" , com .ibm .cloud .sdk .core .util .GsonSingleton .getGson ().toJsonTree (updateGatewayOptions .authenticationKey ()));
305
- }
306
- if (updateGatewayOptions .bfdConfig () != null ) {
307
- contentJson .add ("bfd_config" , com .ibm .cloud .sdk .core .util .GsonSingleton .getGson ().toJsonTree (updateGatewayOptions .bfdConfig ()));
308
- }
309
- if (updateGatewayOptions .bgpAsn () != null ) {
310
- contentJson .addProperty ("bgp_asn" , updateGatewayOptions .bgpAsn ());
311
- }
312
- if (updateGatewayOptions .bgpCerCidr () != null ) {
313
- contentJson .addProperty ("bgp_cer_cidr" , updateGatewayOptions .bgpCerCidr ());
314
- }
315
- if (updateGatewayOptions .bgpIbmCidr () != null ) {
316
- contentJson .addProperty ("bgp_ibm_cidr" , updateGatewayOptions .bgpIbmCidr ());
317
- }
318
- if (updateGatewayOptions .connectionMode () != null ) {
319
- contentJson .addProperty ("connection_mode" , updateGatewayOptions .connectionMode ());
320
- }
321
- if (updateGatewayOptions .defaultExportRouteFilter () != null ) {
322
- contentJson .addProperty ("default_export_route_filter" , updateGatewayOptions .defaultExportRouteFilter ());
323
- }
324
- if (updateGatewayOptions .defaultImportRouteFilter () != null ) {
325
- contentJson .addProperty ("default_import_route_filter" , updateGatewayOptions .defaultImportRouteFilter ());
326
- }
327
- if (updateGatewayOptions .global () != null ) {
328
- contentJson .addProperty ("global" , updateGatewayOptions .global ());
329
- }
330
- if (updateGatewayOptions .loaRejectReason () != null ) {
331
- contentJson .addProperty ("loa_reject_reason" , updateGatewayOptions .loaRejectReason ());
332
- }
333
- if (updateGatewayOptions .macsecConfig () != null ) {
334
- contentJson .add ("macsec_config" , com .ibm .cloud .sdk .core .util .GsonSingleton .getGson ().toJsonTree (updateGatewayOptions .macsecConfig ()));
335
- }
336
- if (updateGatewayOptions .metered () != null ) {
337
- contentJson .addProperty ("metered" , updateGatewayOptions .metered ());
338
- }
339
- if (updateGatewayOptions .name () != null ) {
340
- contentJson .addProperty ("name" , updateGatewayOptions .name ());
341
- }
342
- if (updateGatewayOptions .operationalStatus () != null ) {
343
- contentJson .addProperty ("operational_status" , updateGatewayOptions .operationalStatus ());
344
- }
345
- if (updateGatewayOptions .patchPanelCompletionNotice () != null ) {
346
- contentJson .addProperty ("patch_panel_completion_notice" , updateGatewayOptions .patchPanelCompletionNotice ());
347
- }
348
- if (updateGatewayOptions .speedMbps () != null ) {
349
- contentJson .addProperty ("speed_mbps" , updateGatewayOptions .speedMbps ());
350
- }
351
- builder .bodyJson (contentJson );
303
+ String patchBodyString = com .ibm .cloud .sdk .core .util .GsonSingleton .getGsonWithoutPrettyPrinting ().toJson (updateGatewayOptions .gatewayPatchTemplatePatch ());
304
+ patchBodyString = patchBodyString .replace (".0," , "," );
305
+ builder .bodyContent (patchBodyString , "application/merge-patch+json" );
306
+
307
+ builder .bodyContent (com .ibm .cloud .sdk .core .util .GsonSingleton .getGsonWithoutPrettyPrinting ().toJson (updateGatewayOptions .gatewayPatchTemplatePatch ()), "application/merge-patch+json" );
352
308
ResponseConverter <Gateway > responseConverter =
353
309
ResponseConverterUtils .getValue (new com .google .gson .reflect .TypeToken <Gateway >() { }.getType ());
354
310
return createServiceCall (builder .build (), responseConverter );
0 commit comments