From 6fa3e5f57b606f3648ed50cb84ca21856ad467b0 Mon Sep 17 00:00:00 2001 From: Taeeb Bandwala Date: Thu, 22 Sep 2022 05:47:17 +0530 Subject: [PATCH 1/7] Patch to remove projectId from createVrfRequest, VrfCreateInput, VirtualNetworkCreateInput, also updated VlanHelper --- internal/workflow/helpers/VlanHelper.java | 1 - ...reateinput-virtualnetworkcreateinput.patch | 60 +++++++++++++++++++ spec/oas3.patched.json | 21 +------ 3 files changed, 62 insertions(+), 20 deletions(-) create mode 100644 patches/spec.fetched.json/13-remove-projectId-from-createvrfrequest-vrfcreateinput-virtualnetworkcreateinput.patch diff --git a/internal/workflow/helpers/VlanHelper.java b/internal/workflow/helpers/VlanHelper.java index 3710eb57e..a452aed2a 100644 --- a/internal/workflow/helpers/VlanHelper.java +++ b/internal/workflow/helpers/VlanHelper.java @@ -42,7 +42,6 @@ public VirtualNetwork getVlanByVxlanInProjectMetro(UUID projectId, String metro, public VirtualNetwork createVlan(UUID projectId, String metro, Integer vxlan) throws ApiException { VirtualNetworkCreateInput vlanInput=new VirtualNetworkCreateInput() .metro(metro) - .projectId(projectId) .vxlan(vxlan); return vlansApi.createVirtualNetwork(projectId, vlanInput); } diff --git a/patches/spec.fetched.json/13-remove-projectId-from-createvrfrequest-vrfcreateinput-virtualnetworkcreateinput.patch b/patches/spec.fetched.json/13-remove-projectId-from-createvrfrequest-vrfcreateinput-virtualnetworkcreateinput.patch new file mode 100644 index 000000000..ed77c4584 --- /dev/null +++ b/patches/spec.fetched.json/13-remove-projectId-from-createvrfrequest-vrfcreateinput-virtualnetworkcreateinput.patch @@ -0,0 +1,60 @@ +diff --git a/spec/oas3.patched.json b/spec/oas3.patched.json +index ac06152..120b528 100644 +--- a/spec/oas3.patched.json ++++ b/spec/oas3.patched.json +@@ -4631,19 +4631,12 @@ + "description": "The UUID (or metro code) for the Metro in which to create this Virtual Network.", + "type": "string" + }, +- "project_id": { +- "format": "uuid", +- "type": "string" +- }, + "vxlan": { + "description": "VLAN ID between 2-3999. Must be unique for the project within the Metro in which this Virtual Network is being created. If no value is specified, the next-available VLAN ID in the range 1000-1999 will be automatically selected.", + "example": 1099, + "type": "integer" + } + }, +- "required": [ +- "project_id" +- ], + "type": "object" + }, + "VirtualNetworkList": { +@@ -4711,16 +4704,11 @@ + }, + "name": { + "type": "string" +- }, +- "project_id": { +- "format": "uuid", +- "type": "string" + } + }, + "required": [ + "metro", +- "name", +- "project_id" ++ "name" + ] + }, + "VrfIPRangeCreateInput": { +@@ -14744,16 +14732,11 @@ + }, + "name": { + "type": "string" +- }, +- "project_id": { +- "format": "uuid", +- "type": "string" + } + }, + "required": [ + "metro", +- "name", +- "project_id" ++ "name" + ] + } + } diff --git a/spec/oas3.patched.json b/spec/oas3.patched.json index ac06152d9..120b528a5 100644 --- a/spec/oas3.patched.json +++ b/spec/oas3.patched.json @@ -4631,19 +4631,12 @@ "description": "The UUID (or metro code) for the Metro in which to create this Virtual Network.", "type": "string" }, - "project_id": { - "format": "uuid", - "type": "string" - }, "vxlan": { "description": "VLAN ID between 2-3999. Must be unique for the project within the Metro in which this Virtual Network is being created. If no value is specified, the next-available VLAN ID in the range 1000-1999 will be automatically selected.", "example": 1099, "type": "integer" } }, - "required": [ - "project_id" - ], "type": "object" }, "VirtualNetworkList": { @@ -4711,16 +4704,11 @@ }, "name": { "type": "string" - }, - "project_id": { - "format": "uuid", - "type": "string" } }, "required": [ "metro", - "name", - "project_id" + "name" ] }, "VrfIPRangeCreateInput": { @@ -14744,16 +14732,11 @@ }, "name": { "type": "string" - }, - "project_id": { - "format": "uuid", - "type": "string" } }, "required": [ "metro", - "name", - "project_id" + "name" ] } } From cacb76ec949b8a573eec37d2d39a2ff8b7fd2573 Mon Sep 17 00:00:00 2001 From: Taeeb Bandwala Date: Thu, 22 Sep 2022 06:20:09 +0530 Subject: [PATCH 2/7] Patch input schema names of create metalgateway and ipreservation APIs, update metalgatewayoperator --- internal/workflow/MetalGatewayOperator.java | 55 ++++++++++++------- ...eate-metalgateway-ipreservation-apis.patch | 40 ++++++++++++++ spec/oas3.patched.json | 8 +-- 3 files changed, 79 insertions(+), 24 deletions(-) create mode 100644 patches/spec.fetched.json/14-rename-input-schemas-of-create-metalgateway-ipreservation-apis.patch diff --git a/internal/workflow/MetalGatewayOperator.java b/internal/workflow/MetalGatewayOperator.java index 59e6dcf90..571d6b74f 100644 --- a/internal/workflow/MetalGatewayOperator.java +++ b/internal/workflow/MetalGatewayOperator.java @@ -12,14 +12,16 @@ import com.equinix.openapi.metal.v1.model.CreateMetalGatewayRequest; import com.equinix.openapi.metal.v1.model.MetalGateway; import com.equinix.openapi.metal.v1.model.MetalGateway.StateEnum; -import com.equinix.openapi.metal.v1.model.MetalGatewayInput; +import com.equinix.openapi.metal.v1.model.MetalGatewayCreateInput; import com.equinix.openapi.metal.v1.model.VirtualNetwork; import com.equinix.workflow.helpers.VlanHelper; public class MetalGatewayOperator { private MetalGatewaysApi metalGatewaysApi; private VlanHelper vlanHelper; - private final List targetState= Arrays.asList(StateEnum.ACTIVE, StateEnum.READY); + private static final Integer RESPONSE_PAGE = 1; + private static final Integer RESPONSE_ITEMS_PER_PAGE = 10; + private static final String VIRTUAL_NETWORK = "virtual_network"; public MetalGatewayOperator(ApiClient apiClient) { this.metalGatewaysApi = new MetalGatewaysApi(apiClient); @@ -38,48 +40,61 @@ public VirtualNetwork getVlanOfMetalGateway(UUID metalGatewayId) throws ApiExcep } // Creates a Metal Gateway with a private IPv4 block specified for the associated Virtual Network - public MetalGateway createMetalGatewayWithPrivateIpBlockAndPoll(UUID projectId, String metro, Integer vxlan, Integer privateIpv4SubnetSize, int retries, Duration wait) + public MetalGateway createMetalGatewayWithPrivateIpBlock(UUID projectId, String metro, Integer vxlan, Integer privateIpv4SubnetSize) throws ApiException, InterruptedException { VirtualNetwork vlan = vlanHelper.getVlanByVxlanInProjectMetro(projectId, metro, vxlan); if (vlan==null) vlan = vlanHelper.createVlan(projectId, metro, vxlan); - MetalGatewayInput metalGatewayInput = new MetalGatewayInput() + MetalGatewayCreateInput metalGatewayCreateInput = new MetalGatewayCreateInput() .privateIpv4SubnetSize(privateIpv4SubnetSize) .virtualNetworkId(vlan.getId()); - CreateMetalGatewayRequest createMetalGatewayRequest = new CreateMetalGatewayRequest(metalGatewayInput); - MetalGateway metalGateway = metalGatewaysApi.createMetalGateway(projectId, createMetalGatewayRequest,1, 10); - return metalGatewayCreatedAndPoll(metalGateway, retries, wait); + CreateMetalGatewayRequest createMetalGatewayRequest = new CreateMetalGatewayRequest(metalGatewayCreateInput); + return metalGatewaysApi.createMetalGateway(projectId, createMetalGatewayRequest, RESPONSE_PAGE, RESPONSE_ITEMS_PER_PAGE); } - // Poll until state of metal gateway becomes "active" or "ready" - private MetalGateway metalGatewayCreatedAndPoll(MetalGateway metalGateway, int retries, Duration wait) - throws ApiException, InterruptedException { + // Poll until metal gateway record is deleted when state is "deleting" + private void metalGatewayDeletedAndPoll(MetalGateway metalGateway, int retries, Duration wait) + throws InterruptedException, ApiException { - UUID metalGatewayId; - for (int i=0; i Date: Thu, 22 Sep 2022 06:28:09 +0530 Subject: [PATCH 3/7] Remove duplicated request schema for createVrf API --- ...ted-request-schema-for-createvrf-api.patch | 39 +++++++++++++++++++ spec/oas3.patched.json | 28 +------------ 2 files changed, 40 insertions(+), 27 deletions(-) create mode 100644 patches/spec.fetched.json/15-remove-duplicated-request-schema-for-createvrf-api.patch diff --git a/patches/spec.fetched.json/15-remove-duplicated-request-schema-for-createvrf-api.patch b/patches/spec.fetched.json/15-remove-duplicated-request-schema-for-createvrf-api.patch new file mode 100644 index 000000000..876b32235 --- /dev/null +++ b/patches/spec.fetched.json/15-remove-duplicated-request-schema-for-createvrf-api.patch @@ -0,0 +1,39 @@ +diff --git a/spec/oas3.patched.json b/spec/oas3.patched.json +index 7145d51..aff92d5 100644 +--- a/spec/oas3.patched.json ++++ b/spec/oas3.patched.json +@@ -14711,33 +14711,7 @@ + "content": { + "application/json": { + "schema": { +- "properties": { +- "description": { +- "type": "string" +- }, +- "ip_ranges": { +- "type": "array", +- "items": { +- "type": "string" +- }, +- "description": "A list of CIDR network addresses. Like [\"10.0.0.0/16\", \"2001:d78::/56\"]. IPv4 blocks must be between /8 and /29 in size. IPv6 blocks must be between /56 and /64. A VRF\\'s IP ranges must be defined in order to create VRF IP Reservations, which can then be used for Metal Gateways or Virtual Circuits." +- }, +- "local_asn": { +- "type": "integer", +- "format": "int32" +- }, +- "metro": { +- "description": "The UUID (or metro code) for the Metro in which to create this VRF.", +- "type": "string" +- }, +- "name": { +- "type": "string" +- } +- }, +- "required": [ +- "metro", +- "name" +- ] ++ "$ref": "#/components/schemas/VrfCreateInput" + } + } + }, diff --git a/spec/oas3.patched.json b/spec/oas3.patched.json index 7145d5183..aff92d54b 100644 --- a/spec/oas3.patched.json +++ b/spec/oas3.patched.json @@ -14711,33 +14711,7 @@ "content": { "application/json": { "schema": { - "properties": { - "description": { - "type": "string" - }, - "ip_ranges": { - "type": "array", - "items": { - "type": "string" - }, - "description": "A list of CIDR network addresses. Like [\"10.0.0.0/16\", \"2001:d78::/56\"]. IPv4 blocks must be between /8 and /29 in size. IPv6 blocks must be between /56 and /64. A VRF\\'s IP ranges must be defined in order to create VRF IP Reservations, which can then be used for Metal Gateways or Virtual Circuits." - }, - "local_asn": { - "type": "integer", - "format": "int32" - }, - "metro": { - "description": "The UUID (or metro code) for the Metro in which to create this VRF.", - "type": "string" - }, - "name": { - "type": "string" - } - }, - "required": [ - "metro", - "name" - ] + "$ref": "#/components/schemas/VrfCreateInput" } } }, From 6f456b43718a9c44bf910bc79e0608f8dc92b35d Mon Sep 17 00:00:00 2001 From: Taeeb Bandwala Date: Thu, 22 Sep 2022 06:33:10 +0530 Subject: [PATCH 4/7] Update gitignore, TestMetalGatewayOperator --- .gitignore | 4 +++- .../equinix/test/functional/TestMetalGatewayOperator.java | 6 ++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 841b5be1b..6ffbdbab3 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ -openapi-generator* \ No newline at end of file +openapi-generator* +.DS_Store +.idea \ No newline at end of file diff --git a/equinix-functional-test/src/test/java/com/equinix/test/functional/TestMetalGatewayOperator.java b/equinix-functional-test/src/test/java/com/equinix/test/functional/TestMetalGatewayOperator.java index 4a61a586a..99e66063d 100644 --- a/equinix-functional-test/src/test/java/com/equinix/test/functional/TestMetalGatewayOperator.java +++ b/equinix-functional-test/src/test/java/com/equinix/test/functional/TestMetalGatewayOperator.java @@ -21,11 +21,9 @@ public class TestMetalGatewayOperator { private static final Logger logger = LoggerFactory.getLogger(TestMetalGatewayOperator.class); - private final String propFilename = "src/test/resources/metalgateway-test.properties"; private final String sysTokenKey = "FUNCTIONAL_TEST_TOKEN"; private final String sysProjUuidKey = "FUNCTIONAL_TEST_PROJECT_UUID"; - private HashMap props; private MetalGatewayOperator metalGatewayOperator; private VlanHelper vlanHelper; @@ -58,7 +56,7 @@ public void testMetalGatewayCreationWithPrivateIpBlockAndPolling() throws ApiExc Duration wait = Duration.ofSeconds(5); logger.info("Provisioning metal gateway with the vlan attached to it..."); - MetalGateway createdMetalGateway = metalGatewayOperator.createMetalGatewayWithPrivateIpBlockAndPoll(projectId, metro, vxlan, privateIpv4SubnetSize, retries, wait); + MetalGateway createdMetalGateway = metalGatewayOperator.createMetalGatewayWithPrivateIpBlock(projectId, metro, vxlan, privateIpv4SubnetSize); UUID metalGatewayId = createdMetalGateway.getId(); Assert.assertNotNull(createdMetalGateway.getState()); @@ -75,7 +73,7 @@ public void testMetalGatewayCreationWithPrivateIpBlockAndPolling() throws ApiExc logger.info(String.format("Vxlan ID of associated VLAN: %s", vlanOfMetalGateway.getVxlan())); logger.info("Deleting vlan and metal gateway ..."); - metalGatewayOperator.deleteVlanAndMetalGateway(metalGatewayId); + metalGatewayOperator.deleteVlanAndMetalGateway(metalGatewayId, retries, wait); Assert.assertNull(vlanHelper.getVlanByVxlanInProjectMetro(projectId, metro, vxlan)); Assert.assertThrows(ApiException.class, () -> metalGatewayOperator.getMetalGateway(metalGatewayId, null, null)); } From 05983c64fd551aaa101d40c51b5802f9cf756689 Mon Sep 17 00:00:00 2001 From: "equinix-labs@auto-commit-workflow" Date: Thu, 22 Sep 2022 01:04:18 +0000 Subject: [PATCH 5/7] Auto commit generated client changes - Thu Sep 22 01:04:18 UTC 2022 --- .../.openapi-generator/FILES | 15 +- equinix-openapi-metal/README.md | 5 +- equinix-openapi-metal/api/openapi.yaml | 665 +++++++++--------- .../docs/CreateVrfRequest.md | 18 - ....md => DefaultIPReservationCreateInput.md} | 2 +- ...wayInput.md => MetalGatewayCreateInput.md} | 2 +- .../docs/VirtualNetworkCreateInput.md | 1 - equinix-openapi-metal/docs/VrfCreateInput.md | 1 - equinix-openapi-metal/docs/VrfsApi.md | 8 +- .../main/java/com/equinix/openapi/JSON.java | 5 +- .../equinix/openapi/metal/v1/api/VrfsApi.java | 36 +- .../openapi/metal/v1/model/AuthTokenList.java | 22 +- .../metal/v1/model/AuthTokenProject.java | 132 ++-- .../openapi/metal/v1/model/AuthTokenUser.java | 22 +- .../equinix/openapi/metal/v1/model/Batch.java | 22 +- .../openapi/metal/v1/model/BatchesList.java | 22 +- .../openapi/metal/v1/model/BgpConfig.java | 44 +- .../metal/v1/model/BgpNeighborData.java | 44 +- .../metal/v1/model/BgpSessionList.java | 22 +- .../metal/v1/model/BgpSessionNeighbors.java | 22 +- .../model/CapacityCheckPerFacilityList.java | 22 +- .../v1/model/CapacityCheckPerMetroList.java | 22 +- .../openapi/metal/v1/model/CapacityInput.java | 22 +- .../metal/v1/model/CapacityPerMetroInput.java | 22 +- .../v1/model/CreateMetalGatewayRequest.java | 56 +- .../CreateSelfServiceReservationRequest.java | 22 +- .../metal/v1/model/CreateVrfRequest.java | 457 ------------ .../metal/v1/model/DefaultIPReservation.java | 22 +- .../v1/model/DefaultIPReservationAllOf.java | 22 +- ...a => DefaultIPReservationCreateInput.java} | 88 +-- .../openapi/metal/v1/model/Device.java | 132 ++-- .../metal/v1/model/DeviceCreateInput.java | 44 +- .../openapi/metal/v1/model/DeviceList.java | 22 +- .../metal/v1/model/DeviceUsageList.java | 22 +- .../equinix/openapi/metal/v1/model/Event.java | 22 +- .../openapi/metal/v1/model/EventList.java | 22 +- .../openapi/metal/v1/model/FacilityList.java | 22 +- .../metal/v1/model/GlobalBgpRangeList.java | 22 +- .../v1/model/HardwareReservationList.java | 22 +- .../metal/v1/model/IPAssignmentList.java | 22 +- .../metal/v1/model/IPReservationList.java | 22 +- .../v1/model/InstancesBatchCreateInput.java | 22 +- ...InstancesBatchCreateInputBatchesInner.java | 22 +- .../metal/v1/model/Interconnection.java | 44 +- .../metal/v1/model/InterconnectionList.java | 22 +- .../v1/model/InterconnectionPortList.java | 22 +- .../metal/v1/model/InvitationList.java | 22 +- .../openapi/metal/v1/model/LicenseList.java | 22 +- .../metal/v1/model/MembershipList.java | 22 +- ...nput.java => MetalGatewayCreateInput.java} | 62 +- .../metal/v1/model/MetalGatewayList.java | 22 +- .../openapi/metal/v1/model/MetroList.java | 22 +- .../metal/v1/model/OperatingSystemList.java | 22 +- .../openapi/metal/v1/model/Organization.java | 66 +- .../metal/v1/model/OrganizationList.java | 22 +- .../openapi/metal/v1/model/PaymentMethod.java | 22 +- .../metal/v1/model/PaymentMethodList.java | 22 +- .../equinix/openapi/metal/v1/model/Plan.java | 44 +- .../openapi/metal/v1/model/PlanList.java | 22 +- .../equinix/openapi/metal/v1/model/Port.java | 22 +- .../v1/model/PortConvertLayer3Input.java | 22 +- .../v1/model/PortVlanAssignmentBatch.java | 22 +- .../PortVlanAssignmentBatchCreateInput.java | 22 +- .../v1/model/PortVlanAssignmentBatchList.java | 22 +- .../v1/model/PortVlanAssignmentList.java | 22 +- .../openapi/metal/v1/model/Project.java | 132 ++-- .../openapi/metal/v1/model/ProjectList.java | 22 +- .../metal/v1/model/ProjectUsageList.java | 22 +- .../v1/model/RequestIPReservationRequest.java | 56 +- .../openapi/metal/v1/model/SSHKeyList.java | 22 +- .../v1/model/SelfServiceReservationList.java | 22 +- .../model/SelfServiceReservationResponse.java | 22 +- .../metal/v1/model/SpotMarketRequestList.java | 22 +- .../metal/v1/model/TransferRequestList.java | 22 +- .../equinix/openapi/metal/v1/model/User.java | 22 +- .../metal/v1/model/UserCreateInput.java | 22 +- .../openapi/metal/v1/model/UserList.java | 22 +- .../metal/v1/model/VirtualCircuitList.java | 22 +- .../metal/v1/model/VirtualNetwork.java | 44 +- .../v1/model/VirtualNetworkCreateInput.java | 44 +- .../metal/v1/model/VirtualNetworkList.java | 22 +- .../metal/v1/model/VrfCreateInput.java | 39 +- .../metal/v1/model/VrfIPReservationList.java | 22 +- .../openapi/metal/v1/model/VrfList.java | 22 +- .../workflow/MetalGatewayOperator.java | 55 +- .../equinix/workflow/helpers/VlanHelper.java | 1 - .../openapi/metal/v1/api/VrfsApiTest.java | 6 +- .../model/CreateMetalGatewayRequestTest.java | 2 +- .../metal/v1/model/CreateVrfRequestTest.java | 93 --- ... DefaultIPReservationCreateInputTest.java} | 12 +- ....java => MetalGatewayCreateInputTest.java} | 12 +- .../RequestIPReservationRequestTest.java | 2 +- .../model/VirtualNetworkCreateInputTest.java | 9 - .../metal/v1/model/VrfCreateInputTest.java | 9 - 94 files changed, 1626 insertions(+), 2093 deletions(-) delete mode 100644 equinix-openapi-metal/docs/CreateVrfRequest.md rename equinix-openapi-metal/docs/{IPReservationRequestInput.md => DefaultIPReservationCreateInput.md} (94%) rename equinix-openapi-metal/docs/{MetalGatewayInput.md => MetalGatewayCreateInput.md} (97%) delete mode 100644 equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/CreateVrfRequest.java rename equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/{IPReservationRequestInput.java => DefaultIPReservationCreateInput.java} (81%) rename equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/{MetalGatewayInput.java => MetalGatewayCreateInput.java} (84%) delete mode 100644 equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/CreateVrfRequestTest.java rename equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/{IPReservationRequestInputTest.java => DefaultIPReservationCreateInputTest.java} (86%) rename equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/{MetalGatewayInputTest.java => MetalGatewayCreateInputTest.java} (83%) diff --git a/equinix-openapi-metal/.openapi-generator/FILES b/equinix-openapi-metal/.openapi-generator/FILES index b70e2acd0..832bfca76 100644 --- a/equinix-openapi-metal/.openapi-generator/FILES +++ b/equinix-openapi-metal/.openapi-generator/FILES @@ -46,9 +46,9 @@ docs/CreateEmailInput.md docs/CreateMetalGatewayRequest.md docs/CreateSelfServiceReservationRequest.md docs/CreateSelfServiceReservationRequestPeriod.md -docs/CreateVrfRequest.md docs/DefaultIPReservation.md docs/DefaultIPReservationAllOf.md +docs/DefaultIPReservationCreateInput.md docs/Device.md docs/DeviceActionsInner.md docs/DeviceCreateInput.md @@ -90,7 +90,6 @@ docs/IPAvailabilitiesList.md docs/IPReservation.md docs/IPReservationList.md docs/IPReservationMetro.md -docs/IPReservationRequestInput.md docs/IncidentsApi.md docs/InstancesBatchCreateInput.md docs/InstancesBatchCreateInputBatchesInner.md @@ -118,7 +117,7 @@ docs/MembershipList.md docs/MembershipsApi.md docs/Meta.md docs/MetalGateway.md -docs/MetalGatewayInput.md +docs/MetalGatewayCreateInput.md docs/MetalGatewayIpReservation.md docs/MetalGatewayList.md docs/MetalGatewayLite.md @@ -339,9 +338,9 @@ src/main/java/com/equinix/openapi/metal/v1/model/CreateEmailInput.java src/main/java/com/equinix/openapi/metal/v1/model/CreateMetalGatewayRequest.java src/main/java/com/equinix/openapi/metal/v1/model/CreateSelfServiceReservationRequest.java src/main/java/com/equinix/openapi/metal/v1/model/CreateSelfServiceReservationRequestPeriod.java -src/main/java/com/equinix/openapi/metal/v1/model/CreateVrfRequest.java src/main/java/com/equinix/openapi/metal/v1/model/DefaultIPReservation.java src/main/java/com/equinix/openapi/metal/v1/model/DefaultIPReservationAllOf.java +src/main/java/com/equinix/openapi/metal/v1/model/DefaultIPReservationCreateInput.java src/main/java/com/equinix/openapi/metal/v1/model/Device.java src/main/java/com/equinix/openapi/metal/v1/model/DeviceActionsInner.java src/main/java/com/equinix/openapi/metal/v1/model/DeviceCreateInput.java @@ -378,7 +377,6 @@ src/main/java/com/equinix/openapi/metal/v1/model/IPAvailabilitiesList.java src/main/java/com/equinix/openapi/metal/v1/model/IPReservation.java src/main/java/com/equinix/openapi/metal/v1/model/IPReservationList.java src/main/java/com/equinix/openapi/metal/v1/model/IPReservationMetro.java -src/main/java/com/equinix/openapi/metal/v1/model/IPReservationRequestInput.java src/main/java/com/equinix/openapi/metal/v1/model/InstancesBatchCreateInput.java src/main/java/com/equinix/openapi/metal/v1/model/InstancesBatchCreateInputBatchesInner.java src/main/java/com/equinix/openapi/metal/v1/model/InstancesBatchCreateInputBatchesInnerIpAddressesInner.java @@ -401,7 +399,7 @@ src/main/java/com/equinix/openapi/metal/v1/model/MembershipInput.java src/main/java/com/equinix/openapi/metal/v1/model/MembershipList.java src/main/java/com/equinix/openapi/metal/v1/model/Meta.java src/main/java/com/equinix/openapi/metal/v1/model/MetalGateway.java -src/main/java/com/equinix/openapi/metal/v1/model/MetalGatewayInput.java +src/main/java/com/equinix/openapi/metal/v1/model/MetalGatewayCreateInput.java src/main/java/com/equinix/openapi/metal/v1/model/MetalGatewayIpReservation.java src/main/java/com/equinix/openapi/metal/v1/model/MetalGatewayList.java src/main/java/com/equinix/openapi/metal/v1/model/MetalGatewayLite.java @@ -573,8 +571,8 @@ src/test/java/com/equinix/openapi/metal/v1/model/CreateEmailInputTest.java src/test/java/com/equinix/openapi/metal/v1/model/CreateMetalGatewayRequestTest.java src/test/java/com/equinix/openapi/metal/v1/model/CreateSelfServiceReservationRequestPeriodTest.java src/test/java/com/equinix/openapi/metal/v1/model/CreateSelfServiceReservationRequestTest.java -src/test/java/com/equinix/openapi/metal/v1/model/CreateVrfRequestTest.java src/test/java/com/equinix/openapi/metal/v1/model/DefaultIPReservationAllOfTest.java +src/test/java/com/equinix/openapi/metal/v1/model/DefaultIPReservationCreateInputTest.java src/test/java/com/equinix/openapi/metal/v1/model/DefaultIPReservationTest.java src/test/java/com/equinix/openapi/metal/v1/model/DeviceActionsInnerTest.java src/test/java/com/equinix/openapi/metal/v1/model/DeviceCreateInputIpAddressesInnerTest.java @@ -611,7 +609,6 @@ src/test/java/com/equinix/openapi/metal/v1/model/IPAssignmentTest.java src/test/java/com/equinix/openapi/metal/v1/model/IPAvailabilitiesListTest.java src/test/java/com/equinix/openapi/metal/v1/model/IPReservationListTest.java src/test/java/com/equinix/openapi/metal/v1/model/IPReservationMetroTest.java -src/test/java/com/equinix/openapi/metal/v1/model/IPReservationRequestInputTest.java src/test/java/com/equinix/openapi/metal/v1/model/IPReservationTest.java src/test/java/com/equinix/openapi/metal/v1/model/InstancesBatchCreateInputBatchesInnerIpAddressesInnerTest.java src/test/java/com/equinix/openapi/metal/v1/model/InstancesBatchCreateInputBatchesInnerTest.java @@ -634,7 +631,7 @@ src/test/java/com/equinix/openapi/metal/v1/model/MembershipInputTest.java src/test/java/com/equinix/openapi/metal/v1/model/MembershipListTest.java src/test/java/com/equinix/openapi/metal/v1/model/MembershipTest.java src/test/java/com/equinix/openapi/metal/v1/model/MetaTest.java -src/test/java/com/equinix/openapi/metal/v1/model/MetalGatewayInputTest.java +src/test/java/com/equinix/openapi/metal/v1/model/MetalGatewayCreateInputTest.java src/test/java/com/equinix/openapi/metal/v1/model/MetalGatewayIpReservationTest.java src/test/java/com/equinix/openapi/metal/v1/model/MetalGatewayListTest.java src/test/java/com/equinix/openapi/metal/v1/model/MetalGatewayLiteTest.java diff --git a/equinix-openapi-metal/README.md b/equinix-openapi-metal/README.md index ee5ab3e7f..87fd28f7f 100644 --- a/equinix-openapi-metal/README.md +++ b/equinix-openapi-metal/README.md @@ -361,9 +361,9 @@ Class | Method | HTTP request | Description - [CreateMetalGatewayRequest](docs/CreateMetalGatewayRequest.md) - [CreateSelfServiceReservationRequest](docs/CreateSelfServiceReservationRequest.md) - [CreateSelfServiceReservationRequestPeriod](docs/CreateSelfServiceReservationRequestPeriod.md) - - [CreateVrfRequest](docs/CreateVrfRequest.md) - [DefaultIPReservation](docs/DefaultIPReservation.md) - [DefaultIPReservationAllOf](docs/DefaultIPReservationAllOf.md) + - [DefaultIPReservationCreateInput](docs/DefaultIPReservationCreateInput.md) - [Device](docs/Device.md) - [DeviceActionsInner](docs/DeviceActionsInner.md) - [DeviceCreateInput](docs/DeviceCreateInput.md) @@ -400,7 +400,6 @@ Class | Method | HTTP request | Description - [IPReservation](docs/IPReservation.md) - [IPReservationList](docs/IPReservationList.md) - [IPReservationMetro](docs/IPReservationMetro.md) - - [IPReservationRequestInput](docs/IPReservationRequestInput.md) - [InstancesBatchCreateInput](docs/InstancesBatchCreateInput.md) - [InstancesBatchCreateInputBatchesInner](docs/InstancesBatchCreateInputBatchesInner.md) - [InstancesBatchCreateInputBatchesInnerIpAddressesInner](docs/InstancesBatchCreateInputBatchesInnerIpAddressesInner.md) @@ -423,7 +422,7 @@ Class | Method | HTTP request | Description - [MembershipList](docs/MembershipList.md) - [Meta](docs/Meta.md) - [MetalGateway](docs/MetalGateway.md) - - [MetalGatewayInput](docs/MetalGatewayInput.md) + - [MetalGatewayCreateInput](docs/MetalGatewayCreateInput.md) - [MetalGatewayIpReservation](docs/MetalGatewayIpReservation.md) - [MetalGatewayList](docs/MetalGatewayList.md) - [MetalGatewayLite](docs/MetalGatewayLite.md) diff --git a/equinix-openapi-metal/api/openapi.yaml b/equinix-openapi-metal/api/openapi.yaml index 9f423438e..2a15ffcb1 100644 --- a/equinix-openapi-metal/api/openapi.yaml +++ b/equinix-openapi-metal/api/openapi.yaml @@ -3,10 +3,12 @@ info: contact: email: support@equinixmetal.com name: Equinix Metal API Team - description: "This is the API for Equinix Metal. The API allows you to programmatically\ - \ interact with all\nof your Equinix Metal resources, including devices, networks,\ - \ addresses, organizations,\nprojects, and your user account.\n\nThe official\ - \ API docs are hosted at .\n" + description: | + This is the API for Equinix Metal. The API allows you to programmatically interact with all + of your Equinix Metal resources, including devices, networks, addresses, organizations, + projects, and your user account. + + The official API docs are hosted at . license: name: Equinix Metal url: https://metal.equinix.com/legal/ @@ -18,83 +20,134 @@ servers: security: - x_auth_token: [] tags: -- description: "Hint: Equinix Metal's API can be reached at https://api.equinix.com/metal/v1\n\ - \nMost of the endpoints in the API require authentication. Authenticating is done\ - \ with an authentication token in the X-Auth-Token header.\n\n```\ncurl -H 'X-Auth-Token:\ - \ my_authentication_token'\n```\n\nAuthentication tokens are used to identify\ - \ the user your application is connecting to the API on behalf of. Think of authentication\ - \ tokens as permanent sessions—the user creates authentication tokens, and your\ - \ app can use them to connect to the API on their behalf until they delete the\ - \ token.\n\n" +- description: |+ + Hint: Equinix Metal's API can be reached at https://api.equinix.com/metal/v1 + + Most of the endpoints in the API require authentication. Authenticating is done with an authentication token in the X-Auth-Token header. + + ``` + curl -H 'X-Auth-Token: my_authentication_token' + ``` + + Authentication tokens are used to identify the user your application is connecting to the API on behalf of. Think of authentication tokens as permanent sessions—the user creates authentication tokens, and your app can use them to connect to the API on their behalf until they delete the token. + externalDocs: url: https://metal.equinix.com/developers/docs/accounts/users/#api-keys name: Authentication -- description: "The Equinix Metal API uses a few methods to minimize network traffic\ - \ and bandwidth:\n\n`include`\n\nFor resources that contain collections of other\ - \ resources, the Equinix Metal API will return links to the other resources by\ - \ default.\n\n```json\n{\n ...\n // Includes \"href\" links if the resource\ - \ is reachable through the API.\n \"projects\": [\n { \"href\": \"/projects/5b590e4f-be96-4400-ae32-c315ee67964d\"\ - \ },\n { \"href\": \"/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" }\n \ - \ ],\n // Includes \"id\" attributes if not.\n \"emails\": [\n { \"id\":\ - \ \"eb5d8c89-4d15-4c87-859c-5ae190ad5d9a\" },\n { \"id\": \"c17f77ad-9070-4084-abaa-7538581d9523\"\ - \ }\n ]\n ...\n}\n```\n\nHowever, if you're interested in acting on resources\ - \ in the projects collection, it doesn't make sense to make a separate API call\ - \ to retrieve each project. Instead, you can specify which collections you'd like\ - \ to be included using the include parameter.\n\n```\n/user?include=projects\n\ - ```\nwill return\n\n```json\n{\n ...\n \"projects\": [\n {\n \"href\"\ - : \"/projects/c851d3c5-d55d-4b1a-99f1-96fc64768bc3\",\n \"id\": \"c851d3c5-d55d-4b1a-99f1-96fc64768bc3\"\ - ,\n \"name\": \"Project 1\",\n ...\n },\n {\n \"href\": \"\ - /projects/21f8e88b-bd4e-44ca-b956-4f3f88e6e5f2\",\n \"id\": \"21f8e88b-bd4e-44ca-b956-4f3f88e6e5f2\"\ - ,\n \"name\": \"Project 2\",\n ...\n }\n ],\n ...\n}\n```\n\nThe\ - \ `include` parameter is accepted for all `GET` requests on all resources and\ - \ collections, and should be specified as a comma-separated list.\n\n```\n/user?include=emails,projects,memberships\n\ - ```\n\nYou may also include nested associations up to 3 levels deep using dot\ - \ notation:\n\n```\n/user?include=memberships.projects\n```\n" +- description: | + The Equinix Metal API uses a few methods to minimize network traffic and bandwidth: + + `include` + + For resources that contain collections of other resources, the Equinix Metal API will return links to the other resources by default. + + ```json + { + ... + // Includes "href" links if the resource is reachable through the API. + "projects": [ + { "href": "/projects/5b590e4f-be96-4400-ae32-c315ee67964d" }, + { "href": "/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd" } + ], + // Includes "id" attributes if not. + "emails": [ + { "id": "eb5d8c89-4d15-4c87-859c-5ae190ad5d9a" }, + { "id": "c17f77ad-9070-4084-abaa-7538581d9523" } + ] + ... + } + ``` + + However, if you're interested in acting on resources in the projects collection, it doesn't make sense to make a separate API call to retrieve each project. Instead, you can specify which collections you'd like to be included using the include parameter. + + ``` + /user?include=projects + ``` + will return + + ```json + { + ... + "projects": [ + { + "href": "/projects/c851d3c5-d55d-4b1a-99f1-96fc64768bc3", + "id": "c851d3c5-d55d-4b1a-99f1-96fc64768bc3", + "name": "Project 1", + ... + }, + { + "href": "/projects/21f8e88b-bd4e-44ca-b956-4f3f88e6e5f2", + "id": "21f8e88b-bd4e-44ca-b956-4f3f88e6e5f2", + "name": "Project 2", + ... + } + ], + ... + } + ``` + + The `include` parameter is accepted for all `GET` requests on all resources and collections, and should be specified as a comma-separated list. + + ``` + /user?include=emails,projects,memberships + ``` + + You may also include nested associations up to 3 levels deep using dot notation: + + ``` + /user?include=memberships.projects + ``` name: Common Parameters -- description: "Equinix Metal uses conventional HTTP response codes to indicate the\ - \ success or failure of an API request.\n\nIn general: Codes in the 2xx range\ - \ indicate success. Codes in the 4xx range indicate an error that failed given\ - \ the information provided (e.g., a required parameter was omitted, a charge failed,\ - \ etc.). Codes in the 5xx range indicate an error with Equinix Metal's servers\ - \ (these are rare).\n\n| Code | Summary\n| ----------------------------------\ - \ | ------------------------------------------------------\n| 200 OK \ - \ | Everything worked as expected.\n| 201 Create \ - \ | Everything worked as expected, the resource was created.\n|\ - \ 422 Bad Request | The request was unacceptable, often due\ - \ to missing a required parameter.\n| 401 Unauthorized | No\ - \ valid API key provided.\n| 404 Not Found | The requested\ - \ resource doesn't exist.\n| 500, 502, 503, 504 - Server Errors | Something went\ - \ wrong on Equinix Metal's end. (These are rare.)\n\nErrors (4xx, 5xx) reported\ - \ by the API will include a JSON error response. This response will be structured\ - \ as one of the following:\n\n```json\n{\"error\": \"the error message\"}\n```\n\ - \nor\n\n```json\n{\"errors\": [\"one error\", \"another error\"}\n```\n\nThe JSON\ - \ response is not guaranteed so check the HTTP status message. JSON may not be\ - \ included if the error is reported by an API intermediary, like a loadbalancer\ - \ service.\n" +- description: | + Equinix Metal uses conventional HTTP response codes to indicate the success or failure of an API request. + + In general: Codes in the 2xx range indicate success. Codes in the 4xx range indicate an error that failed given the information provided (e.g., a required parameter was omitted, a charge failed, etc.). Codes in the 5xx range indicate an error with Equinix Metal's servers (these are rare). + + | Code | Summary + | ---------------------------------- | ------------------------------------------------------ + | 200 OK | Everything worked as expected. + | 201 Create | Everything worked as expected, the resource was created. + | 422 Bad Request | The request was unacceptable, often due to missing a required parameter. + | 401 Unauthorized | No valid API key provided. + | 404 Not Found | The requested resource doesn't exist. + | 500, 502, 503, 504 - Server Errors | Something went wrong on Equinix Metal's end. (These are rare.) + + Errors (4xx, 5xx) reported by the API will include a JSON error response. This response will be structured as one of the following: + + ```json + {"error": "the error message"} + ``` + + or + + ```json + {"errors": ["one error", "another error"} + ``` + + The JSON response is not guaranteed so check the HTTP status message. JSON may not be included if the error is reported by an API intermediary, like a loadbalancer service. name: Errors -- description: "Manage device batches. See project endpoints to list batches for a\ - \ particular project. Check out the product docs to learn more about [Batch Deployment](https://metal.equinix.com/developers/docs/deploy/batch-deployment/).\n" +- description: | + Manage device batches. See project endpoints to list batches for a particular project. Check out the product docs to learn more about [Batch Deployment](https://metal.equinix.com/developers/docs/deploy/batch-deployment/). externalDocs: url: https://metal.equinix.com/developers/docs/deploy/batch-deployment/ name: Batches -- description: "Manage BGP configs and sessions. See device endpoints to create and\ - \ list BGP sessions for a particular device. Check out the product docs to learn\ - \ more about [Local and Global BGP](https://metal.equinix.com/developers/docs/networking/local-global-bgp/).\n" +- description: | + Manage BGP configs and sessions. See device endpoints to create and list BGP sessions for a particular device. Check out the product docs to learn more about [Local and Global BGP](https://metal.equinix.com/developers/docs/networking/local-global-bgp/). externalDocs: url: https://metal.equinix.com/developers/docs/bgp/bgp-on-equinix-metal/ name: BGP -- description: "Capacity Management. Check out the product docs to learn more about\ - \ [Capacity](https://metal.equinix.com/developers/docs/locations/capacity/).\n" +- description: | + Capacity Management. Check out the product docs to learn more about [Capacity](https://metal.equinix.com/developers/docs/locations/capacity/). externalDocs: url: https://metal.equinix.com/developers/docs/locations/capacity/ name: Capacity -- description: "Network Interconnections. See Instructions to create Network Interconnections\ - \ at Check out the product docs to learn more about [Equinix Fabric](https://metal.equinix.com/developers/docs/networking/fabric/).\n" +- description: | + Network Interconnections. See Instructions to create Network Interconnections at Check out the product docs to learn more about [Equinix Fabric](https://metal.equinix.com/developers/docs/networking/fabric/). externalDocs: url: https://metal.equinix.com/developers/docs/equinix-interconnect/introduction/ name: Connections -- description: "Device Management. Check out the product docs to learn more about\ - \ [Server Devices](https://metal.equinix.com/developers/docs/servers/).\n" +- description: | + Device Management. Check out the product docs to learn more about [Server Devices](https://metal.equinix.com/developers/docs/servers/). externalDocs: url: https://metal.equinix.com/developers/docs/deploy/on-demand/ name: Devices @@ -102,16 +155,16 @@ tags: name: Emails - description: Event Management name: Events -- description: "Facility Management. Check out the product docs to learn more about\ - \ [Facilities](https://metal.equinix.com/developers/docs/locations/).\n" +- description: | + Facility Management. Check out the product docs to learn more about [Facilities](https://metal.equinix.com/developers/docs/locations/). name: Facilities - description: | Global BGP Range Management externalDocs: url: https://metal.equinix.com/developers/docs/bgp/global-bgp/ name: GlobalBgpRanges -- description: "Hardware Reservation Management. Check out the product docs to learn\ - \ more about [Reserved Hardware](https://metal.equinix.com/developers/docs/deploy/reserved/).\n" +- description: | + Hardware Reservation Management. Check out the product docs to learn more about [Reserved Hardware](https://metal.equinix.com/developers/docs/deploy/reserved/). externalDocs: url: https://metal.equinix.com/developers/docs/deploy/reserved/ name: HardwareReservations @@ -120,12 +173,11 @@ tags: externalDocs: url: https://metal.equinix.com/developers/docs/locations/maintenance/ name: Incidents -- description: "Manage invitations. See project endpoints to create a new invitation.\ - \ Check out the product docs to learn more about [Invitations](https://metal.equinix.com/developers/docs/accounts/).\n" +- description: | + Manage invitations. See project endpoints to create a new invitation. Check out the product docs to learn more about [Invitations](https://metal.equinix.com/developers/docs/accounts/). name: Invitations -- description: "Manage IP addresses. See device and project endpoints to list and\ - \ create IP assignments for a particular project or device. Check out the product\ - \ docs to learn more about [the basic networking features](https://metal.equinix.com/developers/docs/networking/standard-ips/).\n" +- description: | + Manage IP addresses. See device and project endpoints to list and create IP assignments for a particular project or device. Check out the product docs to learn more about [the basic networking features](https://metal.equinix.com/developers/docs/networking/standard-ips/). externalDocs: url: https://metal.equinix.com/developers/docs/networking/ name: IPAddresses @@ -134,13 +186,13 @@ tags: externalDocs: url: https://metal.equinix.com/developers/docs/operating-systems/licensed/ name: Licenses -- description: "Membership Management (Project). Check out the product docs to learn\ - \ more about [Membership](https://metal.equinix.com/developers/docs/accounts/).\n" +- description: | + Membership Management (Project). Check out the product docs to learn more about [Membership](https://metal.equinix.com/developers/docs/accounts/). externalDocs: url: https://metal.equinix.com/developers/docs/accounts/projects/#inviting-a-user-to-a-project name: Memberships -- description: "Metal Gateway Management.Check out the product docs to learn more\ - \ about [Metal Gateways](https://metal.equinix.com/developers/docs/networking/metal-gateway/).\n" +- description: | + Metal Gateway Management.Check out the product docs to learn more about [Metal Gateways](https://metal.equinix.com/developers/docs/networking/metal-gateway/). externalDocs: url: https://metal.equinix.com/developers/docs/networking/metal-gateway/ name: MetalGateways @@ -148,15 +200,16 @@ tags: externalDocs: url: https://metal.equinix.com/developers/docs/locations/metros/ name: Metros -- description: "Operating System Management. Check out the product docs to learn more\ - \ about [Operating Systems choices](https://metal.equinix.com/developers/docs/operating-systems/).\n" +- description: | + Operating System Management. Check out the product docs to learn more about [Operating Systems choices](https://metal.equinix.com/developers/docs/operating-systems/). externalDocs: url: https://metal.equinix.com/developers/docs/operating-systems/supported/ name: OperatingSystems - description: "Organizations Management. Check out the product docs to learn more\ \ about [Organizations](https://metal.equinix.com/developers/docs/accounts/)." name: Organizations -- description: "OTP Management. Check out the product docs to learn more about [OTP](https://metal.equinix.com/developers/docs/accounts/two-factor-authentication/).\n" +- description: | + OTP Management. Check out the product docs to learn more about [OTP](https://metal.equinix.com/developers/docs/accounts/two-factor-authentication/). externalDocs: url: https://metal.equinix.com/developers/docs/accounts/two-factor-authentication/ name: Otps @@ -170,16 +223,16 @@ tags: externalDocs: url: https://metal.equinix.com/developers/docs/billing/payment-methods/ name: PaymentMethods -- description: "Plan Management (Device). Check out the product docs to learn more\ - \ about [Device Plans](https://metal.equinix.com/developers/docs/servers/).\n" +- description: | + Plan Management (Device). Check out the product docs to learn more about [Device Plans](https://metal.equinix.com/developers/docs/servers/). name: Plans -- description: "Port ManagementCheck out the product docs to learn more about [Port\ - \ configurations](https://metal.equinix.com/developers/docs/layer2-networking/overview/).\n" +- description: | + Port ManagementCheck out the product docs to learn more about [Port configurations](https://metal.equinix.com/developers/docs/layer2-networking/overview/). externalDocs: url: https://metal.equinix.com/developers/docs/layer2-networking/overview/ name: Ports -- description: "Project Management. Check out the product docs to learn more about\ - \ [Projects](https://metal.equinix.com/developers/docs/accounts/projects/).\n" +- description: | + Project Management. Check out the product docs to learn more about [Projects](https://metal.equinix.com/developers/docs/accounts/projects/). externalDocs: url: https://metal.equinix.com/developers/docs/accounts/projects/ name: Projects @@ -188,8 +241,8 @@ tags: externalDocs: url: https://metal.equinix.com/developers/docs/deploy/reserved/ name: SelfServiceReservations -- description: "Spot Market Pricing and Requests Management. Check out the product\ - \ docs to learn more about [Spot Market features](https://metal.equinix.com/developers/docs/deploy/spot-market/).\n" +- description: | + Spot Market Pricing and Requests Management. Check out the product docs to learn more about [Spot Market features](https://metal.equinix.com/developers/docs/deploy/spot-market/). externalDocs: url: https://metal.equinix.com/developers/docs/deploy/spot-market/ name: SpotMarket @@ -208,8 +261,8 @@ tags: externalDocs: url: https://metal.equinix.com/developers/docs/accounts/projects/#transferring-a-project name: TransferRequests -- description: "Two Factor Authentication Management. Check out the product docs to\ - \ learn more about [2FA](https://metal.equinix.com/developers/docs/accounts/two-factor-authentication/).\n" +- description: | + Two Factor Authentication Management. Check out the product docs to learn more about [2FA](https://metal.equinix.com/developers/docs/accounts/two-factor-authentication/). externalDocs: url: https://metal.equinix.com/developers/docs/accounts/two-factor-authentication/ name: TwoFactorAuth @@ -232,24 +285,18 @@ tags: externalDocs: url: https://metal.equinix.com/developers/docs/accounts/organizations/#managing-team-members name: UserVerificationTokens -- description: "Manage virtual networks (VLANs). See project endpoints to list and\ - \ create virtual networks. Check out the product docs to learn more about [VLANs](https://metal.equinix.com/developers/docs/networking/layer2/).\n" +- description: | + Manage virtual networks (VLANs). See project endpoints to list and create virtual networks. Check out the product docs to learn more about [VLANs](https://metal.equinix.com/developers/docs/networking/layer2/). externalDocs: url: https://metal.equinix.com/developers/docs/networking/layer2/ name: VLANs -- description: "Volume Management (Block Storage). Notice: Block storage support will\ - \ be deprecated soon. Please check here: https://metal.equinix.com/developers/docs/resilience-recovery/elastic-block-storage/\ - \ for more details.\n" +- description: | + Volume Management (Block Storage). Notice: Block storage support will be deprecated soon. Please check here: https://metal.equinix.com/developers/docs/resilience-recovery/elastic-block-storage/ for more details. externalDocs: url: https://metal.equinix.com/developers/docs/resilience-recovery/elastic-block-storage/ name: Volumes -- description: "VRF Management. A VRF is a project-scoped virtual router resource\ - \ that defines a collection of customer-manager IP blocks that can be used in\ - \ BGP peering on one or more virtual networks. Metal Gateways and Interconnection\ - \ Virtual Circuits can take advantage of VRFs to enable Layer 3 routing with bespoke\ - \ network ranges. Notice: VRFs are a test feature currently under active development,\ - \ and only available to certain users. Please contact Customer Success for more\ - \ information.\n" +- description: | + VRF Management. A VRF is a project-scoped virtual router resource that defines a collection of customer-manager IP blocks that can be used in BGP peering on one or more virtual networks. Metal Gateways and Interconnection Virtual Circuits can take advantage of VRFs to enable Layer 3 routing with bespoke network ranges. Notice: VRFs are a test feature currently under active development, and only available to certain users. Please contact Customer Success for more information. name: VRFs paths: /api-keys/{id}: @@ -1212,9 +1259,9 @@ paths: - Devices x-accepts: application/json get: - description: "Type-specific options (such as facility for baremetal devices)\ - \ will be included as part of the main data structure.\n \ - \ State value can be one of: active inactive queued or provisioning" + description: |- + Type-specific options (such as facility for baremetal devices) will be included as part of the main data structure. + State value can be one of: active inactive queued or provisioning operationId: findDeviceById parameters: - description: Device UUID @@ -3501,9 +3548,10 @@ paths: x-accepts: application/json /market/spot/prices/history: get: - description: "Get spot market prices for a given plan and facility in a fixed\ - \ period of time\n\n*Note: In the `200` response, the property `datapoints`\ - \ contains arrays of `[float, integer]`.*" + description: |- + Get spot market prices for a given plan and facility in a fixed period of time + + *Note: In the `200` response, the property `datapoints` contains arrays of `[float, integer]`.* operationId: findSpotMarketPricesHistory parameters: - description: Facility to check spot market prices @@ -4712,9 +4760,9 @@ paths: - Organizations x-accepts: application/json post: - description: "In order to add a user to an organization, they must first be\ - \ invited.\nTo invite to several projects the parameter `projects_ids:[a,b,c]`\ - \ can be used" + description: |- + In order to add a user to an organization, they must first be invited. + To invite to several projects the parameter `projects_ids:[a,b,c]` can be used operationId: createOrganizationInvitation parameters: - description: Organization UUID @@ -7115,10 +7163,10 @@ paths: - Devices x-accepts: application/json post: - description: "Creates a new device and provisions it in the specified location.\n\ - \nDevice type-specific options are accepted. For example, `baremetal` devices\ - \ accept `operating_system`, `hostname`, and `plan`. These parameters may\ - \ not be accepted for other device types. The default device type is `baremetal`." + description: |- + Creates a new device and provisions it in the specified location. + + Device type-specific options are accepted. For example, `baremetal` devices accept `operating_system`, `hostname`, and `plan`. These parameters may not be accepted for other device types. The default device type is `baremetal`. operationId: createDevice parameters: - description: Project UUID @@ -7175,48 +7223,44 @@ paths: x-accepts: application/json /projects/{id}/devices/batch: post: - description: "Creates new devices in batch and provisions them in our datacenter.\n\ - \nType-specific options (such as operating_system for baremetal devices) should\ - \ be included in the main data structure alongside hostname and plan.\n\n\ - The features attribute allows you to optionally specify what features your\ - \ server should have.\n\nFor example, if you require a server with a TPM chip,\ - \ you may specify `{ \"features\": { \"tpm\": \"required\" } }` (or `{ \"\ - features\": [\"tpm\"] }` in shorthand).\n\nThe request will fail if there\ - \ are no available servers matching your criteria. Alternatively, if you do\ - \ not require a certain feature, but would prefer to be assigned a server\ - \ with that feature if there are any available, you may specify that feature\ - \ with a preferred value (see the example request below).\n\nThe request will\ - \ not fail if we have no servers with that feature in our inventory.\n\nThe\ - \ facilities attribute specifies in what datacenter you wish to create the\ - \ device.\n\nYou can either specify a single facility `{ \"facility\": \"\ - f1\" }` , or you can instruct to create the device in the best available datacenter\ - \ `{ \"facility\": \"any\" }`. Additionally it is possible to set a prioritized\ - \ location selection.\n\nFor example `{ \"facility\": [\"f3\", \"f2\", \"\ - any\"] }` will try to assign to the facility f3, if there are no available\ - \ f2, and so on. If \"any\" is not specified for \"facility\", the request\ - \ will fail unless it can assign in the selected locations.\n\nWith `{ \"\ - facility\": \"any\" }` you have the option to diversify to indicate how many\ - \ facilities you are willing to be spread across. For this purpose use parameter:\ - \ `facility_diversity_level = N`.\n\nFor example:\n\n`{ \"facilities\": [\"\ - sjc1\", \"ewr1\", \"any\"] , \"facility_diversity_level\" = 1, \"quantity\"\ - \ = 10 }` will assign 10 devices into the same facility, trying first in \"\ - sjc1\", and if there aren’t available, it will try in \"ewr1\", otherwise\ - \ any other.\n\nThe `ip_addresses` attribute will allow you to specify the\ - \ addresses you want created with your device.\n\nTo maintain backwards compatibility,\ - \ If the attribute is not sent in the request, it will be treated as if `{\ - \ \"ip_addresses\": [{ \"address_family\": 4, \"public\": true }, { \"address_family\"\ - : 4, \"public\": false }, { \"address_family\": 6, \"public\": true }] }`\ - \ was sent.\n\nThe private IPv4 address is required and always need to be\ - \ sent in the array. Not all operating systems support no public IPv4 address,\ - \ so in those cases you will receive an error message.\n\nFor example, to\ - \ only configure your server with a private IPv4 address, you can send `{\ - \ \"ip_addresses\": [{ \"address_family\": 4, \"public\": false }] }`.\n\n\ - Note: when specifying a subnet size larger than a /30, you will need to supply\ - \ the UUID(s) of existing ip_reservations in your project to assign IPs from.\n\ - \nFor example, `{ \"ip_addresses\": [..., {\"address_family\": 4, \"public\"\ - : true, \"ip_reservations\": [\"uuid1\", \"uuid2\"]}] }`\n\nTo access a server\ - \ without public IPs, you can use our Out-of-Band console access (SOS) or\ - \ use another server with public IPs as a proxy." + description: |- + Creates new devices in batch and provisions them in our datacenter. + + Type-specific options (such as operating_system for baremetal devices) should be included in the main data structure alongside hostname and plan. + + The features attribute allows you to optionally specify what features your server should have. + + For example, if you require a server with a TPM chip, you may specify `{ "features": { "tpm": "required" } }` (or `{ "features": ["tpm"] }` in shorthand). + + The request will fail if there are no available servers matching your criteria. Alternatively, if you do not require a certain feature, but would prefer to be assigned a server with that feature if there are any available, you may specify that feature with a preferred value (see the example request below). + + The request will not fail if we have no servers with that feature in our inventory. + + The facilities attribute specifies in what datacenter you wish to create the device. + + You can either specify a single facility `{ "facility": "f1" }` , or you can instruct to create the device in the best available datacenter `{ "facility": "any" }`. Additionally it is possible to set a prioritized location selection. + + For example `{ "facility": ["f3", "f2", "any"] }` will try to assign to the facility f3, if there are no available f2, and so on. If "any" is not specified for "facility", the request will fail unless it can assign in the selected locations. + + With `{ "facility": "any" }` you have the option to diversify to indicate how many facilities you are willing to be spread across. For this purpose use parameter: `facility_diversity_level = N`. + + For example: + + `{ "facilities": ["sjc1", "ewr1", "any"] , "facility_diversity_level" = 1, "quantity" = 10 }` will assign 10 devices into the same facility, trying first in "sjc1", and if there aren’t available, it will try in "ewr1", otherwise any other. + + The `ip_addresses` attribute will allow you to specify the addresses you want created with your device. + + To maintain backwards compatibility, If the attribute is not sent in the request, it will be treated as if `{ "ip_addresses": [{ "address_family": 4, "public": true }, { "address_family": 4, "public": false }, { "address_family": 6, "public": true }] }` was sent. + + The private IPv4 address is required and always need to be sent in the array. Not all operating systems support no public IPv4 address, so in those cases you will receive an error message. + + For example, to only configure your server with a private IPv4 address, you can send `{ "ip_addresses": [{ "address_family": 4, "public": false }] }`. + + Note: when specifying a subnet size larger than a /30, you will need to supply the UUID(s) of existing ip_reservations in your project to assign IPs from. + + For example, `{ "ip_addresses": [..., {"address_family": 4, "public": true, "ip_reservations": ["uuid1", "uuid2"]}] }` + + To access a server without public IPs, you can use our Out-of-Band console access (SOS) or use another server with public IPs as a proxy. operationId: createDeviceBatch parameters: - description: Project UUID @@ -7972,18 +8016,16 @@ paths: - SpotMarket x-accepts: application/json post: - description: "Creates a new spot market request.\n\nType-specific options (such\ - \ as operating_system for baremetal devices) should be included in the main\ - \ data structure alongside hostname and plan.\n\nThe features attribute allows\ - \ you to optionally specify what features your server should have. For example,\ - \ if you require a server with a TPM chip, you may specify `{ \"features\"\ - : { \"tpm\": \"required\" } }` (or `{ \"features\": [\"tpm\"] }` in shorthand).\n\ - \nThe request will fail if there are no available servers matching your criteria.\ - \ Alternatively, if you do not require a certain feature, but would prefer\ - \ to be assigned a server with that feature if there are any available, you\ - \ may specify that feature with a preferred value (see the example request\ - \ below).\n\nThe request will not fail if we have no servers with that feature\ - \ in our inventory." + description: |- + Creates a new spot market request. + + Type-specific options (such as operating_system for baremetal devices) should be included in the main data structure alongside hostname and plan. + + The features attribute allows you to optionally specify what features your server should have. For example, if you require a server with a TPM chip, you may specify `{ "features": { "tpm": "required" } }` (or `{ "features": ["tpm"] }` in shorthand). + + The request will fail if there are no available servers matching your criteria. Alternatively, if you do not require a certain feature, but would prefer to be assigned a server with that feature if there are any available, you may specify that feature with a preferred value (see the example request below). + + The request will not fail if we have no servers with that feature in our inventory. operationId: createSpotMarketRequest parameters: - description: Project UUID @@ -8482,7 +8524,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/createVrf_request' + $ref: '#/components/schemas/VrfCreateInput' description: VRF to create required: true responses: @@ -11384,11 +11426,8 @@ components: format: date-time type: string deployment_type: - description: "In a Local BGP deployment, a customer uses an internal ASN\ - \ to control routes within a single Equinix Metal datacenter. This means\ - \ that the routes are never advertised to the global Internet. Global\ - \ BGP, on the other hand, requires a customer to have a registered ASN\ - \ and IP space.\n" + description: | + In a Local BGP deployment, a customer uses an internal ASN to control routes within a single Equinix Metal datacenter. This means that the routes are never advertised to the global Internet. Global BGP, on the other hand, requires a customer to have a registered ASN and IP space. enum: - global - local @@ -12392,9 +12431,10 @@ components: description: Whether or not the device is a spot instance. type: boolean spot_price_max: - description: "The maximum price per hour you are willing to pay to keep\ - \ this spot\ninstance. If you are outbid, the termination will be set\ - \ allowing two\nminutes before shutdown." + description: |- + The maximum price per hour you are willing to pay to keep this spot + instance. If you are outbid, the termination will be set allowing two + minutes before shutdown. format: float type: number ssh_keys: @@ -12410,21 +12450,23 @@ components: - reinstalling type: string switch_uuid: - description: "Switch short id. This can be used to determine if two devices\ - \ are\nconnected to the same switch, for example." + description: |- + Switch short id. This can be used to determine if two devices are + connected to the same switch, for example. type: string tags: items: type: string type: array termination_time: - description: "When the device will be terminated. This is commonly set in\ - \ advance for\nephemeral spot market instances but this field may also\ - \ be set with\non-demand and reservation instances to automatically delete\ - \ the resource\nat a given time. The termination time can also be used\ - \ to release a\nhardware reservation instance at a given time, keeping\ - \ the reservation\nopen for other uses. On a spot market device, the\ - \ termination time will\nbe set automatically when outbid." + description: |- + When the device will be terminated. This is commonly set in advance for + ephemeral spot market instances but this field may also be set with + on-demand and reservation instances to automatically delete the resource + at a given time. The termination time can also be used to release a + hardware reservation instance at a given time, keeping the reservation + open for other uses. On a spot market device, the termination time will + be set automatically when outbid. format: date-time type: string updated_at: @@ -12494,9 +12536,10 @@ components: properties: always_pxe: default: false - description: "When true, devices with a `custom_ipxe` OS will always boot\ - \ to iPXE. The\ndefault setting of false ensures that iPXE will be used\ - \ on only the\nfirst boot." + description: |- + When true, devices with a `custom_ipxe` OS will always boot to iPXE. The + default setting of false ensures that iPXE will be used on only the + first boot. type: boolean billing_cycle: description: The billing cycle of the device. @@ -12516,42 +12559,45 @@ components: to inform other API consumers with project access. type: string facility: - description: "The datacenter where the device should be created.\n\nEither\ - \ metro or facility must be provided.\n\nThe API will accept either a\ - \ single facility `{ \"facility\": \"f1\" }`, or it can be instructed\ - \ to create the device in the best available datacenter `{ \"facility\"\ - : \"any\" }`.\n\nAdditionally it is possible to set a prioritized location\ - \ selection. For example `{ \"facility\": [\"f3\", \"f2\", \"any\"] }`\ - \ can be used to prioritize `f3` and then `f2` before accepting `any`\ - \ facility. If none of the facilities provided have availability for the\ - \ requested device the request will fail." + description: |- + The datacenter where the device should be created. + + Either metro or facility must be provided. + + The API will accept either a single facility `{ "facility": "f1" }`, or it can be instructed to create the device in the best available datacenter `{ "facility": "any" }`. + + Additionally it is possible to set a prioritized location selection. For example `{ "facility": ["f3", "f2", "any"] }` can be used to prioritize `f3` and then `f2` before accepting `any` facility. If none of the facilities provided have availability for the requested device the request will fail. example: - sv15 items: type: string type: array features: - description: "The features attribute allows you to optionally specify what\ - \ features your server should have.\n\nIn the API shorthand syntax, all\ - \ features listed are `required`:\n\n```\n{ \"features\": [\"tpm\"] }\n\ - ```\n\nAlternatively, if you do not require a certain feature, but would\ - \ prefer to be assigned a server with that feature if there are any available,\ - \ you may specify that feature with a `preferred` value. The request will\ - \ not fail if we have no servers with that feature in our inventory. The\ - \ API offers an alternative syntax for mixing preferred and required features:\n\ - \n```\n{ \"features\": { \"tpm\": \"required\", \"raid\": \"preferred\"\ - \ } }\n```\n\nThe request will only fail if there are no available servers\ - \ matching the required `tpm` criteria." + description: |- + The features attribute allows you to optionally specify what features your server should have. + + In the API shorthand syntax, all features listed are `required`: + + ``` + { "features": ["tpm"] } + ``` + + Alternatively, if you do not require a certain feature, but would prefer to be assigned a server with that feature if there are any available, you may specify that feature with a `preferred` value. The request will not fail if we have no servers with that feature in our inventory. The API offers an alternative syntax for mixing preferred and required features: + + ``` + { "features": { "tpm": "required", "raid": "preferred" } } + ``` + + The request will only fail if there are no available servers matching the required `tpm` criteria. items: type: string type: array hardware_reservation_id: default: "" - description: "The Hardware Reservation UUID to provision. Alternatively,\ - \ `next-available` can be specified to select from any of the available\ - \ hardware reservations. An error will be returned if the requested reservation\ - \ option is not available.\n\nSee [Reserved Hardware](https://metal.equinix.com/developers/docs/deploy/reserved/)\ - \ for more details." + description: |- + The Hardware Reservation UUID to provision. Alternatively, `next-available` can be specified to select from any of the available hardware reservations. An error will be returned if the requested reservation option is not available. + + See [Reserved Hardware](https://metal.equinix.com/developers/docs/deploy/reserved/) for more details. example: next-available type: string hostname: @@ -12566,28 +12612,30 @@ components: public: false - address_family: 6 public: true - description: "The `ip_addresses attribute will allow you to specify the\ - \ addresses you want created with your device.\n\nThe default value configures\ - \ public IPv4, public IPv6, and private IPv4.\n\nPrivate IPv4 address\ - \ is required. When specifying `ip_addresses`, one of the array items\ - \ must enable private IPv4.\n\nSome operating systems require public IPv4\ - \ address. In those cases you will receive an error message if public\ - \ IPv4 is not enabled.\n\nFor example, to only configure your server with\ - \ a private IPv4 address, you can send `{ \"ip_addresses\": [{ \"address_family\"\ - : 4, \"public\": false }] }`.\n\nIt is possible to request a subnet size\ - \ larger than a `/30` by assigning addresses using the UUID(s) of ip_reservations\ - \ in your project.\n\nFor example, `{ \"ip_addresses\": [..., {\"address_family\"\ - : 4, \"public\": true, \"ip_reservations\": [\"uuid1\", \"uuid2\"]}] }`\n\ - \nTo access a server without public IPs, you can use our Out-of-Band console\ - \ access (SOS) or proxy through another server in the project with public\ - \ IPs enabled." + description: |- + The `ip_addresses attribute will allow you to specify the addresses you want created with your device. + + The default value configures public IPv4, public IPv6, and private IPv4. + + Private IPv4 address is required. When specifying `ip_addresses`, one of the array items must enable private IPv4. + + Some operating systems require public IPv4 address. In those cases you will receive an error message if public IPv4 is not enabled. + + For example, to only configure your server with a private IPv4 address, you can send `{ "ip_addresses": [{ "address_family": 4, "public": false }] }`. + + It is possible to request a subnet size larger than a `/30` by assigning addresses using the UUID(s) of ip_reservations in your project. + + For example, `{ "ip_addresses": [..., {"address_family": 4, "public": true, "ip_reservations": ["uuid1", "uuid2"]}] }` + + To access a server without public IPs, you can use our Out-of-Band console access (SOS) or proxy through another server in the project with public IPs enabled. items: $ref: '#/components/schemas/DeviceCreateInput_ip_addresses_inner' type: array ipxe_script_url: - description: "When set, the device will chainload an iPXE Script at boot\ - \ fetched from the supplied URL.\n\nSee [Custom iPXE](https://metal.equinix.com/developers/docs/operating-systems/custom-ipxe/)\ - \ for more details." + description: |- + When set, the device will chainload an iPXE Script at boot fetched from the supplied URL. + + See [Custom iPXE](https://metal.equinix.com/developers/docs/operating-systems/custom-ipxe/) for more details. externalDocs: url: https://metal.equinix.com/developers/docs/operating-systems/custom-ipxe/ type: string @@ -12626,14 +12674,14 @@ components: type: number x-deprecated: true project_ssh_keys: - description: "A list of UUIDs identifying the device parent project\nthat\ - \ should be authorized to access this device (typically\nvia /root/.ssh/authorized_keys).\ - \ These keys will also appear in the device metadata.\n\nIf no SSH keys\ - \ are specified (`user_ssh_keys`, `project_ssh_keys`, and `ssh_keys` are\ - \ all empty lists or omitted),\nall parent project keys, parent project\ - \ members keys and organization members keys will be included. This behaviour\ - \ can\nbe changed with 'no_ssh_keys' option to omit any SSH key being\ - \ added.\n" + description: | + A list of UUIDs identifying the device parent project + that should be authorized to access this device (typically + via /root/.ssh/authorized_keys). These keys will also appear in the device metadata. + + If no SSH keys are specified (`user_ssh_keys`, `project_ssh_keys`, and `ssh_keys` are all empty lists or omitted), + all parent project keys, parent project members keys and organization members keys will be included. This behaviour can + be changed with 'no_ssh_keys' option to omit any SSH key being added. items: format: uuid type: string @@ -12671,26 +12719,26 @@ components: format: date-time type: string user_ssh_keys: - description: "A list of UUIDs identifying the users\nthat should be authorized\ - \ to access this device (typically\nvia /root/.ssh/authorized_keys). \ - \ These keys will also\nappear in the device metadata.\n\nThe users must\ - \ be members of the project or organization.\n\nIf no SSH keys are specified\ - \ (`user_ssh_keys`, `project_ssh_keys`, and `ssh_keys` are all empty lists\ - \ or omitted),\nall parent project keys, parent project members keys and\ - \ organization members keys will be included. This behaviour can\nbe changed\ - \ with 'no_ssh_keys' option to omit any SSH key being added.\n" + description: | + A list of UUIDs identifying the users + that should be authorized to access this device (typically + via /root/.ssh/authorized_keys). These keys will also + appear in the device metadata. + + The users must be members of the project or organization. + + If no SSH keys are specified (`user_ssh_keys`, `project_ssh_keys`, and `ssh_keys` are all empty lists or omitted), + all parent project keys, parent project members keys and organization members keys will be included. This behaviour can + be changed with 'no_ssh_keys' option to omit any SSH key being added. items: format: uuid type: string type: array userdata: - description: "The userdata presented in the metadata service for this device.\ - \ Userdata is fetched and interpreted by the operating system installed\ - \ on the device. Acceptable formats are determined by the operating system,\ - \ with the exception of a special iPXE enabling syntax which is handled\ - \ before the operating system starts.\n\nSee [Server User Data](https://metal.equinix.com/developers/docs/servers/user-data/)\ - \ and [Provisioning with Custom iPXE](https://metal.equinix.com/developers/docs/operating-systems/custom-ipxe/#provisioning-with-custom-ipxe)\ - \ for more details." + description: |- + The userdata presented in the metadata service for this device. Userdata is fetched and interpreted by the operating system installed on the device. Acceptable formats are determined by the operating system, with the exception of a special iPXE enabling syntax which is handled before the operating system starts. + + See [Server User Data](https://metal.equinix.com/developers/docs/servers/user-data/) and [Provisioning with Custom iPXE](https://metal.equinix.com/developers/docs/operating-systems/custom-ipxe/#provisioning-with-custom-ipxe) for more details. externalDocs: url: https://metal.equinix.com/developers/docs/servers/user-data/ type: string @@ -14818,7 +14866,7 @@ components: $ref: '#/components/schemas/IPReservation' type: array type: object - IPReservationRequestInput: + DefaultIPReservationCreateInput: properties: comments: type: string @@ -15008,12 +15056,10 @@ components: metro: $ref: '#/components/schemas/Interconnection_metro' mode: - description: "The mode of the connection (only relevant to dedicated connections).\ - \ Shared connections won't have this field. Can be either 'standard' or\ - \ 'tunnel'.\n The default mode of a dedicated connection is 'standard'.\ - \ The mode can only be changed when there are no associated virtual circuits\ - \ on the connection.\n In tunnel mode, an 802.1q tunnel is added to a\ - \ port to send/receive double tagged packets from server instances." + description: |- + The mode of the connection (only relevant to dedicated connections). Shared connections won't have this field. Can be either 'standard' or 'tunnel'. + The default mode of a dedicated connection is 'standard'. The mode can only be changed when there are no associated virtual circuits on the connection. + In tunnel mode, an 802.1q tunnel is added to a port to send/receive double tagged packets from server instances. enum: - standard - tunnel @@ -15072,12 +15118,10 @@ components: description: A Metro ID or code. type: string mode: - description: "The mode of the connection (only relevant to dedicated connections).\ - \ Shared connections won't have this field. Can be either 'standard' or\ - \ 'tunnel'.\n The default mode of a dedicated connection is 'standard'.\ - \ The mode can only be changed when there are no associated virtual circuits\ - \ on the connection.\n In tunnel mode, an 802.1q tunnel is added to a\ - \ port to send/receive double tagged packets from server instances." + description: |- + The mode of the connection (only relevant to dedicated connections). Shared connections won't have this field. Can be either 'standard' or 'tunnel'. + The default mode of a dedicated connection is 'standard'. The mode can only be changed when there are no associated virtual circuits on the connection. + In tunnel mode, an 802.1q tunnel is added to a port to send/receive double tagged packets from server instances. enum: - standard - tunnel @@ -15314,12 +15358,10 @@ components: description: type: string mode: - description: "The mode of the connection (only relevant to dedicated connections).\ - \ Shared connections won't have this field. Can be either 'standard' or\ - \ 'tunnel'.\n The default mode of a dedicated connection is 'standard'.\ - \ The mode can only be changed when there are no associated virtual circuits\ - \ on the connection.\n In tunnel mode, an 802.1q tunnel is added to a\ - \ port to send/receive double tagged packets from server instances." + description: |- + The mode of the connection (only relevant to dedicated connections). Shared connections won't have this field. Can be either 'standard' or 'tunnel'. + The default mode of a dedicated connection is 'standard'. The mode can only be changed when there are no associated virtual circuits on the connection. + In tunnel mode, an 802.1q tunnel is added to a port to send/receive double tagged packets from server instances. enum: - standard - tunnel @@ -15781,7 +15823,7 @@ components: vrf: $ref: '#/components/schemas/Vrf' type: object - MetalGatewayInput: + MetalGatewayCreateInput: properties: ip_reservation_id: description: The UUID of an IP reservation that belongs to the same project @@ -15790,12 +15832,9 @@ components: format: uuid type: string private_ipv4_subnet_size: - description: "The subnet size (8, 16, 32, 64, or 128) of the private IPv4\ - \ reservation that will be created for the metal gateway. This field is\ - \ required unless a project IP reservation was specified.\n Please\ - \ keep in mind that the number of private metal gateway ranges are limited\ - \ per project. If you would like to increase the limit per project, please\ - \ contact support for assistance." + description: |- + The subnet size (8, 16, 32, 64, or 128) of the private IPv4 reservation that will be created for the metal gateway. This field is required unless a project IP reservation was specified. + Please keep in mind that the number of private metal gateway ranges are limited per project. If you would like to increase the limit per project, please contact support for assistance. type: integer virtual_network_id: description: The UUID of a metro virtual network that belongs to the same @@ -17635,8 +17674,8 @@ components: vnid: "1001" properties: vnid: - description: "Virtual Network ID. May be the UUID of the Virtual Network\ - \ record, or the VLAN value itself.\n" + description: | + Virtual Network ID. May be the UUID of the Virtual Network record, or the VLAN value itself. example: "1001" type: string type: object @@ -18177,8 +18216,9 @@ components: key: key properties: instances_ids: - description: "List of instance UUIDs to associate SSH key with, when empty\ - \ array is sent all instances belonging\n to entity will be included" + description: |- + List of instance UUIDs to associate SSH key with, when empty array is sent all instances belonging + to entity will be included items: format: uuid type: string @@ -19753,7 +19793,6 @@ components: VirtualNetworkCreateInput: example: vxlan: 1099 - project_id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 metro: metro description: description facility: facility @@ -19768,9 +19807,6 @@ components: description: The UUID (or metro code) for the Metro in which to create this Virtual Network. type: string - project_id: - format: uuid - type: string vxlan: description: "VLAN ID between 2-3999. Must be unique for the project within\ \ the Metro in which this Virtual Network is being created. If no value\ @@ -19778,8 +19814,6 @@ components: \ be automatically selected." example: 1099 type: integer - required: - - project_id type: object VirtualNetworkList: example: @@ -19926,6 +19960,14 @@ components: type: string type: object VrfCreateInput: + example: + ip_ranges: + - ip_ranges + - ip_ranges + local_asn: 0 + metro: metro + name: name + description: description properties: description: type: string @@ -19947,13 +19989,9 @@ components: type: string name: type: string - project_id: - format: uuid - type: string required: - metro - name - - project_id VrfIPRangeCreateInput: description: "A list of CIDR network addresses. Like [\"10.0.0.0/16\", \"2001:d78::/56\"\ ]. IPv4 blocks must be between /8 and /29 in size. IPv6 blocks must be between\ @@ -20390,40 +20428,11 @@ components: - $ref: '#/components/schemas/IPReservation' requestIPReservation_request: oneOf: - - $ref: '#/components/schemas/IPReservationRequestInput' + - $ref: '#/components/schemas/DefaultIPReservationCreateInput' - $ref: '#/components/schemas/VrfIPReservationCreateInput' - createVrf_request: - properties: - description: - type: string - ip_ranges: - description: "A list of CIDR network addresses. Like [\"10.0.0.0/16\", \"\ - 2001:d78::/56\"]. IPv4 blocks must be between /8 and /29 in size. IPv6\ - \ blocks must be between /56 and /64. A VRF\\'s IP ranges must be defined\ - \ in order to create VRF IP Reservations, which can then be used for Metal\ - \ Gateways or Virtual Circuits." - items: - type: string - type: array - local_asn: - format: int32 - type: integer - metro: - description: The UUID (or metro code) for the Metro in which to create this - VRF. - type: string - name: - type: string - project_id: - format: uuid - type: string - required: - - metro - - name - - project_id createMetalGateway_request: oneOf: - - $ref: '#/components/schemas/MetalGatewayInput' + - $ref: '#/components/schemas/MetalGatewayCreateInput' - $ref: '#/components/schemas/VrfMetalGatewayCreateInput' updateVirtualCircuit_request: oneOf: @@ -20569,6 +20578,7 @@ components: $ref: '#/components/schemas/User' available: type: string + example: null InstancesBatchCreateInput_batches_inner_ip_addresses_inner: example: address_family: 4 @@ -20883,6 +20893,7 @@ components: $ref: '#/components/schemas/Vrf' created_by: $ref: '#/components/schemas/User' + example: null securitySchemes: x_auth_token: in: header diff --git a/equinix-openapi-metal/docs/CreateVrfRequest.md b/equinix-openapi-metal/docs/CreateVrfRequest.md deleted file mode 100644 index 561f73b15..000000000 --- a/equinix-openapi-metal/docs/CreateVrfRequest.md +++ /dev/null @@ -1,18 +0,0 @@ - - -# CreateVrfRequest - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**description** | **String** | | [optional] | -|**ipRanges** | **List<String>** | A list of CIDR network addresses. Like [\"10.0.0.0/16\", \"2001:d78::/56\"]. IPv4 blocks must be between /8 and /29 in size. IPv6 blocks must be between /56 and /64. A VRF\\'s IP ranges must be defined in order to create VRF IP Reservations, which can then be used for Metal Gateways or Virtual Circuits. | [optional] | -|**localAsn** | **Integer** | | [optional] | -|**metro** | **String** | The UUID (or metro code) for the Metro in which to create this VRF. | | -|**name** | **String** | | | -|**projectId** | **UUID** | | | - - - diff --git a/equinix-openapi-metal/docs/IPReservationRequestInput.md b/equinix-openapi-metal/docs/DefaultIPReservationCreateInput.md similarity index 94% rename from equinix-openapi-metal/docs/IPReservationRequestInput.md rename to equinix-openapi-metal/docs/DefaultIPReservationCreateInput.md index 35626f61a..e946294eb 100644 --- a/equinix-openapi-metal/docs/IPReservationRequestInput.md +++ b/equinix-openapi-metal/docs/DefaultIPReservationCreateInput.md @@ -1,6 +1,6 @@ -# IPReservationRequestInput +# DefaultIPReservationCreateInput ## Properties diff --git a/equinix-openapi-metal/docs/MetalGatewayInput.md b/equinix-openapi-metal/docs/MetalGatewayCreateInput.md similarity index 97% rename from equinix-openapi-metal/docs/MetalGatewayInput.md rename to equinix-openapi-metal/docs/MetalGatewayCreateInput.md index 965d133ab..18f5f24cd 100644 --- a/equinix-openapi-metal/docs/MetalGatewayInput.md +++ b/equinix-openapi-metal/docs/MetalGatewayCreateInput.md @@ -1,6 +1,6 @@ -# MetalGatewayInput +# MetalGatewayCreateInput ## Properties diff --git a/equinix-openapi-metal/docs/VirtualNetworkCreateInput.md b/equinix-openapi-metal/docs/VirtualNetworkCreateInput.md index 47e3201b8..7478ff63d 100644 --- a/equinix-openapi-metal/docs/VirtualNetworkCreateInput.md +++ b/equinix-openapi-metal/docs/VirtualNetworkCreateInput.md @@ -10,7 +10,6 @@ |**description** | **String** | | [optional] | |**facility** | **String** | The UUID (or facility code) for the Facility in which to create this Virtual network. | [optional] | |**metro** | **String** | The UUID (or metro code) for the Metro in which to create this Virtual Network. | [optional] | -|**projectId** | **UUID** | | | |**vxlan** | **Integer** | VLAN ID between 2-3999. Must be unique for the project within the Metro in which this Virtual Network is being created. If no value is specified, the next-available VLAN ID in the range 1000-1999 will be automatically selected. | [optional] | diff --git a/equinix-openapi-metal/docs/VrfCreateInput.md b/equinix-openapi-metal/docs/VrfCreateInput.md index 7cf53f54e..fead297b5 100644 --- a/equinix-openapi-metal/docs/VrfCreateInput.md +++ b/equinix-openapi-metal/docs/VrfCreateInput.md @@ -12,7 +12,6 @@ |**localAsn** | **Integer** | | [optional] | |**metro** | **String** | The UUID (or metro code) for the Metro in which to create this VRF. | | |**name** | **String** | | | -|**projectId** | **UUID** | | | diff --git a/equinix-openapi-metal/docs/VrfsApi.md b/equinix-openapi-metal/docs/VrfsApi.md index 93e1a697a..f858f389d 100644 --- a/equinix-openapi-metal/docs/VrfsApi.md +++ b/equinix-openapi-metal/docs/VrfsApi.md @@ -14,7 +14,7 @@ All URIs are relative to *https://api.equinix.com/metal/v1* # **createVrf** -> Vrf createVrf(id, createVrfRequest) +> Vrf createVrf(id, vrfCreateInput) Create a new VRF in the specified project @@ -43,9 +43,9 @@ public class Example { VrfsApi apiInstance = new VrfsApi(defaultClient); UUID id = UUID.randomUUID(); // UUID | Project UUID - CreateVrfRequest createVrfRequest = new CreateVrfRequest(); // CreateVrfRequest | VRF to create + VrfCreateInput vrfCreateInput = new VrfCreateInput(); // VrfCreateInput | VRF to create try { - Vrf result = apiInstance.createVrf(id, createVrfRequest); + Vrf result = apiInstance.createVrf(id, vrfCreateInput); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling VrfsApi#createVrf"); @@ -63,7 +63,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **id** | **UUID**| Project UUID | | -| **createVrfRequest** | [**CreateVrfRequest**](CreateVrfRequest.md)| VRF to create | | +| **vrfCreateInput** | [**VrfCreateInput**](VrfCreateInput.md)| VRF to create | | ### Return type diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/JSON.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/JSON.java index d5ce139a4..e767efbbf 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/JSON.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/JSON.java @@ -142,9 +142,9 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.CreateMetalGatewayRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.CreateSelfServiceReservationRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.CreateSelfServiceReservationRequestPeriod.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.CreateVrfRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.DefaultIPReservation.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.DefaultIPReservationAllOf.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.DefaultIPReservationCreateInput.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.Device.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.DeviceActionsInner.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.DeviceCreateInput.CustomTypeAdapterFactory()); @@ -180,7 +180,6 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.IPAvailabilitiesList.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.IPReservationList.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.IPReservationMetro.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.IPReservationRequestInput.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.InstancesBatchCreateInput.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.InstancesBatchCreateInputBatchesInner.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.InstancesBatchCreateInputBatchesInnerIpAddressesInner.CustomTypeAdapterFactory()); @@ -203,7 +202,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.MembershipList.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.Meta.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.MetalGateway.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.MetalGatewayInput.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.MetalGatewayCreateInput.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.MetalGatewayIpReservation.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.MetalGatewayList.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.MetalGatewayLite.CustomTypeAdapterFactory()); diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/api/VrfsApi.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/api/VrfsApi.java index a78ddf36b..37a34a641 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/api/VrfsApi.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/api/VrfsApi.java @@ -27,10 +27,10 @@ import java.io.IOException; -import com.equinix.openapi.metal.v1.model.CreateVrfRequest; import com.equinix.openapi.metal.v1.model.Error; import java.util.UUID; import com.equinix.openapi.metal.v1.model.Vrf; +import com.equinix.openapi.metal.v1.model.VrfCreateInput; import com.equinix.openapi.metal.v1.model.VrfIPReservationList; import com.equinix.openapi.metal.v1.model.VrfList; import com.equinix.openapi.metal.v1.model.VrfUpdateInput; @@ -82,7 +82,7 @@ public void setCustomBaseUrl(String customBaseUrl) { /** * Build call for createVrf * @param id Project UUID (required) - * @param createVrfRequest VRF to create (required) + * @param vrfCreateInput VRF to create (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -95,7 +95,7 @@ public void setCustomBaseUrl(String customBaseUrl) { 422 unprocessable entity - */ - public okhttp3.Call createVrfCall(UUID id, CreateVrfRequest createVrfRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createVrfCall(UUID id, VrfCreateInput vrfCreateInput, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -109,7 +109,7 @@ public okhttp3.Call createVrfCall(UUID id, CreateVrfRequest createVrfRequest, fi basePath = null; } - Object localVarPostBody = createVrfRequest; + Object localVarPostBody = vrfCreateInput; // create path and map variables String localVarPath = "/projects/{id}/vrfs" @@ -142,20 +142,20 @@ public okhttp3.Call createVrfCall(UUID id, CreateVrfRequest createVrfRequest, fi } @SuppressWarnings("rawtypes") - private okhttp3.Call createVrfValidateBeforeCall(UUID id, CreateVrfRequest createVrfRequest, final ApiCallback _callback) throws ApiException { + private okhttp3.Call createVrfValidateBeforeCall(UUID id, VrfCreateInput vrfCreateInput, final ApiCallback _callback) throws ApiException { // verify the required parameter 'id' is set if (id == null) { throw new ApiException("Missing the required parameter 'id' when calling createVrf(Async)"); } - // verify the required parameter 'createVrfRequest' is set - if (createVrfRequest == null) { - throw new ApiException("Missing the required parameter 'createVrfRequest' when calling createVrf(Async)"); + // verify the required parameter 'vrfCreateInput' is set + if (vrfCreateInput == null) { + throw new ApiException("Missing the required parameter 'vrfCreateInput' when calling createVrf(Async)"); } - okhttp3.Call localVarCall = createVrfCall(id, createVrfRequest, _callback); + okhttp3.Call localVarCall = createVrfCall(id, vrfCreateInput, _callback); return localVarCall; } @@ -164,7 +164,7 @@ private okhttp3.Call createVrfValidateBeforeCall(UUID id, CreateVrfRequest creat * Create a new VRF in the specified project * Creates a new VRF in the specified project * @param id Project UUID (required) - * @param createVrfRequest VRF to create (required) + * @param vrfCreateInput VRF to create (required) * @return Vrf * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -176,8 +176,8 @@ private okhttp3.Call createVrfValidateBeforeCall(UUID id, CreateVrfRequest creat 422 unprocessable entity - */ - public Vrf createVrf(UUID id, CreateVrfRequest createVrfRequest) throws ApiException { - ApiResponse localVarResp = createVrfWithHttpInfo(id, createVrfRequest); + public Vrf createVrf(UUID id, VrfCreateInput vrfCreateInput) throws ApiException { + ApiResponse localVarResp = createVrfWithHttpInfo(id, vrfCreateInput); return localVarResp.getData(); } @@ -185,7 +185,7 @@ public Vrf createVrf(UUID id, CreateVrfRequest createVrfRequest) throws ApiExcep * Create a new VRF in the specified project * Creates a new VRF in the specified project * @param id Project UUID (required) - * @param createVrfRequest VRF to create (required) + * @param vrfCreateInput VRF to create (required) * @return ApiResponse<Vrf> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -197,8 +197,8 @@ public Vrf createVrf(UUID id, CreateVrfRequest createVrfRequest) throws ApiExcep 422 unprocessable entity - */ - public ApiResponse createVrfWithHttpInfo(UUID id, CreateVrfRequest createVrfRequest) throws ApiException { - okhttp3.Call localVarCall = createVrfValidateBeforeCall(id, createVrfRequest, null); + public ApiResponse createVrfWithHttpInfo(UUID id, VrfCreateInput vrfCreateInput) throws ApiException { + okhttp3.Call localVarCall = createVrfValidateBeforeCall(id, vrfCreateInput, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -207,7 +207,7 @@ public ApiResponse createVrfWithHttpInfo(UUID id, CreateVrfRequest createVr * Create a new VRF in the specified project (asynchronously) * Creates a new VRF in the specified project * @param id Project UUID (required) - * @param createVrfRequest VRF to create (required) + * @param vrfCreateInput VRF to create (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -220,9 +220,9 @@ public ApiResponse createVrfWithHttpInfo(UUID id, CreateVrfRequest createVr 422 unprocessable entity - */ - public okhttp3.Call createVrfAsync(UUID id, CreateVrfRequest createVrfRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createVrfAsync(UUID id, VrfCreateInput vrfCreateInput, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = createVrfValidateBeforeCall(id, createVrfRequest, _callback); + okhttp3.Call localVarCall = createVrfValidateBeforeCall(id, vrfCreateInput, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/AuthTokenList.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/AuthTokenList.java index 9577406e1..384d55027 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/AuthTokenList.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/AuthTokenList.java @@ -192,17 +192,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { throw new IllegalArgumentException(String.format("The required field(s) %s in AuthTokenList is not found in the empty JSON string", AuthTokenList.openapiRequiredFields.toString())); } } - JsonArray jsonArrayapiKeys = jsonObj.getAsJsonArray("api_keys"); - if (jsonArrayapiKeys != null) { - // ensure the json data is an array - if (!jsonObj.get("api_keys").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `api_keys` to be an array in the JSON string but got `%s`", jsonObj.get("api_keys").toString())); + if (jsonObj.get("api_keys") != null && !jsonObj.get("api_keys").isJsonNull()) { + JsonArray jsonArrayapiKeys = jsonObj.getAsJsonArray("api_keys"); + if (jsonArrayapiKeys != null) { + // ensure the json data is an array + if (!jsonObj.get("api_keys").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `api_keys` to be an array in the JSON string but got `%s`", jsonObj.get("api_keys").toString())); + } + + // validate the optional field `api_keys` (array) + for (int i = 0; i < jsonArrayapiKeys.size(); i++) { + AuthToken.validateJsonObject(jsonArrayapiKeys.get(i).getAsJsonObject()); + }; } - - // validate the optional field `api_keys` (array) - for (int i = 0; i < jsonArrayapiKeys.size(); i++) { - AuthToken.validateJsonObject(jsonArrayapiKeys.get(i).getAsJsonObject()); - }; } } diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/AuthTokenProject.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/AuthTokenProject.java index b1b12c98c..d24a8ee20 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/AuthTokenProject.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/AuthTokenProject.java @@ -658,56 +658,64 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if (jsonObj.get("bgp_config") != null && !jsonObj.get("bgp_config").isJsonNull()) { Href.validateJsonObject(jsonObj.getAsJsonObject("bgp_config")); } - JsonArray jsonArraydevices = jsonObj.getAsJsonArray("devices"); - if (jsonArraydevices != null) { - // ensure the json data is an array - if (!jsonObj.get("devices").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `devices` to be an array in the JSON string but got `%s`", jsonObj.get("devices").toString())); + if (jsonObj.get("devices") != null && !jsonObj.get("devices").isJsonNull()) { + JsonArray jsonArraydevices = jsonObj.getAsJsonArray("devices"); + if (jsonArraydevices != null) { + // ensure the json data is an array + if (!jsonObj.get("devices").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `devices` to be an array in the JSON string but got `%s`", jsonObj.get("devices").toString())); + } + + // validate the optional field `devices` (array) + for (int i = 0; i < jsonArraydevices.size(); i++) { + Href.validateJsonObject(jsonArraydevices.get(i).getAsJsonObject()); + }; } - - // validate the optional field `devices` (array) - for (int i = 0; i < jsonArraydevices.size(); i++) { - Href.validateJsonObject(jsonArraydevices.get(i).getAsJsonObject()); - }; } if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) && !jsonObj.get("id").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } - JsonArray jsonArrayinvitations = jsonObj.getAsJsonArray("invitations"); - if (jsonArrayinvitations != null) { - // ensure the json data is an array - if (!jsonObj.get("invitations").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `invitations` to be an array in the JSON string but got `%s`", jsonObj.get("invitations").toString())); + if (jsonObj.get("invitations") != null && !jsonObj.get("invitations").isJsonNull()) { + JsonArray jsonArrayinvitations = jsonObj.getAsJsonArray("invitations"); + if (jsonArrayinvitations != null) { + // ensure the json data is an array + if (!jsonObj.get("invitations").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `invitations` to be an array in the JSON string but got `%s`", jsonObj.get("invitations").toString())); + } + + // validate the optional field `invitations` (array) + for (int i = 0; i < jsonArrayinvitations.size(); i++) { + Href.validateJsonObject(jsonArrayinvitations.get(i).getAsJsonObject()); + }; } - - // validate the optional field `invitations` (array) - for (int i = 0; i < jsonArrayinvitations.size(); i++) { - Href.validateJsonObject(jsonArrayinvitations.get(i).getAsJsonObject()); - }; } - JsonArray jsonArraymembers = jsonObj.getAsJsonArray("members"); - if (jsonArraymembers != null) { - // ensure the json data is an array - if (!jsonObj.get("members").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `members` to be an array in the JSON string but got `%s`", jsonObj.get("members").toString())); + if (jsonObj.get("members") != null && !jsonObj.get("members").isJsonNull()) { + JsonArray jsonArraymembers = jsonObj.getAsJsonArray("members"); + if (jsonArraymembers != null) { + // ensure the json data is an array + if (!jsonObj.get("members").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `members` to be an array in the JSON string but got `%s`", jsonObj.get("members").toString())); + } + + // validate the optional field `members` (array) + for (int i = 0; i < jsonArraymembers.size(); i++) { + Href.validateJsonObject(jsonArraymembers.get(i).getAsJsonObject()); + }; } - - // validate the optional field `members` (array) - for (int i = 0; i < jsonArraymembers.size(); i++) { - Href.validateJsonObject(jsonArraymembers.get(i).getAsJsonObject()); - }; } - JsonArray jsonArraymemberships = jsonObj.getAsJsonArray("memberships"); - if (jsonArraymemberships != null) { - // ensure the json data is an array - if (!jsonObj.get("memberships").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `memberships` to be an array in the JSON string but got `%s`", jsonObj.get("memberships").toString())); + if (jsonObj.get("memberships") != null && !jsonObj.get("memberships").isJsonNull()) { + JsonArray jsonArraymemberships = jsonObj.getAsJsonArray("memberships"); + if (jsonArraymemberships != null) { + // ensure the json data is an array + if (!jsonObj.get("memberships").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `memberships` to be an array in the JSON string but got `%s`", jsonObj.get("memberships").toString())); + } + + // validate the optional field `memberships` (array) + for (int i = 0; i < jsonArraymemberships.size(); i++) { + Href.validateJsonObject(jsonArraymemberships.get(i).getAsJsonObject()); + }; } - - // validate the optional field `memberships` (array) - for (int i = 0; i < jsonArraymemberships.size(); i++) { - Href.validateJsonObject(jsonArraymemberships.get(i).getAsJsonObject()); - }; } if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); @@ -716,29 +724,33 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if (jsonObj.get("payment_method") != null && !jsonObj.get("payment_method").isJsonNull()) { Href.validateJsonObject(jsonObj.getAsJsonObject("payment_method")); } - JsonArray jsonArraysshKeys = jsonObj.getAsJsonArray("ssh_keys"); - if (jsonArraysshKeys != null) { - // ensure the json data is an array - if (!jsonObj.get("ssh_keys").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `ssh_keys` to be an array in the JSON string but got `%s`", jsonObj.get("ssh_keys").toString())); + if (jsonObj.get("ssh_keys") != null && !jsonObj.get("ssh_keys").isJsonNull()) { + JsonArray jsonArraysshKeys = jsonObj.getAsJsonArray("ssh_keys"); + if (jsonArraysshKeys != null) { + // ensure the json data is an array + if (!jsonObj.get("ssh_keys").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `ssh_keys` to be an array in the JSON string but got `%s`", jsonObj.get("ssh_keys").toString())); + } + + // validate the optional field `ssh_keys` (array) + for (int i = 0; i < jsonArraysshKeys.size(); i++) { + Href.validateJsonObject(jsonArraysshKeys.get(i).getAsJsonObject()); + }; } - - // validate the optional field `ssh_keys` (array) - for (int i = 0; i < jsonArraysshKeys.size(); i++) { - Href.validateJsonObject(jsonArraysshKeys.get(i).getAsJsonObject()); - }; } - JsonArray jsonArrayvolumes = jsonObj.getAsJsonArray("volumes"); - if (jsonArrayvolumes != null) { - // ensure the json data is an array - if (!jsonObj.get("volumes").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `volumes` to be an array in the JSON string but got `%s`", jsonObj.get("volumes").toString())); + if (jsonObj.get("volumes") != null && !jsonObj.get("volumes").isJsonNull()) { + JsonArray jsonArrayvolumes = jsonObj.getAsJsonArray("volumes"); + if (jsonArrayvolumes != null) { + // ensure the json data is an array + if (!jsonObj.get("volumes").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `volumes` to be an array in the JSON string but got `%s`", jsonObj.get("volumes").toString())); + } + + // validate the optional field `volumes` (array) + for (int i = 0; i < jsonArrayvolumes.size(); i++) { + Href.validateJsonObject(jsonArrayvolumes.get(i).getAsJsonObject()); + }; } - - // validate the optional field `volumes` (array) - for (int i = 0; i < jsonArrayvolumes.size(); i++) { - Href.validateJsonObject(jsonArrayvolumes.get(i).getAsJsonObject()); - }; } } diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/AuthTokenUser.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/AuthTokenUser.java index 15563a731..deffb4c68 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/AuthTokenUser.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/AuthTokenUser.java @@ -811,17 +811,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); } - JsonArray jsonArrayemails = jsonObj.getAsJsonArray("emails"); - if (jsonArrayemails != null) { - // ensure the json data is an array - if (!jsonObj.get("emails").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `emails` to be an array in the JSON string but got `%s`", jsonObj.get("emails").toString())); + if (jsonObj.get("emails") != null && !jsonObj.get("emails").isJsonNull()) { + JsonArray jsonArrayemails = jsonObj.getAsJsonArray("emails"); + if (jsonArrayemails != null) { + // ensure the json data is an array + if (!jsonObj.get("emails").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `emails` to be an array in the JSON string but got `%s`", jsonObj.get("emails").toString())); + } + + // validate the optional field `emails` (array) + for (int i = 0; i < jsonArrayemails.size(); i++) { + Href.validateJsonObject(jsonArrayemails.get(i).getAsJsonObject()); + }; } - - // validate the optional field `emails` (array) - for (int i = 0; i < jsonArrayemails.size(); i++) { - Href.validateJsonObject(jsonArrayemails.get(i).getAsJsonObject()); - }; } if ((jsonObj.get("first_name") != null && !jsonObj.get("first_name").isJsonNull()) && !jsonObj.get("first_name").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `first_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("first_name").toString())); diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/Batch.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/Batch.java index 7aa07ff0d..1409dd8d9 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/Batch.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/Batch.java @@ -412,17 +412,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { throw new IllegalArgumentException(String.format("The required field(s) %s in Batch is not found in the empty JSON string", Batch.openapiRequiredFields.toString())); } } - JsonArray jsonArraydevices = jsonObj.getAsJsonArray("devices"); - if (jsonArraydevices != null) { - // ensure the json data is an array - if (!jsonObj.get("devices").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `devices` to be an array in the JSON string but got `%s`", jsonObj.get("devices").toString())); + if (jsonObj.get("devices") != null && !jsonObj.get("devices").isJsonNull()) { + JsonArray jsonArraydevices = jsonObj.getAsJsonArray("devices"); + if (jsonArraydevices != null) { + // ensure the json data is an array + if (!jsonObj.get("devices").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `devices` to be an array in the JSON string but got `%s`", jsonObj.get("devices").toString())); + } + + // validate the optional field `devices` (array) + for (int i = 0; i < jsonArraydevices.size(); i++) { + Href.validateJsonObject(jsonArraydevices.get(i).getAsJsonObject()); + }; } - - // validate the optional field `devices` (array) - for (int i = 0; i < jsonArraydevices.size(); i++) { - Href.validateJsonObject(jsonArraydevices.get(i).getAsJsonObject()); - }; } // ensure the json data is an array if ((jsonObj.get("error_messages") != null && !jsonObj.get("error_messages").isJsonNull()) && !jsonObj.get("error_messages").isJsonArray()) { diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/BatchesList.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/BatchesList.java index 0dd5471c9..e302aba2a 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/BatchesList.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/BatchesList.java @@ -192,17 +192,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { throw new IllegalArgumentException(String.format("The required field(s) %s in BatchesList is not found in the empty JSON string", BatchesList.openapiRequiredFields.toString())); } } - JsonArray jsonArraybatches = jsonObj.getAsJsonArray("batches"); - if (jsonArraybatches != null) { - // ensure the json data is an array - if (!jsonObj.get("batches").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `batches` to be an array in the JSON string but got `%s`", jsonObj.get("batches").toString())); + if (jsonObj.get("batches") != null && !jsonObj.get("batches").isJsonNull()) { + JsonArray jsonArraybatches = jsonObj.getAsJsonArray("batches"); + if (jsonArraybatches != null) { + // ensure the json data is an array + if (!jsonObj.get("batches").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `batches` to be an array in the JSON string but got `%s`", jsonObj.get("batches").toString())); + } + + // validate the optional field `batches` (array) + for (int i = 0; i < jsonArraybatches.size(); i++) { + Batch.validateJsonObject(jsonArraybatches.get(i).getAsJsonObject()); + }; } - - // validate the optional field `batches` (array) - for (int i = 0; i < jsonArraybatches.size(); i++) { - Batch.validateJsonObject(jsonArraybatches.get(i).getAsJsonObject()); - }; } } diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/BgpConfig.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/BgpConfig.java index e9df16371..00583a774 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/BgpConfig.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/BgpConfig.java @@ -688,32 +688,36 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if (jsonObj.get("project") != null && !jsonObj.get("project").isJsonNull()) { Href.validateJsonObject(jsonObj.getAsJsonObject("project")); } - JsonArray jsonArrayranges = jsonObj.getAsJsonArray("ranges"); - if (jsonArrayranges != null) { - // ensure the json data is an array - if (!jsonObj.get("ranges").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `ranges` to be an array in the JSON string but got `%s`", jsonObj.get("ranges").toString())); + if (jsonObj.get("ranges") != null && !jsonObj.get("ranges").isJsonNull()) { + JsonArray jsonArrayranges = jsonObj.getAsJsonArray("ranges"); + if (jsonArrayranges != null) { + // ensure the json data is an array + if (!jsonObj.get("ranges").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `ranges` to be an array in the JSON string but got `%s`", jsonObj.get("ranges").toString())); + } + + // validate the optional field `ranges` (array) + for (int i = 0; i < jsonArrayranges.size(); i++) { + GlobalBgpRange.validateJsonObject(jsonArrayranges.get(i).getAsJsonObject()); + }; } - - // validate the optional field `ranges` (array) - for (int i = 0; i < jsonArrayranges.size(); i++) { - GlobalBgpRange.validateJsonObject(jsonArrayranges.get(i).getAsJsonObject()); - }; } if ((jsonObj.get("route_object") != null && !jsonObj.get("route_object").isJsonNull()) && !jsonObj.get("route_object").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `route_object` to be a primitive type in the JSON string but got `%s`", jsonObj.get("route_object").toString())); } - JsonArray jsonArraysessions = jsonObj.getAsJsonArray("sessions"); - if (jsonArraysessions != null) { - // ensure the json data is an array - if (!jsonObj.get("sessions").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `sessions` to be an array in the JSON string but got `%s`", jsonObj.get("sessions").toString())); + if (jsonObj.get("sessions") != null && !jsonObj.get("sessions").isJsonNull()) { + JsonArray jsonArraysessions = jsonObj.getAsJsonArray("sessions"); + if (jsonArraysessions != null) { + // ensure the json data is an array + if (!jsonObj.get("sessions").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `sessions` to be an array in the JSON string but got `%s`", jsonObj.get("sessions").toString())); + } + + // validate the optional field `sessions` (array) + for (int i = 0; i < jsonArraysessions.size(); i++) { + BgpSession.validateJsonObject(jsonArraysessions.get(i).getAsJsonObject()); + }; } - - // validate the optional field `sessions` (array) - for (int i = 0; i < jsonArraysessions.size(); i++) { - BgpSession.validateJsonObject(jsonArraysessions.get(i).getAsJsonObject()); - }; } if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/BgpNeighborData.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/BgpNeighborData.java index 9d79c9f1c..39c5fe47d 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/BgpNeighborData.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/BgpNeighborData.java @@ -490,29 +490,33 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if ((jsonObj.get("peer_ips") != null && !jsonObj.get("peer_ips").isJsonNull()) && !jsonObj.get("peer_ips").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `peer_ips` to be an array in the JSON string but got `%s`", jsonObj.get("peer_ips").toString())); } - JsonArray jsonArrayroutesIn = jsonObj.getAsJsonArray("routes_in"); - if (jsonArrayroutesIn != null) { - // ensure the json data is an array - if (!jsonObj.get("routes_in").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `routes_in` to be an array in the JSON string but got `%s`", jsonObj.get("routes_in").toString())); + if (jsonObj.get("routes_in") != null && !jsonObj.get("routes_in").isJsonNull()) { + JsonArray jsonArrayroutesIn = jsonObj.getAsJsonArray("routes_in"); + if (jsonArrayroutesIn != null) { + // ensure the json data is an array + if (!jsonObj.get("routes_in").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `routes_in` to be an array in the JSON string but got `%s`", jsonObj.get("routes_in").toString())); + } + + // validate the optional field `routes_in` (array) + for (int i = 0; i < jsonArrayroutesIn.size(); i++) { + BgpNeighborDataRoutesInInner.validateJsonObject(jsonArrayroutesIn.get(i).getAsJsonObject()); + }; } - - // validate the optional field `routes_in` (array) - for (int i = 0; i < jsonArrayroutesIn.size(); i++) { - BgpNeighborDataRoutesInInner.validateJsonObject(jsonArrayroutesIn.get(i).getAsJsonObject()); - }; } - JsonArray jsonArrayroutesOut = jsonObj.getAsJsonArray("routes_out"); - if (jsonArrayroutesOut != null) { - // ensure the json data is an array - if (!jsonObj.get("routes_out").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `routes_out` to be an array in the JSON string but got `%s`", jsonObj.get("routes_out").toString())); + if (jsonObj.get("routes_out") != null && !jsonObj.get("routes_out").isJsonNull()) { + JsonArray jsonArrayroutesOut = jsonObj.getAsJsonArray("routes_out"); + if (jsonArrayroutesOut != null) { + // ensure the json data is an array + if (!jsonObj.get("routes_out").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `routes_out` to be an array in the JSON string but got `%s`", jsonObj.get("routes_out").toString())); + } + + // validate the optional field `routes_out` (array) + for (int i = 0; i < jsonArrayroutesOut.size(); i++) { + BgpNeighborDataRoutesOutInner.validateJsonObject(jsonArrayroutesOut.get(i).getAsJsonObject()); + }; } - - // validate the optional field `routes_out` (array) - for (int i = 0; i < jsonArrayroutesOut.size(); i++) { - BgpNeighborDataRoutesOutInner.validateJsonObject(jsonArrayroutesOut.get(i).getAsJsonObject()); - }; } } diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/BgpSessionList.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/BgpSessionList.java index 6b1cd637a..aa3f2dce1 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/BgpSessionList.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/BgpSessionList.java @@ -192,17 +192,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { throw new IllegalArgumentException(String.format("The required field(s) %s in BgpSessionList is not found in the empty JSON string", BgpSessionList.openapiRequiredFields.toString())); } } - JsonArray jsonArraybgpSessions = jsonObj.getAsJsonArray("bgp_sessions"); - if (jsonArraybgpSessions != null) { - // ensure the json data is an array - if (!jsonObj.get("bgp_sessions").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `bgp_sessions` to be an array in the JSON string but got `%s`", jsonObj.get("bgp_sessions").toString())); + if (jsonObj.get("bgp_sessions") != null && !jsonObj.get("bgp_sessions").isJsonNull()) { + JsonArray jsonArraybgpSessions = jsonObj.getAsJsonArray("bgp_sessions"); + if (jsonArraybgpSessions != null) { + // ensure the json data is an array + if (!jsonObj.get("bgp_sessions").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `bgp_sessions` to be an array in the JSON string but got `%s`", jsonObj.get("bgp_sessions").toString())); + } + + // validate the optional field `bgp_sessions` (array) + for (int i = 0; i < jsonArraybgpSessions.size(); i++) { + BgpSession.validateJsonObject(jsonArraybgpSessions.get(i).getAsJsonObject()); + }; } - - // validate the optional field `bgp_sessions` (array) - for (int i = 0; i < jsonArraybgpSessions.size(); i++) { - BgpSession.validateJsonObject(jsonArraybgpSessions.get(i).getAsJsonObject()); - }; } } diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/BgpSessionNeighbors.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/BgpSessionNeighbors.java index 915b2d9dd..e661f0d36 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/BgpSessionNeighbors.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/BgpSessionNeighbors.java @@ -192,17 +192,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { throw new IllegalArgumentException(String.format("The required field(s) %s in BgpSessionNeighbors is not found in the empty JSON string", BgpSessionNeighbors.openapiRequiredFields.toString())); } } - JsonArray jsonArraybgpNeighbors = jsonObj.getAsJsonArray("bgp_neighbors"); - if (jsonArraybgpNeighbors != null) { - // ensure the json data is an array - if (!jsonObj.get("bgp_neighbors").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `bgp_neighbors` to be an array in the JSON string but got `%s`", jsonObj.get("bgp_neighbors").toString())); + if (jsonObj.get("bgp_neighbors") != null && !jsonObj.get("bgp_neighbors").isJsonNull()) { + JsonArray jsonArraybgpNeighbors = jsonObj.getAsJsonArray("bgp_neighbors"); + if (jsonArraybgpNeighbors != null) { + // ensure the json data is an array + if (!jsonObj.get("bgp_neighbors").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `bgp_neighbors` to be an array in the JSON string but got `%s`", jsonObj.get("bgp_neighbors").toString())); + } + + // validate the optional field `bgp_neighbors` (array) + for (int i = 0; i < jsonArraybgpNeighbors.size(); i++) { + BgpNeighborData.validateJsonObject(jsonArraybgpNeighbors.get(i).getAsJsonObject()); + }; } - - // validate the optional field `bgp_neighbors` (array) - for (int i = 0; i < jsonArraybgpNeighbors.size(); i++) { - BgpNeighborData.validateJsonObject(jsonArraybgpNeighbors.get(i).getAsJsonObject()); - }; } } diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/CapacityCheckPerFacilityList.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/CapacityCheckPerFacilityList.java index ba9dd404a..5b2a03fe7 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/CapacityCheckPerFacilityList.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/CapacityCheckPerFacilityList.java @@ -192,17 +192,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { throw new IllegalArgumentException(String.format("The required field(s) %s in CapacityCheckPerFacilityList is not found in the empty JSON string", CapacityCheckPerFacilityList.openapiRequiredFields.toString())); } } - JsonArray jsonArrayservers = jsonObj.getAsJsonArray("servers"); - if (jsonArrayservers != null) { - // ensure the json data is an array - if (!jsonObj.get("servers").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `servers` to be an array in the JSON string but got `%s`", jsonObj.get("servers").toString())); + if (jsonObj.get("servers") != null && !jsonObj.get("servers").isJsonNull()) { + JsonArray jsonArrayservers = jsonObj.getAsJsonArray("servers"); + if (jsonArrayservers != null) { + // ensure the json data is an array + if (!jsonObj.get("servers").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `servers` to be an array in the JSON string but got `%s`", jsonObj.get("servers").toString())); + } + + // validate the optional field `servers` (array) + for (int i = 0; i < jsonArrayservers.size(); i++) { + CapacityCheckPerFacilityInfo.validateJsonObject(jsonArrayservers.get(i).getAsJsonObject()); + }; } - - // validate the optional field `servers` (array) - for (int i = 0; i < jsonArrayservers.size(); i++) { - CapacityCheckPerFacilityInfo.validateJsonObject(jsonArrayservers.get(i).getAsJsonObject()); - }; } } diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/CapacityCheckPerMetroList.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/CapacityCheckPerMetroList.java index 26e57cda0..ffb1aee96 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/CapacityCheckPerMetroList.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/CapacityCheckPerMetroList.java @@ -192,17 +192,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { throw new IllegalArgumentException(String.format("The required field(s) %s in CapacityCheckPerMetroList is not found in the empty JSON string", CapacityCheckPerMetroList.openapiRequiredFields.toString())); } } - JsonArray jsonArrayservers = jsonObj.getAsJsonArray("servers"); - if (jsonArrayservers != null) { - // ensure the json data is an array - if (!jsonObj.get("servers").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `servers` to be an array in the JSON string but got `%s`", jsonObj.get("servers").toString())); + if (jsonObj.get("servers") != null && !jsonObj.get("servers").isJsonNull()) { + JsonArray jsonArrayservers = jsonObj.getAsJsonArray("servers"); + if (jsonArrayservers != null) { + // ensure the json data is an array + if (!jsonObj.get("servers").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `servers` to be an array in the JSON string but got `%s`", jsonObj.get("servers").toString())); + } + + // validate the optional field `servers` (array) + for (int i = 0; i < jsonArrayservers.size(); i++) { + CapacityCheckPerMetroInfo.validateJsonObject(jsonArrayservers.get(i).getAsJsonObject()); + }; } - - // validate the optional field `servers` (array) - for (int i = 0; i < jsonArrayservers.size(); i++) { - CapacityCheckPerMetroInfo.validateJsonObject(jsonArrayservers.get(i).getAsJsonObject()); - }; } } diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/CapacityInput.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/CapacityInput.java index aec6a472f..37c5ec469 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/CapacityInput.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/CapacityInput.java @@ -192,17 +192,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { throw new IllegalArgumentException(String.format("The required field(s) %s in CapacityInput is not found in the empty JSON string", CapacityInput.openapiRequiredFields.toString())); } } - JsonArray jsonArrayservers = jsonObj.getAsJsonArray("servers"); - if (jsonArrayservers != null) { - // ensure the json data is an array - if (!jsonObj.get("servers").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `servers` to be an array in the JSON string but got `%s`", jsonObj.get("servers").toString())); + if (jsonObj.get("servers") != null && !jsonObj.get("servers").isJsonNull()) { + JsonArray jsonArrayservers = jsonObj.getAsJsonArray("servers"); + if (jsonArrayservers != null) { + // ensure the json data is an array + if (!jsonObj.get("servers").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `servers` to be an array in the JSON string but got `%s`", jsonObj.get("servers").toString())); + } + + // validate the optional field `servers` (array) + for (int i = 0; i < jsonArrayservers.size(); i++) { + ServerInfo.validateJsonObject(jsonArrayservers.get(i).getAsJsonObject()); + }; } - - // validate the optional field `servers` (array) - for (int i = 0; i < jsonArrayservers.size(); i++) { - ServerInfo.validateJsonObject(jsonArrayservers.get(i).getAsJsonObject()); - }; } } diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/CapacityPerMetroInput.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/CapacityPerMetroInput.java index b53880a6e..a69ea4c71 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/CapacityPerMetroInput.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/CapacityPerMetroInput.java @@ -192,17 +192,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { throw new IllegalArgumentException(String.format("The required field(s) %s in CapacityPerMetroInput is not found in the empty JSON string", CapacityPerMetroInput.openapiRequiredFields.toString())); } } - JsonArray jsonArrayservers = jsonObj.getAsJsonArray("servers"); - if (jsonArrayservers != null) { - // ensure the json data is an array - if (!jsonObj.get("servers").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `servers` to be an array in the JSON string but got `%s`", jsonObj.get("servers").toString())); + if (jsonObj.get("servers") != null && !jsonObj.get("servers").isJsonNull()) { + JsonArray jsonArrayservers = jsonObj.getAsJsonArray("servers"); + if (jsonArrayservers != null) { + // ensure the json data is an array + if (!jsonObj.get("servers").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `servers` to be an array in the JSON string but got `%s`", jsonObj.get("servers").toString())); + } + + // validate the optional field `servers` (array) + for (int i = 0; i < jsonArrayservers.size(); i++) { + MetroServerInfo.validateJsonObject(jsonArrayservers.get(i).getAsJsonObject()); + }; } - - // validate the optional field `servers` (array) - for (int i = 0; i < jsonArrayservers.size(); i++) { - MetroServerInfo.validateJsonObject(jsonArrayservers.get(i).getAsJsonObject()); - }; } } diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/CreateMetalGatewayRequest.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/CreateMetalGatewayRequest.java index 36163e1e5..d42cd80e5 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/CreateMetalGatewayRequest.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/CreateMetalGatewayRequest.java @@ -15,7 +15,7 @@ import java.util.Objects; import java.util.Arrays; -import com.equinix.openapi.metal.v1.model.MetalGatewayInput; +import com.equinix.openapi.metal.v1.model.MetalGatewayCreateInput; import com.equinix.openapi.metal.v1.model.VrfMetalGatewayCreateInput; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; @@ -72,7 +72,7 @@ public TypeAdapter create(Gson gson, TypeToken type) { return null; // this class only serializes 'CreateMetalGatewayRequest' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter adapterMetalGatewayInput = gson.getDelegateAdapter(this, TypeToken.get(MetalGatewayInput.class)); + final TypeAdapter adapterMetalGatewayCreateInput = gson.getDelegateAdapter(this, TypeToken.get(MetalGatewayCreateInput.class)); final TypeAdapter adapterVrfMetalGatewayCreateInput = gson.getDelegateAdapter(this, TypeToken.get(VrfMetalGatewayCreateInput.class)); return (TypeAdapter) new TypeAdapter() { @@ -83,9 +83,9 @@ public void write(JsonWriter out, CreateMetalGatewayRequest value) throws IOExce return; } - // check if the actual instance is of the type `MetalGatewayInput` - if (value.getActualInstance() instanceof MetalGatewayInput) { - JsonObject obj = adapterMetalGatewayInput.toJsonTree((MetalGatewayInput)value.getActualInstance()).getAsJsonObject(); + // check if the actual instance is of the type `MetalGatewayCreateInput` + if (value.getActualInstance() instanceof MetalGatewayCreateInput) { + JsonObject obj = adapterMetalGatewayCreateInput.toJsonTree((MetalGatewayCreateInput)value.getActualInstance()).getAsJsonObject(); elementAdapter.write(out, obj); return; } @@ -97,7 +97,7 @@ public void write(JsonWriter out, CreateMetalGatewayRequest value) throws IOExce return; } - throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: MetalGatewayInput, VrfMetalGatewayCreateInput"); + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: MetalGatewayCreateInput, VrfMetalGatewayCreateInput"); } @Override @@ -109,17 +109,17 @@ public CreateMetalGatewayRequest read(JsonReader in) throws IOException { ArrayList errorMessages = new ArrayList<>(); TypeAdapter actualAdapter = elementAdapter; - // deserialize MetalGatewayInput + // deserialize MetalGatewayCreateInput try { // validate the JSON object to see if any exception is thrown - MetalGatewayInput.validateJsonObject(jsonObject); - actualAdapter = adapterMetalGatewayInput; + MetalGatewayCreateInput.validateJsonObject(jsonObject); + actualAdapter = adapterMetalGatewayCreateInput; match++; - log.log(Level.FINER, "Input data matches schema 'MetalGatewayInput'"); + log.log(Level.FINER, "Input data matches schema 'MetalGatewayCreateInput'"); } catch (Exception e) { // deserialization failed, continue - errorMessages.add(String.format("Deserialization for MetalGatewayInput failed with `%s`.", e.getMessage())); - log.log(Level.FINER, "Input data does not match schema 'MetalGatewayInput'", e); + errorMessages.add(String.format("Deserialization for MetalGatewayCreateInput failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'MetalGatewayCreateInput'", e); } // deserialize VrfMetalGatewayCreateInput @@ -154,7 +154,7 @@ public CreateMetalGatewayRequest() { super("oneOf", Boolean.FALSE); } - public CreateMetalGatewayRequest(MetalGatewayInput o) { + public CreateMetalGatewayRequest(MetalGatewayCreateInput o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } @@ -165,7 +165,7 @@ public CreateMetalGatewayRequest(VrfMetalGatewayCreateInput o) { } static { - schemas.put("MetalGatewayInput", new GenericType() { + schemas.put("MetalGatewayCreateInput", new GenericType() { }); schemas.put("VrfMetalGatewayCreateInput", new GenericType() { }); @@ -179,14 +179,14 @@ public Map getSchemas() { /** * Set the instance that matches the oneOf child schema, check * the instance parameter is valid against the oneOf child schemas: - * MetalGatewayInput, VrfMetalGatewayCreateInput + * MetalGatewayCreateInput, VrfMetalGatewayCreateInput * * It could be an instance of the 'oneOf' schemas. * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). */ @Override public void setActualInstance(Object instance) { - if (instance instanceof MetalGatewayInput) { + if (instance instanceof MetalGatewayCreateInput) { super.setActualInstance(instance); return; } @@ -196,14 +196,14 @@ public void setActualInstance(Object instance) { return; } - throw new RuntimeException("Invalid instance type. Must be MetalGatewayInput, VrfMetalGatewayCreateInput"); + throw new RuntimeException("Invalid instance type. Must be MetalGatewayCreateInput, VrfMetalGatewayCreateInput"); } /** * Get the actual instance, which can be the following: - * MetalGatewayInput, VrfMetalGatewayCreateInput + * MetalGatewayCreateInput, VrfMetalGatewayCreateInput * - * @return The actual instance (MetalGatewayInput, VrfMetalGatewayCreateInput) + * @return The actual instance (MetalGatewayCreateInput, VrfMetalGatewayCreateInput) */ @Override public Object getActualInstance() { @@ -211,14 +211,14 @@ public Object getActualInstance() { } /** - * Get the actual instance of `MetalGatewayInput`. If the actual instance is not `MetalGatewayInput`, + * Get the actual instance of `MetalGatewayCreateInput`. If the actual instance is not `MetalGatewayCreateInput`, * the ClassCastException will be thrown. * - * @return The actual instance of `MetalGatewayInput` - * @throws ClassCastException if the instance is not `MetalGatewayInput` + * @return The actual instance of `MetalGatewayCreateInput` + * @throws ClassCastException if the instance is not `MetalGatewayCreateInput` */ - public MetalGatewayInput getMetalGatewayInput() throws ClassCastException { - return (MetalGatewayInput)super.getActualInstance(); + public MetalGatewayCreateInput getMetalGatewayCreateInput() throws ClassCastException { + return (MetalGatewayCreateInput)super.getActualInstance(); } /** @@ -243,12 +243,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate oneOf schemas one by one int validCount = 0; ArrayList errorMessages = new ArrayList<>(); - // validate the json string with MetalGatewayInput + // validate the json string with MetalGatewayCreateInput try { - MetalGatewayInput.validateJsonObject(jsonObj); + MetalGatewayCreateInput.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { - errorMessages.add(String.format("Deserialization for MetalGatewayInput failed with `%s`.", e.getMessage())); + errorMessages.add(String.format("Deserialization for MetalGatewayCreateInput failed with `%s`.", e.getMessage())); // continue to the next one } // validate the json string with VrfMetalGatewayCreateInput @@ -260,7 +260,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // continue to the next one } if (validCount != 1) { - throw new IOException(String.format("The JSON string is invalid for CreateMetalGatewayRequest with oneOf schemas: MetalGatewayInput, VrfMetalGatewayCreateInput. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); + throw new IOException(String.format("The JSON string is invalid for CreateMetalGatewayRequest with oneOf schemas: MetalGatewayCreateInput, VrfMetalGatewayCreateInput. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); } } diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/CreateSelfServiceReservationRequest.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/CreateSelfServiceReservationRequest.java index 4568c34c5..b8a655f12 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/CreateSelfServiceReservationRequest.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/CreateSelfServiceReservationRequest.java @@ -284,17 +284,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { throw new IllegalArgumentException(String.format("The required field(s) %s in CreateSelfServiceReservationRequest is not found in the empty JSON string", CreateSelfServiceReservationRequest.openapiRequiredFields.toString())); } } - JsonArray jsonArrayitem = jsonObj.getAsJsonArray("item"); - if (jsonArrayitem != null) { - // ensure the json data is an array - if (!jsonObj.get("item").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `item` to be an array in the JSON string but got `%s`", jsonObj.get("item").toString())); + if (jsonObj.get("item") != null && !jsonObj.get("item").isJsonNull()) { + JsonArray jsonArrayitem = jsonObj.getAsJsonArray("item"); + if (jsonArrayitem != null) { + // ensure the json data is an array + if (!jsonObj.get("item").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `item` to be an array in the JSON string but got `%s`", jsonObj.get("item").toString())); + } + + // validate the optional field `item` (array) + for (int i = 0; i < jsonArrayitem.size(); i++) { + SelfServiceReservationItemRequest.validateJsonObject(jsonArrayitem.get(i).getAsJsonObject()); + }; } - - // validate the optional field `item` (array) - for (int i = 0; i < jsonArrayitem.size(); i++) { - SelfServiceReservationItemRequest.validateJsonObject(jsonArrayitem.get(i).getAsJsonObject()); - }; } if ((jsonObj.get("notes") != null && !jsonObj.get("notes").isJsonNull()) && !jsonObj.get("notes").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `notes` to be a primitive type in the JSON string but got `%s`", jsonObj.get("notes").toString())); diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/CreateVrfRequest.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/CreateVrfRequest.java deleted file mode 100644 index defdd34a9..000000000 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/CreateVrfRequest.java +++ /dev/null @@ -1,457 +0,0 @@ -/* - * Metal API - * This is the API for Equinix Metal. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. The official API docs are hosted at . - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@equinixmetal.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.equinix.openapi.metal.v1.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.UUID; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import com.equinix.openapi.JSON; - -/** - * CreateVrfRequest - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class CreateVrfRequest { - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - private String description; - - public static final String SERIALIZED_NAME_IP_RANGES = "ip_ranges"; - @SerializedName(SERIALIZED_NAME_IP_RANGES) - private List ipRanges = null; - - public static final String SERIALIZED_NAME_LOCAL_ASN = "local_asn"; - @SerializedName(SERIALIZED_NAME_LOCAL_ASN) - private Integer localAsn; - - public static final String SERIALIZED_NAME_METRO = "metro"; - @SerializedName(SERIALIZED_NAME_METRO) - private String metro; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_PROJECT_ID = "project_id"; - @SerializedName(SERIALIZED_NAME_PROJECT_ID) - private UUID projectId; - - public CreateVrfRequest() { - } - - public CreateVrfRequest description(String description) { - - this.description = description; - return this; - } - - /** - * Get description - * @return description - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public String getDescription() { - return description; - } - - - public void setDescription(String description) { - this.description = description; - } - - - public CreateVrfRequest ipRanges(List ipRanges) { - - this.ipRanges = ipRanges; - return this; - } - - public CreateVrfRequest addIpRangesItem(String ipRangesItem) { - if (this.ipRanges == null) { - this.ipRanges = new ArrayList<>(); - } - this.ipRanges.add(ipRangesItem); - return this; - } - - /** - * A list of CIDR network addresses. Like [\"10.0.0.0/16\", \"2001:d78::/56\"]. IPv4 blocks must be between /8 and /29 in size. IPv6 blocks must be between /56 and /64. A VRF\\'s IP ranges must be defined in order to create VRF IP Reservations, which can then be used for Metal Gateways or Virtual Circuits. - * @return ipRanges - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "A list of CIDR network addresses. Like [\"10.0.0.0/16\", \"2001:d78::/56\"]. IPv4 blocks must be between /8 and /29 in size. IPv6 blocks must be between /56 and /64. A VRF\\'s IP ranges must be defined in order to create VRF IP Reservations, which can then be used for Metal Gateways or Virtual Circuits.") - - public List getIpRanges() { - return ipRanges; - } - - - public void setIpRanges(List ipRanges) { - this.ipRanges = ipRanges; - } - - - public CreateVrfRequest localAsn(Integer localAsn) { - - this.localAsn = localAsn; - return this; - } - - /** - * Get localAsn - * @return localAsn - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public Integer getLocalAsn() { - return localAsn; - } - - - public void setLocalAsn(Integer localAsn) { - this.localAsn = localAsn; - } - - - public CreateVrfRequest metro(String metro) { - - this.metro = metro; - return this; - } - - /** - * The UUID (or metro code) for the Metro in which to create this VRF. - * @return metro - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The UUID (or metro code) for the Metro in which to create this VRF.") - - public String getMetro() { - return metro; - } - - - public void setMetro(String metro) { - this.metro = metro; - } - - - public CreateVrfRequest name(String name) { - - this.name = name; - return this; - } - - /** - * Get name - * @return name - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - public CreateVrfRequest projectId(UUID projectId) { - - this.projectId = projectId; - return this; - } - - /** - * Get projectId - * @return projectId - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - - public UUID getProjectId() { - return projectId; - } - - - public void setProjectId(UUID projectId) { - this.projectId = projectId; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public CreateVrfRequest putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CreateVrfRequest createVrfRequest = (CreateVrfRequest) o; - return Objects.equals(this.description, createVrfRequest.description) && - Objects.equals(this.ipRanges, createVrfRequest.ipRanges) && - Objects.equals(this.localAsn, createVrfRequest.localAsn) && - Objects.equals(this.metro, createVrfRequest.metro) && - Objects.equals(this.name, createVrfRequest.name) && - Objects.equals(this.projectId, createVrfRequest.projectId)&& - Objects.equals(this.additionalProperties, createVrfRequest.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(description, ipRanges, localAsn, metro, name, projectId, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateVrfRequest {\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" ipRanges: ").append(toIndentedString(ipRanges)).append("\n"); - sb.append(" localAsn: ").append(toIndentedString(localAsn)).append("\n"); - sb.append(" metro: ").append(toIndentedString(metro)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" projectId: ").append(toIndentedString(projectId)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("description"); - openapiFields.add("ip_ranges"); - openapiFields.add("local_asn"); - openapiFields.add("metro"); - openapiFields.add("name"); - openapiFields.add("project_id"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("metro"); - openapiRequiredFields.add("name"); - openapiRequiredFields.add("project_id"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateVrfRequest - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (CreateVrfRequest.openapiRequiredFields.isEmpty()) { - return; - } else { // has required fields - throw new IllegalArgumentException(String.format("The required field(s) %s in CreateVrfRequest is not found in the empty JSON string", CreateVrfRequest.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CreateVrfRequest.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); - } - // ensure the json data is an array - if ((jsonObj.get("ip_ranges") != null && !jsonObj.get("ip_ranges").isJsonNull()) && !jsonObj.get("ip_ranges").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `ip_ranges` to be an array in the JSON string but got `%s`", jsonObj.get("ip_ranges").toString())); - } - if ((jsonObj.get("metro") != null && !jsonObj.get("metro").isJsonNull()) && !jsonObj.get("metro").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `metro` to be a primitive type in the JSON string but got `%s`", jsonObj.get("metro").toString())); - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if ((jsonObj.get("project_id") != null && !jsonObj.get("project_id").isJsonNull()) && !jsonObj.get("project_id").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `project_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("project_id").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateVrfRequest.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateVrfRequest' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CreateVrfRequest.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateVrfRequest value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public CreateVrfRequest read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - CreateVrfRequest instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of CreateVrfRequest given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateVrfRequest - * @throws IOException if the JSON string is invalid with respect to CreateVrfRequest - */ - public static CreateVrfRequest fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateVrfRequest.class); - } - - /** - * Convert an instance of CreateVrfRequest to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/DefaultIPReservation.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/DefaultIPReservation.java index 6e1237aaf..e85c44982 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/DefaultIPReservation.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/DefaultIPReservation.java @@ -384,17 +384,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); } } - JsonArray jsonArrayassignments = jsonObj.getAsJsonArray("assignments"); - if (jsonArrayassignments != null) { - // ensure the json data is an array - if (!jsonObj.get("assignments").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `assignments` to be an array in the JSON string but got `%s`", jsonObj.get("assignments").toString())); + if (jsonObj.get("assignments") != null && !jsonObj.get("assignments").isJsonNull()) { + JsonArray jsonArrayassignments = jsonObj.getAsJsonArray("assignments"); + if (jsonArrayassignments != null) { + // ensure the json data is an array + if (!jsonObj.get("assignments").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `assignments` to be an array in the JSON string but got `%s`", jsonObj.get("assignments").toString())); + } + + // validate the optional field `assignments` (array) + for (int i = 0; i < jsonArrayassignments.size(); i++) { + IPAssignment.validateJsonObject(jsonArrayassignments.get(i).getAsJsonObject()); + }; } - - // validate the optional field `assignments` (array) - for (int i = 0; i < jsonArrayassignments.size(); i++) { - IPAssignment.validateJsonObject(jsonArrayassignments.get(i).getAsJsonObject()); - }; } // validate the optional field `facility` if (jsonObj.get("facility") != null && !jsonObj.get("facility").isJsonNull()) { diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/DefaultIPReservationAllOf.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/DefaultIPReservationAllOf.java index bcbd5a38b..d2ac5cbaf 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/DefaultIPReservationAllOf.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/DefaultIPReservationAllOf.java @@ -374,17 +374,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { throw new IllegalArgumentException(String.format("The required field(s) %s in DefaultIPReservationAllOf is not found in the empty JSON string", DefaultIPReservationAllOf.openapiRequiredFields.toString())); } } - JsonArray jsonArrayassignments = jsonObj.getAsJsonArray("assignments"); - if (jsonArrayassignments != null) { - // ensure the json data is an array - if (!jsonObj.get("assignments").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `assignments` to be an array in the JSON string but got `%s`", jsonObj.get("assignments").toString())); + if (jsonObj.get("assignments") != null && !jsonObj.get("assignments").isJsonNull()) { + JsonArray jsonArrayassignments = jsonObj.getAsJsonArray("assignments"); + if (jsonArrayassignments != null) { + // ensure the json data is an array + if (!jsonObj.get("assignments").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `assignments` to be an array in the JSON string but got `%s`", jsonObj.get("assignments").toString())); + } + + // validate the optional field `assignments` (array) + for (int i = 0; i < jsonArrayassignments.size(); i++) { + IPAssignment.validateJsonObject(jsonArrayassignments.get(i).getAsJsonObject()); + }; } - - // validate the optional field `assignments` (array) - for (int i = 0; i < jsonArrayassignments.size(); i++) { - IPAssignment.validateJsonObject(jsonArrayassignments.get(i).getAsJsonObject()); - }; } // validate the optional field `facility` if (jsonObj.get("facility") != null && !jsonObj.get("facility").isJsonNull()) { diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/IPReservationRequestInput.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/DefaultIPReservationCreateInput.java similarity index 81% rename from equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/IPReservationRequestInput.java rename to equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/DefaultIPReservationCreateInput.java index efda7dbc5..6e8894c43 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/IPReservationRequestInput.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/DefaultIPReservationCreateInput.java @@ -47,10 +47,10 @@ import com.equinix.openapi.JSON; /** - * IPReservationRequestInput + * DefaultIPReservationCreateInput */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class IPReservationRequestInput { +public class DefaultIPReservationCreateInput { public static final String SERIALIZED_NAME_COMMENTS = "comments"; @SerializedName(SERIALIZED_NAME_COMMENTS) private String comments; @@ -87,10 +87,10 @@ public class IPReservationRequestInput { @SerializedName(SERIALIZED_NAME_TYPE) private String type; - public IPReservationRequestInput() { + public DefaultIPReservationCreateInput() { } - public IPReservationRequestInput comments(String comments) { + public DefaultIPReservationCreateInput comments(String comments) { this.comments = comments; return this; @@ -113,7 +113,7 @@ public void setComments(String comments) { } - public IPReservationRequestInput customdata(Object customdata) { + public DefaultIPReservationCreateInput customdata(Object customdata) { this.customdata = customdata; return this; @@ -136,7 +136,7 @@ public void setCustomdata(Object customdata) { } - public IPReservationRequestInput details(String details) { + public DefaultIPReservationCreateInput details(String details) { this.details = details; return this; @@ -159,7 +159,7 @@ public void setDetails(String details) { } - public IPReservationRequestInput facility(String facility) { + public DefaultIPReservationCreateInput facility(String facility) { this.facility = facility; return this; @@ -182,7 +182,7 @@ public void setFacility(String facility) { } - public IPReservationRequestInput failOnApprovalRequired(Boolean failOnApprovalRequired) { + public DefaultIPReservationCreateInput failOnApprovalRequired(Boolean failOnApprovalRequired) { this.failOnApprovalRequired = failOnApprovalRequired; return this; @@ -205,7 +205,7 @@ public void setFailOnApprovalRequired(Boolean failOnApprovalRequired) { } - public IPReservationRequestInput metro(String metro) { + public DefaultIPReservationCreateInput metro(String metro) { this.metro = metro; return this; @@ -228,7 +228,7 @@ public void setMetro(String metro) { } - public IPReservationRequestInput quantity(Integer quantity) { + public DefaultIPReservationCreateInput quantity(Integer quantity) { this.quantity = quantity; return this; @@ -251,13 +251,13 @@ public void setQuantity(Integer quantity) { } - public IPReservationRequestInput tags(List tags) { + public DefaultIPReservationCreateInput tags(List tags) { this.tags = tags; return this; } - public IPReservationRequestInput addTagsItem(String tagsItem) { + public DefaultIPReservationCreateInput addTagsItem(String tagsItem) { if (this.tags == null) { this.tags = new ArrayList<>(); } @@ -282,7 +282,7 @@ public void setTags(List tags) { } - public IPReservationRequestInput type(String type) { + public DefaultIPReservationCreateInput type(String type) { this.type = type; return this; @@ -315,7 +315,7 @@ public void setType(String type) { * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. */ - public IPReservationRequestInput putAdditionalProperty(String key, Object value) { + public DefaultIPReservationCreateInput putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } @@ -349,17 +349,17 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - IPReservationRequestInput ipReservationRequestInput = (IPReservationRequestInput) o; - return Objects.equals(this.comments, ipReservationRequestInput.comments) && - Objects.equals(this.customdata, ipReservationRequestInput.customdata) && - Objects.equals(this.details, ipReservationRequestInput.details) && - Objects.equals(this.facility, ipReservationRequestInput.facility) && - Objects.equals(this.failOnApprovalRequired, ipReservationRequestInput.failOnApprovalRequired) && - Objects.equals(this.metro, ipReservationRequestInput.metro) && - Objects.equals(this.quantity, ipReservationRequestInput.quantity) && - Objects.equals(this.tags, ipReservationRequestInput.tags) && - Objects.equals(this.type, ipReservationRequestInput.type)&& - Objects.equals(this.additionalProperties, ipReservationRequestInput.additionalProperties); + DefaultIPReservationCreateInput defaultIPReservationCreateInput = (DefaultIPReservationCreateInput) o; + return Objects.equals(this.comments, defaultIPReservationCreateInput.comments) && + Objects.equals(this.customdata, defaultIPReservationCreateInput.customdata) && + Objects.equals(this.details, defaultIPReservationCreateInput.details) && + Objects.equals(this.facility, defaultIPReservationCreateInput.facility) && + Objects.equals(this.failOnApprovalRequired, defaultIPReservationCreateInput.failOnApprovalRequired) && + Objects.equals(this.metro, defaultIPReservationCreateInput.metro) && + Objects.equals(this.quantity, defaultIPReservationCreateInput.quantity) && + Objects.equals(this.tags, defaultIPReservationCreateInput.tags) && + Objects.equals(this.type, defaultIPReservationCreateInput.type)&& + Objects.equals(this.additionalProperties, defaultIPReservationCreateInput.additionalProperties); } @Override @@ -370,7 +370,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class IPReservationRequestInput {\n"); + sb.append("class DefaultIPReservationCreateInput {\n"); sb.append(" comments: ").append(toIndentedString(comments)).append("\n"); sb.append(" customdata: ").append(toIndentedString(customdata)).append("\n"); sb.append(" details: ").append(toIndentedString(details)).append("\n"); @@ -423,19 +423,19 @@ private String toIndentedString(Object o) { * Validates the JSON Object and throws an exception if issues found * * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to IPReservationRequestInput + * @throws IOException if the JSON Object is invalid with respect to DefaultIPReservationCreateInput */ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if (jsonObj == null) { - if (IPReservationRequestInput.openapiRequiredFields.isEmpty()) { + if (DefaultIPReservationCreateInput.openapiRequiredFields.isEmpty()) { return; } else { // has required fields - throw new IllegalArgumentException(String.format("The required field(s) %s in IPReservationRequestInput is not found in the empty JSON string", IPReservationRequestInput.openapiRequiredFields.toString())); + throw new IllegalArgumentException(String.format("The required field(s) %s in DefaultIPReservationCreateInput is not found in the empty JSON string", DefaultIPReservationCreateInput.openapiRequiredFields.toString())); } } // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : IPReservationRequestInput.openapiRequiredFields) { + for (String requiredField : DefaultIPReservationCreateInput.openapiRequiredFields) { if (jsonObj.get(requiredField) == null) { throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); } @@ -465,16 +465,16 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!IPReservationRequestInput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'IPReservationRequestInput' and its subtypes + if (!DefaultIPReservationCreateInput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DefaultIPReservationCreateInput' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(IPReservationRequestInput.class)); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DefaultIPReservationCreateInput.class)); - return (TypeAdapter) new TypeAdapter() { + return (TypeAdapter) new TypeAdapter() { @Override - public void write(JsonWriter out, IPReservationRequestInput value) throws IOException { + public void write(JsonWriter out, DefaultIPReservationCreateInput value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); obj.remove("additionalProperties"); // serialize additonal properties @@ -497,11 +497,11 @@ else if (entry.getValue() instanceof Character) } @Override - public IPReservationRequestInput read(JsonReader in) throws IOException { + public DefaultIPReservationCreateInput read(JsonReader in) throws IOException { JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); validateJsonObject(jsonObj); // store additional fields in the deserialized instance - IPReservationRequestInput instance = thisAdapter.fromJsonTree(jsonObj); + DefaultIPReservationCreateInput instance = thisAdapter.fromJsonTree(jsonObj); for (Map.Entry entry : jsonObj.entrySet()) { if (!openapiFields.contains(entry.getKey())) { if (entry.getValue().isJsonPrimitive()) { // primitive type @@ -526,18 +526,18 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } /** - * Create an instance of IPReservationRequestInput given an JSON string + * Create an instance of DefaultIPReservationCreateInput given an JSON string * * @param jsonString JSON string - * @return An instance of IPReservationRequestInput - * @throws IOException if the JSON string is invalid with respect to IPReservationRequestInput + * @return An instance of DefaultIPReservationCreateInput + * @throws IOException if the JSON string is invalid with respect to DefaultIPReservationCreateInput */ - public static IPReservationRequestInput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, IPReservationRequestInput.class); + public static DefaultIPReservationCreateInput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DefaultIPReservationCreateInput.class); } /** - * Convert an instance of IPReservationRequestInput to an JSON string + * Convert an instance of DefaultIPReservationCreateInput to an JSON string * * @return JSON string */ diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/Device.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/Device.java index 4daaf5580..d261435cb 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/Device.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/Device.java @@ -1476,17 +1476,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if ((jsonObj.get("image_url") != null && !jsonObj.get("image_url").isJsonNull()) && !jsonObj.get("image_url").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `image_url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("image_url").toString())); } - JsonArray jsonArrayipAddresses = jsonObj.getAsJsonArray("ip_addresses"); - if (jsonArrayipAddresses != null) { - // ensure the json data is an array - if (!jsonObj.get("ip_addresses").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `ip_addresses` to be an array in the JSON string but got `%s`", jsonObj.get("ip_addresses").toString())); + if (jsonObj.get("ip_addresses") != null && !jsonObj.get("ip_addresses").isJsonNull()) { + JsonArray jsonArrayipAddresses = jsonObj.getAsJsonArray("ip_addresses"); + if (jsonArrayipAddresses != null) { + // ensure the json data is an array + if (!jsonObj.get("ip_addresses").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `ip_addresses` to be an array in the JSON string but got `%s`", jsonObj.get("ip_addresses").toString())); + } + + // validate the optional field `ip_addresses` (array) + for (int i = 0; i < jsonArrayipAddresses.size(); i++) { + IPAssignment.validateJsonObject(jsonArrayipAddresses.get(i).getAsJsonObject()); + }; } - - // validate the optional field `ip_addresses` (array) - for (int i = 0; i < jsonArrayipAddresses.size(); i++) { - IPAssignment.validateJsonObject(jsonArrayipAddresses.get(i).getAsJsonObject()); - }; } if ((jsonObj.get("ipxe_script_url") != null && !jsonObj.get("ipxe_script_url").isJsonNull()) && !jsonObj.get("ipxe_script_url").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `ipxe_script_url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ipxe_script_url").toString())); @@ -1498,33 +1500,37 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if (jsonObj.get("metro") != null && !jsonObj.get("metro").isJsonNull()) { DeviceMetro.validateJsonObject(jsonObj.getAsJsonObject("metro")); } - JsonArray jsonArraynetworkPorts = jsonObj.getAsJsonArray("network_ports"); - if (jsonArraynetworkPorts != null) { - // ensure the json data is an array - if (!jsonObj.get("network_ports").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `network_ports` to be an array in the JSON string but got `%s`", jsonObj.get("network_ports").toString())); + if (jsonObj.get("network_ports") != null && !jsonObj.get("network_ports").isJsonNull()) { + JsonArray jsonArraynetworkPorts = jsonObj.getAsJsonArray("network_ports"); + if (jsonArraynetworkPorts != null) { + // ensure the json data is an array + if (!jsonObj.get("network_ports").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `network_ports` to be an array in the JSON string but got `%s`", jsonObj.get("network_ports").toString())); + } + + // validate the optional field `network_ports` (array) + for (int i = 0; i < jsonArraynetworkPorts.size(); i++) { + Port.validateJsonObject(jsonArraynetworkPorts.get(i).getAsJsonObject()); + }; } - - // validate the optional field `network_ports` (array) - for (int i = 0; i < jsonArraynetworkPorts.size(); i++) { - Port.validateJsonObject(jsonArraynetworkPorts.get(i).getAsJsonObject()); - }; } // validate the optional field `operating_system` if (jsonObj.get("operating_system") != null && !jsonObj.get("operating_system").isJsonNull()) { OperatingSystem.validateJsonObject(jsonObj.getAsJsonObject("operating_system")); } - JsonArray jsonArrayactions = jsonObj.getAsJsonArray("actions"); - if (jsonArrayactions != null) { - // ensure the json data is an array - if (!jsonObj.get("actions").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `actions` to be an array in the JSON string but got `%s`", jsonObj.get("actions").toString())); + if (jsonObj.get("actions") != null && !jsonObj.get("actions").isJsonNull()) { + JsonArray jsonArrayactions = jsonObj.getAsJsonArray("actions"); + if (jsonArrayactions != null) { + // ensure the json data is an array + if (!jsonObj.get("actions").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `actions` to be an array in the JSON string but got `%s`", jsonObj.get("actions").toString())); + } + + // validate the optional field `actions` (array) + for (int i = 0; i < jsonArrayactions.size(); i++) { + DeviceActionsInner.validateJsonObject(jsonArrayactions.get(i).getAsJsonObject()); + }; } - - // validate the optional field `actions` (array) - for (int i = 0; i < jsonArrayactions.size(); i++) { - DeviceActionsInner.validateJsonObject(jsonArrayactions.get(i).getAsJsonObject()); - }; } // validate the optional field `plan` if (jsonObj.get("plan") != null && !jsonObj.get("plan").isJsonNull()) { @@ -1538,17 +1544,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if (jsonObj.get("project_lite") != null && !jsonObj.get("project_lite").isJsonNull()) { DeviceProjectLite.validateJsonObject(jsonObj.getAsJsonObject("project_lite")); } - JsonArray jsonArrayprovisioningEvents = jsonObj.getAsJsonArray("provisioning_events"); - if (jsonArrayprovisioningEvents != null) { - // ensure the json data is an array - if (!jsonObj.get("provisioning_events").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `provisioning_events` to be an array in the JSON string but got `%s`", jsonObj.get("provisioning_events").toString())); + if (jsonObj.get("provisioning_events") != null && !jsonObj.get("provisioning_events").isJsonNull()) { + JsonArray jsonArrayprovisioningEvents = jsonObj.getAsJsonArray("provisioning_events"); + if (jsonArrayprovisioningEvents != null) { + // ensure the json data is an array + if (!jsonObj.get("provisioning_events").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `provisioning_events` to be an array in the JSON string but got `%s`", jsonObj.get("provisioning_events").toString())); + } + + // validate the optional field `provisioning_events` (array) + for (int i = 0; i < jsonArrayprovisioningEvents.size(); i++) { + Event.validateJsonObject(jsonArrayprovisioningEvents.get(i).getAsJsonObject()); + }; } - - // validate the optional field `provisioning_events` (array) - for (int i = 0; i < jsonArrayprovisioningEvents.size(); i++) { - Event.validateJsonObject(jsonArrayprovisioningEvents.get(i).getAsJsonObject()); - }; } if ((jsonObj.get("root_password") != null && !jsonObj.get("root_password").isJsonNull()) && !jsonObj.get("root_password").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `root_password` to be a primitive type in the JSON string but got `%s`", jsonObj.get("root_password").toString())); @@ -1556,17 +1564,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if ((jsonObj.get("short_id") != null && !jsonObj.get("short_id").isJsonNull()) && !jsonObj.get("short_id").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `short_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("short_id").toString())); } - JsonArray jsonArraysshKeys = jsonObj.getAsJsonArray("ssh_keys"); - if (jsonArraysshKeys != null) { - // ensure the json data is an array - if (!jsonObj.get("ssh_keys").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `ssh_keys` to be an array in the JSON string but got `%s`", jsonObj.get("ssh_keys").toString())); + if (jsonObj.get("ssh_keys") != null && !jsonObj.get("ssh_keys").isJsonNull()) { + JsonArray jsonArraysshKeys = jsonObj.getAsJsonArray("ssh_keys"); + if (jsonArraysshKeys != null) { + // ensure the json data is an array + if (!jsonObj.get("ssh_keys").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `ssh_keys` to be an array in the JSON string but got `%s`", jsonObj.get("ssh_keys").toString())); + } + + // validate the optional field `ssh_keys` (array) + for (int i = 0; i < jsonArraysshKeys.size(); i++) { + Href.validateJsonObject(jsonArraysshKeys.get(i).getAsJsonObject()); + }; } - - // validate the optional field `ssh_keys` (array) - for (int i = 0; i < jsonArraysshKeys.size(); i++) { - Href.validateJsonObject(jsonArraysshKeys.get(i).getAsJsonObject()); - }; } if ((jsonObj.get("state") != null && !jsonObj.get("state").isJsonNull()) && !jsonObj.get("state").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `state` to be a primitive type in the JSON string but got `%s`", jsonObj.get("state").toString())); @@ -1584,17 +1594,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if ((jsonObj.get("userdata") != null && !jsonObj.get("userdata").isJsonNull()) && !jsonObj.get("userdata").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `userdata` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userdata").toString())); } - JsonArray jsonArrayvolumes = jsonObj.getAsJsonArray("volumes"); - if (jsonArrayvolumes != null) { - // ensure the json data is an array - if (!jsonObj.get("volumes").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `volumes` to be an array in the JSON string but got `%s`", jsonObj.get("volumes").toString())); + if (jsonObj.get("volumes") != null && !jsonObj.get("volumes").isJsonNull()) { + JsonArray jsonArrayvolumes = jsonObj.getAsJsonArray("volumes"); + if (jsonArrayvolumes != null) { + // ensure the json data is an array + if (!jsonObj.get("volumes").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `volumes` to be an array in the JSON string but got `%s`", jsonObj.get("volumes").toString())); + } + + // validate the optional field `volumes` (array) + for (int i = 0; i < jsonArrayvolumes.size(); i++) { + Href.validateJsonObject(jsonArrayvolumes.get(i).getAsJsonObject()); + }; } - - // validate the optional field `volumes` (array) - for (int i = 0; i < jsonArrayvolumes.size(); i++) { - Href.validateJsonObject(jsonArrayvolumes.get(i).getAsJsonObject()); - }; } } diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/DeviceCreateInput.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/DeviceCreateInput.java index df268be9a..fa59753c7 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/DeviceCreateInput.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/DeviceCreateInput.java @@ -1056,17 +1056,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if ((jsonObj.get("hostname") != null && !jsonObj.get("hostname").isJsonNull()) && !jsonObj.get("hostname").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `hostname` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hostname").toString())); } - JsonArray jsonArrayipAddresses = jsonObj.getAsJsonArray("ip_addresses"); - if (jsonArrayipAddresses != null) { - // ensure the json data is an array - if (!jsonObj.get("ip_addresses").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `ip_addresses` to be an array in the JSON string but got `%s`", jsonObj.get("ip_addresses").toString())); + if (jsonObj.get("ip_addresses") != null && !jsonObj.get("ip_addresses").isJsonNull()) { + JsonArray jsonArrayipAddresses = jsonObj.getAsJsonArray("ip_addresses"); + if (jsonArrayipAddresses != null) { + // ensure the json data is an array + if (!jsonObj.get("ip_addresses").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `ip_addresses` to be an array in the JSON string but got `%s`", jsonObj.get("ip_addresses").toString())); + } + + // validate the optional field `ip_addresses` (array) + for (int i = 0; i < jsonArrayipAddresses.size(); i++) { + DeviceCreateInputIpAddressesInner.validateJsonObject(jsonArrayipAddresses.get(i).getAsJsonObject()); + }; } - - // validate the optional field `ip_addresses` (array) - for (int i = 0; i < jsonArrayipAddresses.size(); i++) { - DeviceCreateInputIpAddressesInner.validateJsonObject(jsonArrayipAddresses.get(i).getAsJsonObject()); - }; } if ((jsonObj.get("ipxe_script_url") != null && !jsonObj.get("ipxe_script_url").isJsonNull()) && !jsonObj.get("ipxe_script_url").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `ipxe_script_url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ipxe_script_url").toString())); @@ -1084,17 +1086,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if ((jsonObj.get("project_ssh_keys") != null && !jsonObj.get("project_ssh_keys").isJsonNull()) && !jsonObj.get("project_ssh_keys").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `project_ssh_keys` to be an array in the JSON string but got `%s`", jsonObj.get("project_ssh_keys").toString())); } - JsonArray jsonArraysshKeys = jsonObj.getAsJsonArray("ssh_keys"); - if (jsonArraysshKeys != null) { - // ensure the json data is an array - if (!jsonObj.get("ssh_keys").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `ssh_keys` to be an array in the JSON string but got `%s`", jsonObj.get("ssh_keys").toString())); + if (jsonObj.get("ssh_keys") != null && !jsonObj.get("ssh_keys").isJsonNull()) { + JsonArray jsonArraysshKeys = jsonObj.getAsJsonArray("ssh_keys"); + if (jsonArraysshKeys != null) { + // ensure the json data is an array + if (!jsonObj.get("ssh_keys").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `ssh_keys` to be an array in the JSON string but got `%s`", jsonObj.get("ssh_keys").toString())); + } + + // validate the optional field `ssh_keys` (array) + for (int i = 0; i < jsonArraysshKeys.size(); i++) { + SSHKeyInput.validateJsonObject(jsonArraysshKeys.get(i).getAsJsonObject()); + }; } - - // validate the optional field `ssh_keys` (array) - for (int i = 0; i < jsonArraysshKeys.size(); i++) { - SSHKeyInput.validateJsonObject(jsonArraysshKeys.get(i).getAsJsonObject()); - }; } // ensure the json data is an array if ((jsonObj.get("tags") != null && !jsonObj.get("tags").isJsonNull()) && !jsonObj.get("tags").isJsonArray()) { diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/DeviceList.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/DeviceList.java index ab10fdbdb..5ef437acc 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/DeviceList.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/DeviceList.java @@ -223,17 +223,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { throw new IllegalArgumentException(String.format("The required field(s) %s in DeviceList is not found in the empty JSON string", DeviceList.openapiRequiredFields.toString())); } } - JsonArray jsonArraydevices = jsonObj.getAsJsonArray("devices"); - if (jsonArraydevices != null) { - // ensure the json data is an array - if (!jsonObj.get("devices").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `devices` to be an array in the JSON string but got `%s`", jsonObj.get("devices").toString())); + if (jsonObj.get("devices") != null && !jsonObj.get("devices").isJsonNull()) { + JsonArray jsonArraydevices = jsonObj.getAsJsonArray("devices"); + if (jsonArraydevices != null) { + // ensure the json data is an array + if (!jsonObj.get("devices").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `devices` to be an array in the JSON string but got `%s`", jsonObj.get("devices").toString())); + } + + // validate the optional field `devices` (array) + for (int i = 0; i < jsonArraydevices.size(); i++) { + Device.validateJsonObject(jsonArraydevices.get(i).getAsJsonObject()); + }; } - - // validate the optional field `devices` (array) - for (int i = 0; i < jsonArraydevices.size(); i++) { - Device.validateJsonObject(jsonArraydevices.get(i).getAsJsonObject()); - }; } // validate the optional field `meta` if (jsonObj.get("meta") != null && !jsonObj.get("meta").isJsonNull()) { diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/DeviceUsageList.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/DeviceUsageList.java index 68a5fa189..b3ac0265a 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/DeviceUsageList.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/DeviceUsageList.java @@ -192,17 +192,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { throw new IllegalArgumentException(String.format("The required field(s) %s in DeviceUsageList is not found in the empty JSON string", DeviceUsageList.openapiRequiredFields.toString())); } } - JsonArray jsonArrayusages = jsonObj.getAsJsonArray("usages"); - if (jsonArrayusages != null) { - // ensure the json data is an array - if (!jsonObj.get("usages").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `usages` to be an array in the JSON string but got `%s`", jsonObj.get("usages").toString())); + if (jsonObj.get("usages") != null && !jsonObj.get("usages").isJsonNull()) { + JsonArray jsonArrayusages = jsonObj.getAsJsonArray("usages"); + if (jsonArrayusages != null) { + // ensure the json data is an array + if (!jsonObj.get("usages").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `usages` to be an array in the JSON string but got `%s`", jsonObj.get("usages").toString())); + } + + // validate the optional field `usages` (array) + for (int i = 0; i < jsonArrayusages.size(); i++) { + DeviceUsage.validateJsonObject(jsonArrayusages.get(i).getAsJsonObject()); + }; } - - // validate the optional field `usages` (array) - for (int i = 0; i < jsonArrayusages.size(); i++) { - DeviceUsage.validateJsonObject(jsonArrayusages.get(i).getAsJsonObject()); - }; } } diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/Event.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/Event.java index da6a4d79d..7e22e532c 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/Event.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/Event.java @@ -416,17 +416,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if ((jsonObj.get("interpolated") != null && !jsonObj.get("interpolated").isJsonNull()) && !jsonObj.get("interpolated").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `interpolated` to be a primitive type in the JSON string but got `%s`", jsonObj.get("interpolated").toString())); } - JsonArray jsonArrayrelationships = jsonObj.getAsJsonArray("relationships"); - if (jsonArrayrelationships != null) { - // ensure the json data is an array - if (!jsonObj.get("relationships").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `relationships` to be an array in the JSON string but got `%s`", jsonObj.get("relationships").toString())); + if (jsonObj.get("relationships") != null && !jsonObj.get("relationships").isJsonNull()) { + JsonArray jsonArrayrelationships = jsonObj.getAsJsonArray("relationships"); + if (jsonArrayrelationships != null) { + // ensure the json data is an array + if (!jsonObj.get("relationships").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `relationships` to be an array in the JSON string but got `%s`", jsonObj.get("relationships").toString())); + } + + // validate the optional field `relationships` (array) + for (int i = 0; i < jsonArrayrelationships.size(); i++) { + Href.validateJsonObject(jsonArrayrelationships.get(i).getAsJsonObject()); + }; } - - // validate the optional field `relationships` (array) - for (int i = 0; i < jsonArrayrelationships.size(); i++) { - Href.validateJsonObject(jsonArrayrelationships.get(i).getAsJsonObject()); - }; } if ((jsonObj.get("state") != null && !jsonObj.get("state").isJsonNull()) && !jsonObj.get("state").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `state` to be a primitive type in the JSON string but got `%s`", jsonObj.get("state").toString())); diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/EventList.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/EventList.java index 675671080..144ffdc75 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/EventList.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/EventList.java @@ -223,17 +223,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { throw new IllegalArgumentException(String.format("The required field(s) %s in EventList is not found in the empty JSON string", EventList.openapiRequiredFields.toString())); } } - JsonArray jsonArrayevents = jsonObj.getAsJsonArray("events"); - if (jsonArrayevents != null) { - // ensure the json data is an array - if (!jsonObj.get("events").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `events` to be an array in the JSON string but got `%s`", jsonObj.get("events").toString())); + if (jsonObj.get("events") != null && !jsonObj.get("events").isJsonNull()) { + JsonArray jsonArrayevents = jsonObj.getAsJsonArray("events"); + if (jsonArrayevents != null) { + // ensure the json data is an array + if (!jsonObj.get("events").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `events` to be an array in the JSON string but got `%s`", jsonObj.get("events").toString())); + } + + // validate the optional field `events` (array) + for (int i = 0; i < jsonArrayevents.size(); i++) { + Event.validateJsonObject(jsonArrayevents.get(i).getAsJsonObject()); + }; } - - // validate the optional field `events` (array) - for (int i = 0; i < jsonArrayevents.size(); i++) { - Event.validateJsonObject(jsonArrayevents.get(i).getAsJsonObject()); - }; } // validate the optional field `meta` if (jsonObj.get("meta") != null && !jsonObj.get("meta").isJsonNull()) { diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/FacilityList.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/FacilityList.java index bc4588b93..a4cac1989 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/FacilityList.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/FacilityList.java @@ -192,17 +192,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { throw new IllegalArgumentException(String.format("The required field(s) %s in FacilityList is not found in the empty JSON string", FacilityList.openapiRequiredFields.toString())); } } - JsonArray jsonArrayfacilities = jsonObj.getAsJsonArray("facilities"); - if (jsonArrayfacilities != null) { - // ensure the json data is an array - if (!jsonObj.get("facilities").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `facilities` to be an array in the JSON string but got `%s`", jsonObj.get("facilities").toString())); + if (jsonObj.get("facilities") != null && !jsonObj.get("facilities").isJsonNull()) { + JsonArray jsonArrayfacilities = jsonObj.getAsJsonArray("facilities"); + if (jsonArrayfacilities != null) { + // ensure the json data is an array + if (!jsonObj.get("facilities").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `facilities` to be an array in the JSON string but got `%s`", jsonObj.get("facilities").toString())); + } + + // validate the optional field `facilities` (array) + for (int i = 0; i < jsonArrayfacilities.size(); i++) { + Facility.validateJsonObject(jsonArrayfacilities.get(i).getAsJsonObject()); + }; } - - // validate the optional field `facilities` (array) - for (int i = 0; i < jsonArrayfacilities.size(); i++) { - Facility.validateJsonObject(jsonArrayfacilities.get(i).getAsJsonObject()); - }; } } diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/GlobalBgpRangeList.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/GlobalBgpRangeList.java index 152fe5f2b..d8193da78 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/GlobalBgpRangeList.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/GlobalBgpRangeList.java @@ -192,17 +192,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { throw new IllegalArgumentException(String.format("The required field(s) %s in GlobalBgpRangeList is not found in the empty JSON string", GlobalBgpRangeList.openapiRequiredFields.toString())); } } - JsonArray jsonArrayglobalBgpRanges = jsonObj.getAsJsonArray("global_bgp_ranges"); - if (jsonArrayglobalBgpRanges != null) { - // ensure the json data is an array - if (!jsonObj.get("global_bgp_ranges").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `global_bgp_ranges` to be an array in the JSON string but got `%s`", jsonObj.get("global_bgp_ranges").toString())); + if (jsonObj.get("global_bgp_ranges") != null && !jsonObj.get("global_bgp_ranges").isJsonNull()) { + JsonArray jsonArrayglobalBgpRanges = jsonObj.getAsJsonArray("global_bgp_ranges"); + if (jsonArrayglobalBgpRanges != null) { + // ensure the json data is an array + if (!jsonObj.get("global_bgp_ranges").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `global_bgp_ranges` to be an array in the JSON string but got `%s`", jsonObj.get("global_bgp_ranges").toString())); + } + + // validate the optional field `global_bgp_ranges` (array) + for (int i = 0; i < jsonArrayglobalBgpRanges.size(); i++) { + GlobalBgpRange.validateJsonObject(jsonArrayglobalBgpRanges.get(i).getAsJsonObject()); + }; } - - // validate the optional field `global_bgp_ranges` (array) - for (int i = 0; i < jsonArrayglobalBgpRanges.size(); i++) { - GlobalBgpRange.validateJsonObject(jsonArrayglobalBgpRanges.get(i).getAsJsonObject()); - }; } } diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/HardwareReservationList.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/HardwareReservationList.java index cbb0b5273..488dc9fad 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/HardwareReservationList.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/HardwareReservationList.java @@ -223,17 +223,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { throw new IllegalArgumentException(String.format("The required field(s) %s in HardwareReservationList is not found in the empty JSON string", HardwareReservationList.openapiRequiredFields.toString())); } } - JsonArray jsonArrayhardwareReservations = jsonObj.getAsJsonArray("hardware_reservations"); - if (jsonArrayhardwareReservations != null) { - // ensure the json data is an array - if (!jsonObj.get("hardware_reservations").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `hardware_reservations` to be an array in the JSON string but got `%s`", jsonObj.get("hardware_reservations").toString())); + if (jsonObj.get("hardware_reservations") != null && !jsonObj.get("hardware_reservations").isJsonNull()) { + JsonArray jsonArrayhardwareReservations = jsonObj.getAsJsonArray("hardware_reservations"); + if (jsonArrayhardwareReservations != null) { + // ensure the json data is an array + if (!jsonObj.get("hardware_reservations").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `hardware_reservations` to be an array in the JSON string but got `%s`", jsonObj.get("hardware_reservations").toString())); + } + + // validate the optional field `hardware_reservations` (array) + for (int i = 0; i < jsonArrayhardwareReservations.size(); i++) { + HardwareReservation.validateJsonObject(jsonArrayhardwareReservations.get(i).getAsJsonObject()); + }; } - - // validate the optional field `hardware_reservations` (array) - for (int i = 0; i < jsonArrayhardwareReservations.size(); i++) { - HardwareReservation.validateJsonObject(jsonArrayhardwareReservations.get(i).getAsJsonObject()); - }; } // validate the optional field `meta` if (jsonObj.get("meta") != null && !jsonObj.get("meta").isJsonNull()) { diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/IPAssignmentList.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/IPAssignmentList.java index 54ac61164..be7508099 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/IPAssignmentList.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/IPAssignmentList.java @@ -192,17 +192,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { throw new IllegalArgumentException(String.format("The required field(s) %s in IPAssignmentList is not found in the empty JSON string", IPAssignmentList.openapiRequiredFields.toString())); } } - JsonArray jsonArrayipAddresses = jsonObj.getAsJsonArray("ip_addresses"); - if (jsonArrayipAddresses != null) { - // ensure the json data is an array - if (!jsonObj.get("ip_addresses").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `ip_addresses` to be an array in the JSON string but got `%s`", jsonObj.get("ip_addresses").toString())); + if (jsonObj.get("ip_addresses") != null && !jsonObj.get("ip_addresses").isJsonNull()) { + JsonArray jsonArrayipAddresses = jsonObj.getAsJsonArray("ip_addresses"); + if (jsonArrayipAddresses != null) { + // ensure the json data is an array + if (!jsonObj.get("ip_addresses").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `ip_addresses` to be an array in the JSON string but got `%s`", jsonObj.get("ip_addresses").toString())); + } + + // validate the optional field `ip_addresses` (array) + for (int i = 0; i < jsonArrayipAddresses.size(); i++) { + IPAssignment.validateJsonObject(jsonArrayipAddresses.get(i).getAsJsonObject()); + }; } - - // validate the optional field `ip_addresses` (array) - for (int i = 0; i < jsonArrayipAddresses.size(); i++) { - IPAssignment.validateJsonObject(jsonArrayipAddresses.get(i).getAsJsonObject()); - }; } } diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/IPReservationList.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/IPReservationList.java index afbc9dd67..be0c12804 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/IPReservationList.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/IPReservationList.java @@ -192,17 +192,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { throw new IllegalArgumentException(String.format("The required field(s) %s in IPReservationList is not found in the empty JSON string", IPReservationList.openapiRequiredFields.toString())); } } - JsonArray jsonArrayipAddresses = jsonObj.getAsJsonArray("ip_addresses"); - if (jsonArrayipAddresses != null) { - // ensure the json data is an array - if (!jsonObj.get("ip_addresses").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `ip_addresses` to be an array in the JSON string but got `%s`", jsonObj.get("ip_addresses").toString())); + if (jsonObj.get("ip_addresses") != null && !jsonObj.get("ip_addresses").isJsonNull()) { + JsonArray jsonArrayipAddresses = jsonObj.getAsJsonArray("ip_addresses"); + if (jsonArrayipAddresses != null) { + // ensure the json data is an array + if (!jsonObj.get("ip_addresses").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `ip_addresses` to be an array in the JSON string but got `%s`", jsonObj.get("ip_addresses").toString())); + } + + // validate the optional field `ip_addresses` (array) + for (int i = 0; i < jsonArrayipAddresses.size(); i++) { + IPReservation.validateJsonObject(jsonArrayipAddresses.get(i).getAsJsonObject()); + }; } - - // validate the optional field `ip_addresses` (array) - for (int i = 0; i < jsonArrayipAddresses.size(); i++) { - IPReservation.validateJsonObject(jsonArrayipAddresses.get(i).getAsJsonObject()); - }; } } diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/InstancesBatchCreateInput.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/InstancesBatchCreateInput.java index 3517f29ef..1ab719fa5 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/InstancesBatchCreateInput.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/InstancesBatchCreateInput.java @@ -192,17 +192,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { throw new IllegalArgumentException(String.format("The required field(s) %s in InstancesBatchCreateInput is not found in the empty JSON string", InstancesBatchCreateInput.openapiRequiredFields.toString())); } } - JsonArray jsonArraybatches = jsonObj.getAsJsonArray("batches"); - if (jsonArraybatches != null) { - // ensure the json data is an array - if (!jsonObj.get("batches").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `batches` to be an array in the JSON string but got `%s`", jsonObj.get("batches").toString())); + if (jsonObj.get("batches") != null && !jsonObj.get("batches").isJsonNull()) { + JsonArray jsonArraybatches = jsonObj.getAsJsonArray("batches"); + if (jsonArraybatches != null) { + // ensure the json data is an array + if (!jsonObj.get("batches").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `batches` to be an array in the JSON string but got `%s`", jsonObj.get("batches").toString())); + } + + // validate the optional field `batches` (array) + for (int i = 0; i < jsonArraybatches.size(); i++) { + InstancesBatchCreateInputBatchesInner.validateJsonObject(jsonArraybatches.get(i).getAsJsonObject()); + }; } - - // validate the optional field `batches` (array) - for (int i = 0; i < jsonArraybatches.size(); i++) { - InstancesBatchCreateInputBatchesInner.validateJsonObject(jsonArraybatches.get(i).getAsJsonObject()); - }; } } diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/InstancesBatchCreateInputBatchesInner.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/InstancesBatchCreateInputBatchesInner.java index 4be4d22d6..24d5cc857 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/InstancesBatchCreateInputBatchesInner.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/InstancesBatchCreateInputBatchesInner.java @@ -803,17 +803,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if ((jsonObj.get("hostnames") != null && !jsonObj.get("hostnames").isJsonNull()) && !jsonObj.get("hostnames").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `hostnames` to be an array in the JSON string but got `%s`", jsonObj.get("hostnames").toString())); } - JsonArray jsonArrayipAddresses = jsonObj.getAsJsonArray("ip_addresses"); - if (jsonArrayipAddresses != null) { - // ensure the json data is an array - if (!jsonObj.get("ip_addresses").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `ip_addresses` to be an array in the JSON string but got `%s`", jsonObj.get("ip_addresses").toString())); + if (jsonObj.get("ip_addresses") != null && !jsonObj.get("ip_addresses").isJsonNull()) { + JsonArray jsonArrayipAddresses = jsonObj.getAsJsonArray("ip_addresses"); + if (jsonArrayipAddresses != null) { + // ensure the json data is an array + if (!jsonObj.get("ip_addresses").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `ip_addresses` to be an array in the JSON string but got `%s`", jsonObj.get("ip_addresses").toString())); + } + + // validate the optional field `ip_addresses` (array) + for (int i = 0; i < jsonArrayipAddresses.size(); i++) { + InstancesBatchCreateInputBatchesInnerIpAddressesInner.validateJsonObject(jsonArrayipAddresses.get(i).getAsJsonObject()); + }; } - - // validate the optional field `ip_addresses` (array) - for (int i = 0; i < jsonArrayipAddresses.size(); i++) { - InstancesBatchCreateInputBatchesInnerIpAddressesInner.validateJsonObject(jsonArrayipAddresses.get(i).getAsJsonObject()); - }; } if ((jsonObj.get("metro") != null && !jsonObj.get("metro").isJsonNull()) && !jsonObj.get("metro").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `metro` to be a primitive type in the JSON string but got `%s`", jsonObj.get("metro").toString())); diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/Interconnection.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/Interconnection.java index 905de9040..8dddc03a3 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/Interconnection.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/Interconnection.java @@ -706,32 +706,36 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if (jsonObj.get("organization") != null && !jsonObj.get("organization").isJsonNull()) { Href.validateJsonObject(jsonObj.getAsJsonObject("organization")); } - JsonArray jsonArrayports = jsonObj.getAsJsonArray("ports"); - if (jsonArrayports != null) { - // ensure the json data is an array - if (!jsonObj.get("ports").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `ports` to be an array in the JSON string but got `%s`", jsonObj.get("ports").toString())); + if (jsonObj.get("ports") != null && !jsonObj.get("ports").isJsonNull()) { + JsonArray jsonArrayports = jsonObj.getAsJsonArray("ports"); + if (jsonArrayports != null) { + // ensure the json data is an array + if (!jsonObj.get("ports").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `ports` to be an array in the JSON string but got `%s`", jsonObj.get("ports").toString())); + } + + // validate the optional field `ports` (array) + for (int i = 0; i < jsonArrayports.size(); i++) { + InterconnectionPort.validateJsonObject(jsonArrayports.get(i).getAsJsonObject()); + }; } - - // validate the optional field `ports` (array) - for (int i = 0; i < jsonArrayports.size(); i++) { - InterconnectionPort.validateJsonObject(jsonArrayports.get(i).getAsJsonObject()); - }; } if ((jsonObj.get("redundancy") != null && !jsonObj.get("redundancy").isJsonNull()) && !jsonObj.get("redundancy").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `redundancy` to be a primitive type in the JSON string but got `%s`", jsonObj.get("redundancy").toString())); } - JsonArray jsonArrayserviceTokens = jsonObj.getAsJsonArray("service_tokens"); - if (jsonArrayserviceTokens != null) { - // ensure the json data is an array - if (!jsonObj.get("service_tokens").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `service_tokens` to be an array in the JSON string but got `%s`", jsonObj.get("service_tokens").toString())); + if (jsonObj.get("service_tokens") != null && !jsonObj.get("service_tokens").isJsonNull()) { + JsonArray jsonArrayserviceTokens = jsonObj.getAsJsonArray("service_tokens"); + if (jsonArrayserviceTokens != null) { + // ensure the json data is an array + if (!jsonObj.get("service_tokens").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `service_tokens` to be an array in the JSON string but got `%s`", jsonObj.get("service_tokens").toString())); + } + + // validate the optional field `service_tokens` (array) + for (int i = 0; i < jsonArrayserviceTokens.size(); i++) { + FabricServiceToken.validateJsonObject(jsonArrayserviceTokens.get(i).getAsJsonObject()); + }; } - - // validate the optional field `service_tokens` (array) - for (int i = 0; i < jsonArrayserviceTokens.size(); i++) { - FabricServiceToken.validateJsonObject(jsonArrayserviceTokens.get(i).getAsJsonObject()); - }; } if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/InterconnectionList.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/InterconnectionList.java index 54b6bbe1e..a30c9222e 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/InterconnectionList.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/InterconnectionList.java @@ -192,17 +192,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { throw new IllegalArgumentException(String.format("The required field(s) %s in InterconnectionList is not found in the empty JSON string", InterconnectionList.openapiRequiredFields.toString())); } } - JsonArray jsonArrayinterconnections = jsonObj.getAsJsonArray("interconnections"); - if (jsonArrayinterconnections != null) { - // ensure the json data is an array - if (!jsonObj.get("interconnections").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `interconnections` to be an array in the JSON string but got `%s`", jsonObj.get("interconnections").toString())); + if (jsonObj.get("interconnections") != null && !jsonObj.get("interconnections").isJsonNull()) { + JsonArray jsonArrayinterconnections = jsonObj.getAsJsonArray("interconnections"); + if (jsonArrayinterconnections != null) { + // ensure the json data is an array + if (!jsonObj.get("interconnections").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `interconnections` to be an array in the JSON string but got `%s`", jsonObj.get("interconnections").toString())); + } + + // validate the optional field `interconnections` (array) + for (int i = 0; i < jsonArrayinterconnections.size(); i++) { + Interconnection.validateJsonObject(jsonArrayinterconnections.get(i).getAsJsonObject()); + }; } - - // validate the optional field `interconnections` (array) - for (int i = 0; i < jsonArrayinterconnections.size(); i++) { - Interconnection.validateJsonObject(jsonArrayinterconnections.get(i).getAsJsonObject()); - }; } } diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/InterconnectionPortList.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/InterconnectionPortList.java index dd94374c2..cde2a5e27 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/InterconnectionPortList.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/InterconnectionPortList.java @@ -192,17 +192,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { throw new IllegalArgumentException(String.format("The required field(s) %s in InterconnectionPortList is not found in the empty JSON string", InterconnectionPortList.openapiRequiredFields.toString())); } } - JsonArray jsonArrayports = jsonObj.getAsJsonArray("ports"); - if (jsonArrayports != null) { - // ensure the json data is an array - if (!jsonObj.get("ports").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `ports` to be an array in the JSON string but got `%s`", jsonObj.get("ports").toString())); + if (jsonObj.get("ports") != null && !jsonObj.get("ports").isJsonNull()) { + JsonArray jsonArrayports = jsonObj.getAsJsonArray("ports"); + if (jsonArrayports != null) { + // ensure the json data is an array + if (!jsonObj.get("ports").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `ports` to be an array in the JSON string but got `%s`", jsonObj.get("ports").toString())); + } + + // validate the optional field `ports` (array) + for (int i = 0; i < jsonArrayports.size(); i++) { + InterconnectionPort.validateJsonObject(jsonArrayports.get(i).getAsJsonObject()); + }; } - - // validate the optional field `ports` (array) - for (int i = 0; i < jsonArrayports.size(); i++) { - InterconnectionPort.validateJsonObject(jsonArrayports.get(i).getAsJsonObject()); - }; } } diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/InvitationList.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/InvitationList.java index 914dff6d7..1cec6d6e0 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/InvitationList.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/InvitationList.java @@ -192,17 +192,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { throw new IllegalArgumentException(String.format("The required field(s) %s in InvitationList is not found in the empty JSON string", InvitationList.openapiRequiredFields.toString())); } } - JsonArray jsonArrayinvitations = jsonObj.getAsJsonArray("invitations"); - if (jsonArrayinvitations != null) { - // ensure the json data is an array - if (!jsonObj.get("invitations").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `invitations` to be an array in the JSON string but got `%s`", jsonObj.get("invitations").toString())); + if (jsonObj.get("invitations") != null && !jsonObj.get("invitations").isJsonNull()) { + JsonArray jsonArrayinvitations = jsonObj.getAsJsonArray("invitations"); + if (jsonArrayinvitations != null) { + // ensure the json data is an array + if (!jsonObj.get("invitations").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `invitations` to be an array in the JSON string but got `%s`", jsonObj.get("invitations").toString())); + } + + // validate the optional field `invitations` (array) + for (int i = 0; i < jsonArrayinvitations.size(); i++) { + Membership.validateJsonObject(jsonArrayinvitations.get(i).getAsJsonObject()); + }; } - - // validate the optional field `invitations` (array) - for (int i = 0; i < jsonArrayinvitations.size(); i++) { - Membership.validateJsonObject(jsonArrayinvitations.get(i).getAsJsonObject()); - }; } } diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/LicenseList.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/LicenseList.java index 4bb2023ce..5fceb288a 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/LicenseList.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/LicenseList.java @@ -192,17 +192,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { throw new IllegalArgumentException(String.format("The required field(s) %s in LicenseList is not found in the empty JSON string", LicenseList.openapiRequiredFields.toString())); } } - JsonArray jsonArraylicenses = jsonObj.getAsJsonArray("licenses"); - if (jsonArraylicenses != null) { - // ensure the json data is an array - if (!jsonObj.get("licenses").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `licenses` to be an array in the JSON string but got `%s`", jsonObj.get("licenses").toString())); + if (jsonObj.get("licenses") != null && !jsonObj.get("licenses").isJsonNull()) { + JsonArray jsonArraylicenses = jsonObj.getAsJsonArray("licenses"); + if (jsonArraylicenses != null) { + // ensure the json data is an array + if (!jsonObj.get("licenses").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `licenses` to be an array in the JSON string but got `%s`", jsonObj.get("licenses").toString())); + } + + // validate the optional field `licenses` (array) + for (int i = 0; i < jsonArraylicenses.size(); i++) { + License.validateJsonObject(jsonArraylicenses.get(i).getAsJsonObject()); + }; } - - // validate the optional field `licenses` (array) - for (int i = 0; i < jsonArraylicenses.size(); i++) { - License.validateJsonObject(jsonArraylicenses.get(i).getAsJsonObject()); - }; } } diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/MembershipList.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/MembershipList.java index 7d5cb546e..e0c500e9a 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/MembershipList.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/MembershipList.java @@ -192,17 +192,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { throw new IllegalArgumentException(String.format("The required field(s) %s in MembershipList is not found in the empty JSON string", MembershipList.openapiRequiredFields.toString())); } } - JsonArray jsonArraymemberships = jsonObj.getAsJsonArray("memberships"); - if (jsonArraymemberships != null) { - // ensure the json data is an array - if (!jsonObj.get("memberships").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `memberships` to be an array in the JSON string but got `%s`", jsonObj.get("memberships").toString())); + if (jsonObj.get("memberships") != null && !jsonObj.get("memberships").isJsonNull()) { + JsonArray jsonArraymemberships = jsonObj.getAsJsonArray("memberships"); + if (jsonArraymemberships != null) { + // ensure the json data is an array + if (!jsonObj.get("memberships").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `memberships` to be an array in the JSON string but got `%s`", jsonObj.get("memberships").toString())); + } + + // validate the optional field `memberships` (array) + for (int i = 0; i < jsonArraymemberships.size(); i++) { + Membership.validateJsonObject(jsonArraymemberships.get(i).getAsJsonObject()); + }; } - - // validate the optional field `memberships` (array) - for (int i = 0; i < jsonArraymemberships.size(); i++) { - Membership.validateJsonObject(jsonArraymemberships.get(i).getAsJsonObject()); - }; } } diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/MetalGatewayInput.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/MetalGatewayCreateInput.java similarity index 84% rename from equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/MetalGatewayInput.java rename to equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/MetalGatewayCreateInput.java index 53d22fd4b..045073083 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/MetalGatewayInput.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/MetalGatewayCreateInput.java @@ -46,10 +46,10 @@ import com.equinix.openapi.JSON; /** - * MetalGatewayInput + * MetalGatewayCreateInput */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class MetalGatewayInput { +public class MetalGatewayCreateInput { public static final String SERIALIZED_NAME_IP_RESERVATION_ID = "ip_reservation_id"; @SerializedName(SERIALIZED_NAME_IP_RESERVATION_ID) private UUID ipReservationId; @@ -62,10 +62,10 @@ public class MetalGatewayInput { @SerializedName(SERIALIZED_NAME_VIRTUAL_NETWORK_ID) private UUID virtualNetworkId; - public MetalGatewayInput() { + public MetalGatewayCreateInput() { } - public MetalGatewayInput ipReservationId(UUID ipReservationId) { + public MetalGatewayCreateInput ipReservationId(UUID ipReservationId) { this.ipReservationId = ipReservationId; return this; @@ -88,7 +88,7 @@ public void setIpReservationId(UUID ipReservationId) { } - public MetalGatewayInput privateIpv4SubnetSize(Integer privateIpv4SubnetSize) { + public MetalGatewayCreateInput privateIpv4SubnetSize(Integer privateIpv4SubnetSize) { this.privateIpv4SubnetSize = privateIpv4SubnetSize; return this; @@ -111,7 +111,7 @@ public void setPrivateIpv4SubnetSize(Integer privateIpv4SubnetSize) { } - public MetalGatewayInput virtualNetworkId(UUID virtualNetworkId) { + public MetalGatewayCreateInput virtualNetworkId(UUID virtualNetworkId) { this.virtualNetworkId = virtualNetworkId; return this; @@ -144,7 +144,7 @@ public void setVirtualNetworkId(UUID virtualNetworkId) { * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. */ - public MetalGatewayInput putAdditionalProperty(String key, Object value) { + public MetalGatewayCreateInput putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } @@ -178,11 +178,11 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - MetalGatewayInput metalGatewayInput = (MetalGatewayInput) o; - return Objects.equals(this.ipReservationId, metalGatewayInput.ipReservationId) && - Objects.equals(this.privateIpv4SubnetSize, metalGatewayInput.privateIpv4SubnetSize) && - Objects.equals(this.virtualNetworkId, metalGatewayInput.virtualNetworkId)&& - Objects.equals(this.additionalProperties, metalGatewayInput.additionalProperties); + MetalGatewayCreateInput metalGatewayCreateInput = (MetalGatewayCreateInput) o; + return Objects.equals(this.ipReservationId, metalGatewayCreateInput.ipReservationId) && + Objects.equals(this.privateIpv4SubnetSize, metalGatewayCreateInput.privateIpv4SubnetSize) && + Objects.equals(this.virtualNetworkId, metalGatewayCreateInput.virtualNetworkId)&& + Objects.equals(this.additionalProperties, metalGatewayCreateInput.additionalProperties); } @Override @@ -193,7 +193,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class MetalGatewayInput {\n"); + sb.append("class MetalGatewayCreateInput {\n"); sb.append(" ipReservationId: ").append(toIndentedString(ipReservationId)).append("\n"); sb.append(" privateIpv4SubnetSize: ").append(toIndentedString(privateIpv4SubnetSize)).append("\n"); sb.append(" virtualNetworkId: ").append(toIndentedString(virtualNetworkId)).append("\n"); @@ -233,19 +233,19 @@ private String toIndentedString(Object o) { * Validates the JSON Object and throws an exception if issues found * * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to MetalGatewayInput + * @throws IOException if the JSON Object is invalid with respect to MetalGatewayCreateInput */ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if (jsonObj == null) { - if (MetalGatewayInput.openapiRequiredFields.isEmpty()) { + if (MetalGatewayCreateInput.openapiRequiredFields.isEmpty()) { return; } else { // has required fields - throw new IllegalArgumentException(String.format("The required field(s) %s in MetalGatewayInput is not found in the empty JSON string", MetalGatewayInput.openapiRequiredFields.toString())); + throw new IllegalArgumentException(String.format("The required field(s) %s in MetalGatewayCreateInput is not found in the empty JSON string", MetalGatewayCreateInput.openapiRequiredFields.toString())); } } // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : MetalGatewayInput.openapiRequiredFields) { + for (String requiredField : MetalGatewayCreateInput.openapiRequiredFields) { if (jsonObj.get(requiredField) == null) { throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); } @@ -262,16 +262,16 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!MetalGatewayInput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'MetalGatewayInput' and its subtypes + if (!MetalGatewayCreateInput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MetalGatewayCreateInput' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(MetalGatewayInput.class)); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(MetalGatewayCreateInput.class)); - return (TypeAdapter) new TypeAdapter() { + return (TypeAdapter) new TypeAdapter() { @Override - public void write(JsonWriter out, MetalGatewayInput value) throws IOException { + public void write(JsonWriter out, MetalGatewayCreateInput value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); obj.remove("additionalProperties"); // serialize additonal properties @@ -294,11 +294,11 @@ else if (entry.getValue() instanceof Character) } @Override - public MetalGatewayInput read(JsonReader in) throws IOException { + public MetalGatewayCreateInput read(JsonReader in) throws IOException { JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); validateJsonObject(jsonObj); // store additional fields in the deserialized instance - MetalGatewayInput instance = thisAdapter.fromJsonTree(jsonObj); + MetalGatewayCreateInput instance = thisAdapter.fromJsonTree(jsonObj); for (Map.Entry entry : jsonObj.entrySet()) { if (!openapiFields.contains(entry.getKey())) { if (entry.getValue().isJsonPrimitive()) { // primitive type @@ -323,18 +323,18 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } /** - * Create an instance of MetalGatewayInput given an JSON string + * Create an instance of MetalGatewayCreateInput given an JSON string * * @param jsonString JSON string - * @return An instance of MetalGatewayInput - * @throws IOException if the JSON string is invalid with respect to MetalGatewayInput + * @return An instance of MetalGatewayCreateInput + * @throws IOException if the JSON string is invalid with respect to MetalGatewayCreateInput */ - public static MetalGatewayInput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, MetalGatewayInput.class); + public static MetalGatewayCreateInput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MetalGatewayCreateInput.class); } /** - * Convert an instance of MetalGatewayInput to an JSON string + * Convert an instance of MetalGatewayCreateInput to an JSON string * * @return JSON string */ diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/MetalGatewayList.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/MetalGatewayList.java index d3e451aae..a69a92884 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/MetalGatewayList.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/MetalGatewayList.java @@ -192,17 +192,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { throw new IllegalArgumentException(String.format("The required field(s) %s in MetalGatewayList is not found in the empty JSON string", MetalGatewayList.openapiRequiredFields.toString())); } } - JsonArray jsonArraymetalGateways = jsonObj.getAsJsonArray("metal_gateways"); - if (jsonArraymetalGateways != null) { - // ensure the json data is an array - if (!jsonObj.get("metal_gateways").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `metal_gateways` to be an array in the JSON string but got `%s`", jsonObj.get("metal_gateways").toString())); + if (jsonObj.get("metal_gateways") != null && !jsonObj.get("metal_gateways").isJsonNull()) { + JsonArray jsonArraymetalGateways = jsonObj.getAsJsonArray("metal_gateways"); + if (jsonArraymetalGateways != null) { + // ensure the json data is an array + if (!jsonObj.get("metal_gateways").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `metal_gateways` to be an array in the JSON string but got `%s`", jsonObj.get("metal_gateways").toString())); + } + + // validate the optional field `metal_gateways` (array) + for (int i = 0; i < jsonArraymetalGateways.size(); i++) { + MetalGateway.validateJsonObject(jsonArraymetalGateways.get(i).getAsJsonObject()); + }; } - - // validate the optional field `metal_gateways` (array) - for (int i = 0; i < jsonArraymetalGateways.size(); i++) { - MetalGateway.validateJsonObject(jsonArraymetalGateways.get(i).getAsJsonObject()); - }; } } diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/MetroList.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/MetroList.java index 119b1de6b..8fa19899f 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/MetroList.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/MetroList.java @@ -192,17 +192,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { throw new IllegalArgumentException(String.format("The required field(s) %s in MetroList is not found in the empty JSON string", MetroList.openapiRequiredFields.toString())); } } - JsonArray jsonArraymetros = jsonObj.getAsJsonArray("metros"); - if (jsonArraymetros != null) { - // ensure the json data is an array - if (!jsonObj.get("metros").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `metros` to be an array in the JSON string but got `%s`", jsonObj.get("metros").toString())); + if (jsonObj.get("metros") != null && !jsonObj.get("metros").isJsonNull()) { + JsonArray jsonArraymetros = jsonObj.getAsJsonArray("metros"); + if (jsonArraymetros != null) { + // ensure the json data is an array + if (!jsonObj.get("metros").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `metros` to be an array in the JSON string but got `%s`", jsonObj.get("metros").toString())); + } + + // validate the optional field `metros` (array) + for (int i = 0; i < jsonArraymetros.size(); i++) { + Metro.validateJsonObject(jsonArraymetros.get(i).getAsJsonObject()); + }; } - - // validate the optional field `metros` (array) - for (int i = 0; i < jsonArraymetros.size(); i++) { - Metro.validateJsonObject(jsonArraymetros.get(i).getAsJsonObject()); - }; } } diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/OperatingSystemList.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/OperatingSystemList.java index b1bc9c87d..3c4bd8eca 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/OperatingSystemList.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/OperatingSystemList.java @@ -192,17 +192,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { throw new IllegalArgumentException(String.format("The required field(s) %s in OperatingSystemList is not found in the empty JSON string", OperatingSystemList.openapiRequiredFields.toString())); } } - JsonArray jsonArrayoperatingSystems = jsonObj.getAsJsonArray("operating_systems"); - if (jsonArrayoperatingSystems != null) { - // ensure the json data is an array - if (!jsonObj.get("operating_systems").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `operating_systems` to be an array in the JSON string but got `%s`", jsonObj.get("operating_systems").toString())); + if (jsonObj.get("operating_systems") != null && !jsonObj.get("operating_systems").isJsonNull()) { + JsonArray jsonArrayoperatingSystems = jsonObj.getAsJsonArray("operating_systems"); + if (jsonArrayoperatingSystems != null) { + // ensure the json data is an array + if (!jsonObj.get("operating_systems").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `operating_systems` to be an array in the JSON string but got `%s`", jsonObj.get("operating_systems").toString())); + } + + // validate the optional field `operating_systems` (array) + for (int i = 0; i < jsonArrayoperatingSystems.size(); i++) { + OperatingSystem.validateJsonObject(jsonArrayoperatingSystems.get(i).getAsJsonObject()); + }; } - - // validate the optional field `operating_systems` (array) - for (int i = 0; i < jsonArrayoperatingSystems.size(); i++) { - OperatingSystem.validateJsonObject(jsonArrayoperatingSystems.get(i).getAsJsonObject()); - }; } } diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/Organization.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/Organization.java index e13d9c873..19ddc6b16 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/Organization.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/Organization.java @@ -706,44 +706,50 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) && !jsonObj.get("id").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } - JsonArray jsonArraymembers = jsonObj.getAsJsonArray("members"); - if (jsonArraymembers != null) { - // ensure the json data is an array - if (!jsonObj.get("members").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `members` to be an array in the JSON string but got `%s`", jsonObj.get("members").toString())); + if (jsonObj.get("members") != null && !jsonObj.get("members").isJsonNull()) { + JsonArray jsonArraymembers = jsonObj.getAsJsonArray("members"); + if (jsonArraymembers != null) { + // ensure the json data is an array + if (!jsonObj.get("members").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `members` to be an array in the JSON string but got `%s`", jsonObj.get("members").toString())); + } + + // validate the optional field `members` (array) + for (int i = 0; i < jsonArraymembers.size(); i++) { + Href.validateJsonObject(jsonArraymembers.get(i).getAsJsonObject()); + }; } - - // validate the optional field `members` (array) - for (int i = 0; i < jsonArraymembers.size(); i++) { - Href.validateJsonObject(jsonArraymembers.get(i).getAsJsonObject()); - }; } - JsonArray jsonArraymemberships = jsonObj.getAsJsonArray("memberships"); - if (jsonArraymemberships != null) { - // ensure the json data is an array - if (!jsonObj.get("memberships").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `memberships` to be an array in the JSON string but got `%s`", jsonObj.get("memberships").toString())); + if (jsonObj.get("memberships") != null && !jsonObj.get("memberships").isJsonNull()) { + JsonArray jsonArraymemberships = jsonObj.getAsJsonArray("memberships"); + if (jsonArraymemberships != null) { + // ensure the json data is an array + if (!jsonObj.get("memberships").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `memberships` to be an array in the JSON string but got `%s`", jsonObj.get("memberships").toString())); + } + + // validate the optional field `memberships` (array) + for (int i = 0; i < jsonArraymemberships.size(); i++) { + Href.validateJsonObject(jsonArraymemberships.get(i).getAsJsonObject()); + }; } - - // validate the optional field `memberships` (array) - for (int i = 0; i < jsonArraymemberships.size(); i++) { - Href.validateJsonObject(jsonArraymemberships.get(i).getAsJsonObject()); - }; } if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); } - JsonArray jsonArrayprojects = jsonObj.getAsJsonArray("projects"); - if (jsonArrayprojects != null) { - // ensure the json data is an array - if (!jsonObj.get("projects").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `projects` to be an array in the JSON string but got `%s`", jsonObj.get("projects").toString())); + if (jsonObj.get("projects") != null && !jsonObj.get("projects").isJsonNull()) { + JsonArray jsonArrayprojects = jsonObj.getAsJsonArray("projects"); + if (jsonArrayprojects != null) { + // ensure the json data is an array + if (!jsonObj.get("projects").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `projects` to be an array in the JSON string but got `%s`", jsonObj.get("projects").toString())); + } + + // validate the optional field `projects` (array) + for (int i = 0; i < jsonArrayprojects.size(); i++) { + Href.validateJsonObject(jsonArrayprojects.get(i).getAsJsonObject()); + }; } - - // validate the optional field `projects` (array) - for (int i = 0; i < jsonArrayprojects.size(); i++) { - Href.validateJsonObject(jsonArrayprojects.get(i).getAsJsonObject()); - }; } if ((jsonObj.get("twitter") != null && !jsonObj.get("twitter").isJsonNull()) && !jsonObj.get("twitter").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `twitter` to be a primitive type in the JSON string but got `%s`", jsonObj.get("twitter").toString())); diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/OrganizationList.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/OrganizationList.java index e5539b24a..6ecc11862 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/OrganizationList.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/OrganizationList.java @@ -227,17 +227,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if (jsonObj.get("meta") != null && !jsonObj.get("meta").isJsonNull()) { Meta.validateJsonObject(jsonObj.getAsJsonObject("meta")); } - JsonArray jsonArrayorganizations = jsonObj.getAsJsonArray("organizations"); - if (jsonArrayorganizations != null) { - // ensure the json data is an array - if (!jsonObj.get("organizations").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `organizations` to be an array in the JSON string but got `%s`", jsonObj.get("organizations").toString())); + if (jsonObj.get("organizations") != null && !jsonObj.get("organizations").isJsonNull()) { + JsonArray jsonArrayorganizations = jsonObj.getAsJsonArray("organizations"); + if (jsonArrayorganizations != null) { + // ensure the json data is an array + if (!jsonObj.get("organizations").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `organizations` to be an array in the JSON string but got `%s`", jsonObj.get("organizations").toString())); + } + + // validate the optional field `organizations` (array) + for (int i = 0; i < jsonArrayorganizations.size(); i++) { + Organization.validateJsonObject(jsonArrayorganizations.get(i).getAsJsonObject()); + }; } - - // validate the optional field `organizations` (array) - for (int i = 0; i < jsonArrayorganizations.size(); i++) { - Organization.validateJsonObject(jsonArrayorganizations.get(i).getAsJsonObject()); - }; } } diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/PaymentMethod.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/PaymentMethod.java index d328719cf..708831dd1 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/PaymentMethod.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/PaymentMethod.java @@ -648,17 +648,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if (jsonObj.get("organization") != null && !jsonObj.get("organization").isJsonNull()) { Href.validateJsonObject(jsonObj.getAsJsonObject("organization")); } - JsonArray jsonArrayprojects = jsonObj.getAsJsonArray("projects"); - if (jsonArrayprojects != null) { - // ensure the json data is an array - if (!jsonObj.get("projects").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `projects` to be an array in the JSON string but got `%s`", jsonObj.get("projects").toString())); + if (jsonObj.get("projects") != null && !jsonObj.get("projects").isJsonNull()) { + JsonArray jsonArrayprojects = jsonObj.getAsJsonArray("projects"); + if (jsonArrayprojects != null) { + // ensure the json data is an array + if (!jsonObj.get("projects").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `projects` to be an array in the JSON string but got `%s`", jsonObj.get("projects").toString())); + } + + // validate the optional field `projects` (array) + for (int i = 0; i < jsonArrayprojects.size(); i++) { + Href.validateJsonObject(jsonArrayprojects.get(i).getAsJsonObject()); + }; } - - // validate the optional field `projects` (array) - for (int i = 0; i < jsonArrayprojects.size(); i++) { - Href.validateJsonObject(jsonArrayprojects.get(i).getAsJsonObject()); - }; } if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/PaymentMethodList.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/PaymentMethodList.java index a9815cd83..4fa006004 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/PaymentMethodList.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/PaymentMethodList.java @@ -192,17 +192,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { throw new IllegalArgumentException(String.format("The required field(s) %s in PaymentMethodList is not found in the empty JSON string", PaymentMethodList.openapiRequiredFields.toString())); } } - JsonArray jsonArraypaymentMethods = jsonObj.getAsJsonArray("payment_methods"); - if (jsonArraypaymentMethods != null) { - // ensure the json data is an array - if (!jsonObj.get("payment_methods").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `payment_methods` to be an array in the JSON string but got `%s`", jsonObj.get("payment_methods").toString())); + if (jsonObj.get("payment_methods") != null && !jsonObj.get("payment_methods").isJsonNull()) { + JsonArray jsonArraypaymentMethods = jsonObj.getAsJsonArray("payment_methods"); + if (jsonArraypaymentMethods != null) { + // ensure the json data is an array + if (!jsonObj.get("payment_methods").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `payment_methods` to be an array in the JSON string but got `%s`", jsonObj.get("payment_methods").toString())); + } + + // validate the optional field `payment_methods` (array) + for (int i = 0; i < jsonArraypaymentMethods.size(); i++) { + PaymentMethod.validateJsonObject(jsonArraypaymentMethods.get(i).getAsJsonObject()); + }; } - - // validate the optional field `payment_methods` (array) - for (int i = 0; i < jsonArraypaymentMethods.size(); i++) { - PaymentMethod.validateJsonObject(jsonArraypaymentMethods.get(i).getAsJsonObject()); - }; } } diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/Plan.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/Plan.java index c286845f4..4d4c5690e 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/Plan.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/Plan.java @@ -540,33 +540,37 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { throw new IllegalArgumentException(String.format("The required field(s) %s in Plan is not found in the empty JSON string", Plan.openapiRequiredFields.toString())); } } - JsonArray jsonArrayavailableIn = jsonObj.getAsJsonArray("available_in"); - if (jsonArrayavailableIn != null) { - // ensure the json data is an array - if (!jsonObj.get("available_in").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `available_in` to be an array in the JSON string but got `%s`", jsonObj.get("available_in").toString())); + if (jsonObj.get("available_in") != null && !jsonObj.get("available_in").isJsonNull()) { + JsonArray jsonArrayavailableIn = jsonObj.getAsJsonArray("available_in"); + if (jsonArrayavailableIn != null) { + // ensure the json data is an array + if (!jsonObj.get("available_in").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `available_in` to be an array in the JSON string but got `%s`", jsonObj.get("available_in").toString())); + } + + // validate the optional field `available_in` (array) + for (int i = 0; i < jsonArrayavailableIn.size(); i++) { + Href.validateJsonObject(jsonArrayavailableIn.get(i).getAsJsonObject()); + }; } - - // validate the optional field `available_in` (array) - for (int i = 0; i < jsonArrayavailableIn.size(); i++) { - Href.validateJsonObject(jsonArrayavailableIn.get(i).getAsJsonObject()); - }; } // ensure the json data is an array if ((jsonObj.get("deployment_types") != null && !jsonObj.get("deployment_types").isJsonNull()) && !jsonObj.get("deployment_types").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `deployment_types` to be an array in the JSON string but got `%s`", jsonObj.get("deployment_types").toString())); } - JsonArray jsonArrayavailableInMetros = jsonObj.getAsJsonArray("available_in_metros"); - if (jsonArrayavailableInMetros != null) { - // ensure the json data is an array - if (!jsonObj.get("available_in_metros").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `available_in_metros` to be an array in the JSON string but got `%s`", jsonObj.get("available_in_metros").toString())); + if (jsonObj.get("available_in_metros") != null && !jsonObj.get("available_in_metros").isJsonNull()) { + JsonArray jsonArrayavailableInMetros = jsonObj.getAsJsonArray("available_in_metros"); + if (jsonArrayavailableInMetros != null) { + // ensure the json data is an array + if (!jsonObj.get("available_in_metros").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `available_in_metros` to be an array in the JSON string but got `%s`", jsonObj.get("available_in_metros").toString())); + } + + // validate the optional field `available_in_metros` (array) + for (int i = 0; i < jsonArrayavailableInMetros.size(); i++) { + PlanAvailableInMetrosInner.validateJsonObject(jsonArrayavailableInMetros.get(i).getAsJsonObject()); + }; } - - // validate the optional field `available_in_metros` (array) - for (int i = 0; i < jsonArrayavailableInMetros.size(); i++) { - PlanAvailableInMetrosInner.validateJsonObject(jsonArrayavailableInMetros.get(i).getAsJsonObject()); - }; } if ((jsonObj.get("class") != null && !jsonObj.get("class").isJsonNull()) && !jsonObj.get("class").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `class` to be a primitive type in the JSON string but got `%s`", jsonObj.get("class").toString())); diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/PlanList.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/PlanList.java index 3eac0b7a3..1b879f10a 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/PlanList.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/PlanList.java @@ -192,17 +192,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { throw new IllegalArgumentException(String.format("The required field(s) %s in PlanList is not found in the empty JSON string", PlanList.openapiRequiredFields.toString())); } } - JsonArray jsonArrayplans = jsonObj.getAsJsonArray("plans"); - if (jsonArrayplans != null) { - // ensure the json data is an array - if (!jsonObj.get("plans").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `plans` to be an array in the JSON string but got `%s`", jsonObj.get("plans").toString())); + if (jsonObj.get("plans") != null && !jsonObj.get("plans").isJsonNull()) { + JsonArray jsonArrayplans = jsonObj.getAsJsonArray("plans"); + if (jsonArrayplans != null) { + // ensure the json data is an array + if (!jsonObj.get("plans").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `plans` to be an array in the JSON string but got `%s`", jsonObj.get("plans").toString())); + } + + // validate the optional field `plans` (array) + for (int i = 0; i < jsonArrayplans.size(); i++) { + Plan.validateJsonObject(jsonArrayplans.get(i).getAsJsonObject()); + }; } - - // validate the optional field `plans` (array) - for (int i = 0; i < jsonArrayplans.size(); i++) { - Plan.validateJsonObject(jsonArrayplans.get(i).getAsJsonObject()); - }; } } diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/Port.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/Port.java index 3bea77405..3553e6c59 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/Port.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/Port.java @@ -385,17 +385,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); } - JsonArray jsonArrayvirtualNetworks = jsonObj.getAsJsonArray("virtual_networks"); - if (jsonArrayvirtualNetworks != null) { - // ensure the json data is an array - if (!jsonObj.get("virtual_networks").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `virtual_networks` to be an array in the JSON string but got `%s`", jsonObj.get("virtual_networks").toString())); + if (jsonObj.get("virtual_networks") != null && !jsonObj.get("virtual_networks").isJsonNull()) { + JsonArray jsonArrayvirtualNetworks = jsonObj.getAsJsonArray("virtual_networks"); + if (jsonArrayvirtualNetworks != null) { + // ensure the json data is an array + if (!jsonObj.get("virtual_networks").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `virtual_networks` to be an array in the JSON string but got `%s`", jsonObj.get("virtual_networks").toString())); + } + + // validate the optional field `virtual_networks` (array) + for (int i = 0; i < jsonArrayvirtualNetworks.size(); i++) { + Href.validateJsonObject(jsonArrayvirtualNetworks.get(i).getAsJsonObject()); + }; } - - // validate the optional field `virtual_networks` (array) - for (int i = 0; i < jsonArrayvirtualNetworks.size(); i++) { - Href.validateJsonObject(jsonArrayvirtualNetworks.get(i).getAsJsonObject()); - }; } } diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/PortConvertLayer3Input.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/PortConvertLayer3Input.java index 9cf45de03..cc938c525 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/PortConvertLayer3Input.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/PortConvertLayer3Input.java @@ -192,17 +192,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { throw new IllegalArgumentException(String.format("The required field(s) %s in PortConvertLayer3Input is not found in the empty JSON string", PortConvertLayer3Input.openapiRequiredFields.toString())); } } - JsonArray jsonArrayrequestIps = jsonObj.getAsJsonArray("request_ips"); - if (jsonArrayrequestIps != null) { - // ensure the json data is an array - if (!jsonObj.get("request_ips").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `request_ips` to be an array in the JSON string but got `%s`", jsonObj.get("request_ips").toString())); + if (jsonObj.get("request_ips") != null && !jsonObj.get("request_ips").isJsonNull()) { + JsonArray jsonArrayrequestIps = jsonObj.getAsJsonArray("request_ips"); + if (jsonArrayrequestIps != null) { + // ensure the json data is an array + if (!jsonObj.get("request_ips").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `request_ips` to be an array in the JSON string but got `%s`", jsonObj.get("request_ips").toString())); + } + + // validate the optional field `request_ips` (array) + for (int i = 0; i < jsonArrayrequestIps.size(); i++) { + PortConvertLayer3InputRequestIpsInner.validateJsonObject(jsonArrayrequestIps.get(i).getAsJsonObject()); + }; } - - // validate the optional field `request_ips` (array) - for (int i = 0; i < jsonArrayrequestIps.size(); i++) { - PortConvertLayer3InputRequestIpsInner.validateJsonObject(jsonArrayrequestIps.get(i).getAsJsonObject()); - }; } } diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/PortVlanAssignmentBatch.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/PortVlanAssignmentBatch.java index 1db312859..db6919aa5 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/PortVlanAssignmentBatch.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/PortVlanAssignmentBatch.java @@ -478,17 +478,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if ((jsonObj.get("state") != null && !jsonObj.get("state").isJsonNull()) && !jsonObj.get("state").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `state` to be a primitive type in the JSON string but got `%s`", jsonObj.get("state").toString())); } - JsonArray jsonArrayvlanAssignments = jsonObj.getAsJsonArray("vlan_assignments"); - if (jsonArrayvlanAssignments != null) { - // ensure the json data is an array - if (!jsonObj.get("vlan_assignments").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `vlan_assignments` to be an array in the JSON string but got `%s`", jsonObj.get("vlan_assignments").toString())); + if (jsonObj.get("vlan_assignments") != null && !jsonObj.get("vlan_assignments").isJsonNull()) { + JsonArray jsonArrayvlanAssignments = jsonObj.getAsJsonArray("vlan_assignments"); + if (jsonArrayvlanAssignments != null) { + // ensure the json data is an array + if (!jsonObj.get("vlan_assignments").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `vlan_assignments` to be an array in the JSON string but got `%s`", jsonObj.get("vlan_assignments").toString())); + } + + // validate the optional field `vlan_assignments` (array) + for (int i = 0; i < jsonArrayvlanAssignments.size(); i++) { + PortVlanAssignmentBatchVlanAssignmentsInner.validateJsonObject(jsonArrayvlanAssignments.get(i).getAsJsonObject()); + }; } - - // validate the optional field `vlan_assignments` (array) - for (int i = 0; i < jsonArrayvlanAssignments.size(); i++) { - PortVlanAssignmentBatchVlanAssignmentsInner.validateJsonObject(jsonArrayvlanAssignments.get(i).getAsJsonObject()); - }; } } diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/PortVlanAssignmentBatchCreateInput.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/PortVlanAssignmentBatchCreateInput.java index 821b97844..265e740c5 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/PortVlanAssignmentBatchCreateInput.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/PortVlanAssignmentBatchCreateInput.java @@ -192,17 +192,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { throw new IllegalArgumentException(String.format("The required field(s) %s in PortVlanAssignmentBatchCreateInput is not found in the empty JSON string", PortVlanAssignmentBatchCreateInput.openapiRequiredFields.toString())); } } - JsonArray jsonArrayvlanAssignments = jsonObj.getAsJsonArray("vlan_assignments"); - if (jsonArrayvlanAssignments != null) { - // ensure the json data is an array - if (!jsonObj.get("vlan_assignments").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `vlan_assignments` to be an array in the JSON string but got `%s`", jsonObj.get("vlan_assignments").toString())); + if (jsonObj.get("vlan_assignments") != null && !jsonObj.get("vlan_assignments").isJsonNull()) { + JsonArray jsonArrayvlanAssignments = jsonObj.getAsJsonArray("vlan_assignments"); + if (jsonArrayvlanAssignments != null) { + // ensure the json data is an array + if (!jsonObj.get("vlan_assignments").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `vlan_assignments` to be an array in the JSON string but got `%s`", jsonObj.get("vlan_assignments").toString())); + } + + // validate the optional field `vlan_assignments` (array) + for (int i = 0; i < jsonArrayvlanAssignments.size(); i++) { + PortVlanAssignmentBatchCreateInputVlanAssignmentsInner.validateJsonObject(jsonArrayvlanAssignments.get(i).getAsJsonObject()); + }; } - - // validate the optional field `vlan_assignments` (array) - for (int i = 0; i < jsonArrayvlanAssignments.size(); i++) { - PortVlanAssignmentBatchCreateInputVlanAssignmentsInner.validateJsonObject(jsonArrayvlanAssignments.get(i).getAsJsonObject()); - }; } } diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/PortVlanAssignmentBatchList.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/PortVlanAssignmentBatchList.java index 555b56520..21350541b 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/PortVlanAssignmentBatchList.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/PortVlanAssignmentBatchList.java @@ -192,17 +192,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { throw new IllegalArgumentException(String.format("The required field(s) %s in PortVlanAssignmentBatchList is not found in the empty JSON string", PortVlanAssignmentBatchList.openapiRequiredFields.toString())); } } - JsonArray jsonArraybatches = jsonObj.getAsJsonArray("batches"); - if (jsonArraybatches != null) { - // ensure the json data is an array - if (!jsonObj.get("batches").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `batches` to be an array in the JSON string but got `%s`", jsonObj.get("batches").toString())); + if (jsonObj.get("batches") != null && !jsonObj.get("batches").isJsonNull()) { + JsonArray jsonArraybatches = jsonObj.getAsJsonArray("batches"); + if (jsonArraybatches != null) { + // ensure the json data is an array + if (!jsonObj.get("batches").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `batches` to be an array in the JSON string but got `%s`", jsonObj.get("batches").toString())); + } + + // validate the optional field `batches` (array) + for (int i = 0; i < jsonArraybatches.size(); i++) { + PortVlanAssignmentBatch.validateJsonObject(jsonArraybatches.get(i).getAsJsonObject()); + }; } - - // validate the optional field `batches` (array) - for (int i = 0; i < jsonArraybatches.size(); i++) { - PortVlanAssignmentBatch.validateJsonObject(jsonArraybatches.get(i).getAsJsonObject()); - }; } } diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/PortVlanAssignmentList.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/PortVlanAssignmentList.java index 225fb1c89..8f789f281 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/PortVlanAssignmentList.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/PortVlanAssignmentList.java @@ -192,17 +192,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { throw new IllegalArgumentException(String.format("The required field(s) %s in PortVlanAssignmentList is not found in the empty JSON string", PortVlanAssignmentList.openapiRequiredFields.toString())); } } - JsonArray jsonArrayvlanAssignments = jsonObj.getAsJsonArray("vlan_assignments"); - if (jsonArrayvlanAssignments != null) { - // ensure the json data is an array - if (!jsonObj.get("vlan_assignments").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `vlan_assignments` to be an array in the JSON string but got `%s`", jsonObj.get("vlan_assignments").toString())); + if (jsonObj.get("vlan_assignments") != null && !jsonObj.get("vlan_assignments").isJsonNull()) { + JsonArray jsonArrayvlanAssignments = jsonObj.getAsJsonArray("vlan_assignments"); + if (jsonArrayvlanAssignments != null) { + // ensure the json data is an array + if (!jsonObj.get("vlan_assignments").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `vlan_assignments` to be an array in the JSON string but got `%s`", jsonObj.get("vlan_assignments").toString())); + } + + // validate the optional field `vlan_assignments` (array) + for (int i = 0; i < jsonArrayvlanAssignments.size(); i++) { + PortVlanAssignment.validateJsonObject(jsonArrayvlanAssignments.get(i).getAsJsonObject()); + }; } - - // validate the optional field `vlan_assignments` (array) - for (int i = 0; i < jsonArrayvlanAssignments.size(); i++) { - PortVlanAssignment.validateJsonObject(jsonArrayvlanAssignments.get(i).getAsJsonObject()); - }; } } diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/Project.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/Project.java index 760347603..890327f9b 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/Project.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/Project.java @@ -658,56 +658,64 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if (jsonObj.get("bgp_config") != null && !jsonObj.get("bgp_config").isJsonNull()) { Href.validateJsonObject(jsonObj.getAsJsonObject("bgp_config")); } - JsonArray jsonArraydevices = jsonObj.getAsJsonArray("devices"); - if (jsonArraydevices != null) { - // ensure the json data is an array - if (!jsonObj.get("devices").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `devices` to be an array in the JSON string but got `%s`", jsonObj.get("devices").toString())); + if (jsonObj.get("devices") != null && !jsonObj.get("devices").isJsonNull()) { + JsonArray jsonArraydevices = jsonObj.getAsJsonArray("devices"); + if (jsonArraydevices != null) { + // ensure the json data is an array + if (!jsonObj.get("devices").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `devices` to be an array in the JSON string but got `%s`", jsonObj.get("devices").toString())); + } + + // validate the optional field `devices` (array) + for (int i = 0; i < jsonArraydevices.size(); i++) { + Href.validateJsonObject(jsonArraydevices.get(i).getAsJsonObject()); + }; } - - // validate the optional field `devices` (array) - for (int i = 0; i < jsonArraydevices.size(); i++) { - Href.validateJsonObject(jsonArraydevices.get(i).getAsJsonObject()); - }; } if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) && !jsonObj.get("id").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } - JsonArray jsonArrayinvitations = jsonObj.getAsJsonArray("invitations"); - if (jsonArrayinvitations != null) { - // ensure the json data is an array - if (!jsonObj.get("invitations").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `invitations` to be an array in the JSON string but got `%s`", jsonObj.get("invitations").toString())); + if (jsonObj.get("invitations") != null && !jsonObj.get("invitations").isJsonNull()) { + JsonArray jsonArrayinvitations = jsonObj.getAsJsonArray("invitations"); + if (jsonArrayinvitations != null) { + // ensure the json data is an array + if (!jsonObj.get("invitations").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `invitations` to be an array in the JSON string but got `%s`", jsonObj.get("invitations").toString())); + } + + // validate the optional field `invitations` (array) + for (int i = 0; i < jsonArrayinvitations.size(); i++) { + Href.validateJsonObject(jsonArrayinvitations.get(i).getAsJsonObject()); + }; } - - // validate the optional field `invitations` (array) - for (int i = 0; i < jsonArrayinvitations.size(); i++) { - Href.validateJsonObject(jsonArrayinvitations.get(i).getAsJsonObject()); - }; } - JsonArray jsonArraymembers = jsonObj.getAsJsonArray("members"); - if (jsonArraymembers != null) { - // ensure the json data is an array - if (!jsonObj.get("members").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `members` to be an array in the JSON string but got `%s`", jsonObj.get("members").toString())); + if (jsonObj.get("members") != null && !jsonObj.get("members").isJsonNull()) { + JsonArray jsonArraymembers = jsonObj.getAsJsonArray("members"); + if (jsonArraymembers != null) { + // ensure the json data is an array + if (!jsonObj.get("members").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `members` to be an array in the JSON string but got `%s`", jsonObj.get("members").toString())); + } + + // validate the optional field `members` (array) + for (int i = 0; i < jsonArraymembers.size(); i++) { + Href.validateJsonObject(jsonArraymembers.get(i).getAsJsonObject()); + }; } - - // validate the optional field `members` (array) - for (int i = 0; i < jsonArraymembers.size(); i++) { - Href.validateJsonObject(jsonArraymembers.get(i).getAsJsonObject()); - }; } - JsonArray jsonArraymemberships = jsonObj.getAsJsonArray("memberships"); - if (jsonArraymemberships != null) { - // ensure the json data is an array - if (!jsonObj.get("memberships").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `memberships` to be an array in the JSON string but got `%s`", jsonObj.get("memberships").toString())); + if (jsonObj.get("memberships") != null && !jsonObj.get("memberships").isJsonNull()) { + JsonArray jsonArraymemberships = jsonObj.getAsJsonArray("memberships"); + if (jsonArraymemberships != null) { + // ensure the json data is an array + if (!jsonObj.get("memberships").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `memberships` to be an array in the JSON string but got `%s`", jsonObj.get("memberships").toString())); + } + + // validate the optional field `memberships` (array) + for (int i = 0; i < jsonArraymemberships.size(); i++) { + Href.validateJsonObject(jsonArraymemberships.get(i).getAsJsonObject()); + }; } - - // validate the optional field `memberships` (array) - for (int i = 0; i < jsonArraymemberships.size(); i++) { - Href.validateJsonObject(jsonArraymemberships.get(i).getAsJsonObject()); - }; } if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); @@ -716,29 +724,33 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if (jsonObj.get("payment_method") != null && !jsonObj.get("payment_method").isJsonNull()) { Href.validateJsonObject(jsonObj.getAsJsonObject("payment_method")); } - JsonArray jsonArraysshKeys = jsonObj.getAsJsonArray("ssh_keys"); - if (jsonArraysshKeys != null) { - // ensure the json data is an array - if (!jsonObj.get("ssh_keys").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `ssh_keys` to be an array in the JSON string but got `%s`", jsonObj.get("ssh_keys").toString())); + if (jsonObj.get("ssh_keys") != null && !jsonObj.get("ssh_keys").isJsonNull()) { + JsonArray jsonArraysshKeys = jsonObj.getAsJsonArray("ssh_keys"); + if (jsonArraysshKeys != null) { + // ensure the json data is an array + if (!jsonObj.get("ssh_keys").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `ssh_keys` to be an array in the JSON string but got `%s`", jsonObj.get("ssh_keys").toString())); + } + + // validate the optional field `ssh_keys` (array) + for (int i = 0; i < jsonArraysshKeys.size(); i++) { + Href.validateJsonObject(jsonArraysshKeys.get(i).getAsJsonObject()); + }; } - - // validate the optional field `ssh_keys` (array) - for (int i = 0; i < jsonArraysshKeys.size(); i++) { - Href.validateJsonObject(jsonArraysshKeys.get(i).getAsJsonObject()); - }; } - JsonArray jsonArrayvolumes = jsonObj.getAsJsonArray("volumes"); - if (jsonArrayvolumes != null) { - // ensure the json data is an array - if (!jsonObj.get("volumes").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `volumes` to be an array in the JSON string but got `%s`", jsonObj.get("volumes").toString())); + if (jsonObj.get("volumes") != null && !jsonObj.get("volumes").isJsonNull()) { + JsonArray jsonArrayvolumes = jsonObj.getAsJsonArray("volumes"); + if (jsonArrayvolumes != null) { + // ensure the json data is an array + if (!jsonObj.get("volumes").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `volumes` to be an array in the JSON string but got `%s`", jsonObj.get("volumes").toString())); + } + + // validate the optional field `volumes` (array) + for (int i = 0; i < jsonArrayvolumes.size(); i++) { + Href.validateJsonObject(jsonArrayvolumes.get(i).getAsJsonObject()); + }; } - - // validate the optional field `volumes` (array) - for (int i = 0; i < jsonArrayvolumes.size(); i++) { - Href.validateJsonObject(jsonArrayvolumes.get(i).getAsJsonObject()); - }; } } diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/ProjectList.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/ProjectList.java index e714843f9..3309bd7a6 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/ProjectList.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/ProjectList.java @@ -227,17 +227,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if (jsonObj.get("meta") != null && !jsonObj.get("meta").isJsonNull()) { Meta.validateJsonObject(jsonObj.getAsJsonObject("meta")); } - JsonArray jsonArrayprojects = jsonObj.getAsJsonArray("projects"); - if (jsonArrayprojects != null) { - // ensure the json data is an array - if (!jsonObj.get("projects").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `projects` to be an array in the JSON string but got `%s`", jsonObj.get("projects").toString())); + if (jsonObj.get("projects") != null && !jsonObj.get("projects").isJsonNull()) { + JsonArray jsonArrayprojects = jsonObj.getAsJsonArray("projects"); + if (jsonArrayprojects != null) { + // ensure the json data is an array + if (!jsonObj.get("projects").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `projects` to be an array in the JSON string but got `%s`", jsonObj.get("projects").toString())); + } + + // validate the optional field `projects` (array) + for (int i = 0; i < jsonArrayprojects.size(); i++) { + Project.validateJsonObject(jsonArrayprojects.get(i).getAsJsonObject()); + }; } - - // validate the optional field `projects` (array) - for (int i = 0; i < jsonArrayprojects.size(); i++) { - Project.validateJsonObject(jsonArrayprojects.get(i).getAsJsonObject()); - }; } } diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/ProjectUsageList.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/ProjectUsageList.java index a12bb3af6..127bfef85 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/ProjectUsageList.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/ProjectUsageList.java @@ -192,17 +192,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { throw new IllegalArgumentException(String.format("The required field(s) %s in ProjectUsageList is not found in the empty JSON string", ProjectUsageList.openapiRequiredFields.toString())); } } - JsonArray jsonArrayusages = jsonObj.getAsJsonArray("usages"); - if (jsonArrayusages != null) { - // ensure the json data is an array - if (!jsonObj.get("usages").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `usages` to be an array in the JSON string but got `%s`", jsonObj.get("usages").toString())); + if (jsonObj.get("usages") != null && !jsonObj.get("usages").isJsonNull()) { + JsonArray jsonArrayusages = jsonObj.getAsJsonArray("usages"); + if (jsonArrayusages != null) { + // ensure the json data is an array + if (!jsonObj.get("usages").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `usages` to be an array in the JSON string but got `%s`", jsonObj.get("usages").toString())); + } + + // validate the optional field `usages` (array) + for (int i = 0; i < jsonArrayusages.size(); i++) { + ProjectUsage.validateJsonObject(jsonArrayusages.get(i).getAsJsonObject()); + }; } - - // validate the optional field `usages` (array) - for (int i = 0; i < jsonArrayusages.size(); i++) { - ProjectUsage.validateJsonObject(jsonArrayusages.get(i).getAsJsonObject()); - }; } } diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/RequestIPReservationRequest.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/RequestIPReservationRequest.java index fe42edb6a..0682b5c2d 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/RequestIPReservationRequest.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/RequestIPReservationRequest.java @@ -15,7 +15,7 @@ import java.util.Objects; import java.util.Arrays; -import com.equinix.openapi.metal.v1.model.IPReservationRequestInput; +import com.equinix.openapi.metal.v1.model.DefaultIPReservationCreateInput; import com.equinix.openapi.metal.v1.model.VrfIPReservationCreateInput; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; @@ -74,7 +74,7 @@ public TypeAdapter create(Gson gson, TypeToken type) { return null; // this class only serializes 'RequestIPReservationRequest' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter adapterIPReservationRequestInput = gson.getDelegateAdapter(this, TypeToken.get(IPReservationRequestInput.class)); + final TypeAdapter adapterDefaultIPReservationCreateInput = gson.getDelegateAdapter(this, TypeToken.get(DefaultIPReservationCreateInput.class)); final TypeAdapter adapterVrfIPReservationCreateInput = gson.getDelegateAdapter(this, TypeToken.get(VrfIPReservationCreateInput.class)); return (TypeAdapter) new TypeAdapter() { @@ -85,9 +85,9 @@ public void write(JsonWriter out, RequestIPReservationRequest value) throws IOEx return; } - // check if the actual instance is of the type `IPReservationRequestInput` - if (value.getActualInstance() instanceof IPReservationRequestInput) { - JsonObject obj = adapterIPReservationRequestInput.toJsonTree((IPReservationRequestInput)value.getActualInstance()).getAsJsonObject(); + // check if the actual instance is of the type `DefaultIPReservationCreateInput` + if (value.getActualInstance() instanceof DefaultIPReservationCreateInput) { + JsonObject obj = adapterDefaultIPReservationCreateInput.toJsonTree((DefaultIPReservationCreateInput)value.getActualInstance()).getAsJsonObject(); elementAdapter.write(out, obj); return; } @@ -99,7 +99,7 @@ public void write(JsonWriter out, RequestIPReservationRequest value) throws IOEx return; } - throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: IPReservationRequestInput, VrfIPReservationCreateInput"); + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: DefaultIPReservationCreateInput, VrfIPReservationCreateInput"); } @Override @@ -111,17 +111,17 @@ public RequestIPReservationRequest read(JsonReader in) throws IOException { ArrayList errorMessages = new ArrayList<>(); TypeAdapter actualAdapter = elementAdapter; - // deserialize IPReservationRequestInput + // deserialize DefaultIPReservationCreateInput try { // validate the JSON object to see if any exception is thrown - IPReservationRequestInput.validateJsonObject(jsonObject); - actualAdapter = adapterIPReservationRequestInput; + DefaultIPReservationCreateInput.validateJsonObject(jsonObject); + actualAdapter = adapterDefaultIPReservationCreateInput; match++; - log.log(Level.FINER, "Input data matches schema 'IPReservationRequestInput'"); + log.log(Level.FINER, "Input data matches schema 'DefaultIPReservationCreateInput'"); } catch (Exception e) { // deserialization failed, continue - errorMessages.add(String.format("Deserialization for IPReservationRequestInput failed with `%s`.", e.getMessage())); - log.log(Level.FINER, "Input data does not match schema 'IPReservationRequestInput'", e); + errorMessages.add(String.format("Deserialization for DefaultIPReservationCreateInput failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'DefaultIPReservationCreateInput'", e); } // deserialize VrfIPReservationCreateInput @@ -156,7 +156,7 @@ public RequestIPReservationRequest() { super("oneOf", Boolean.FALSE); } - public RequestIPReservationRequest(IPReservationRequestInput o) { + public RequestIPReservationRequest(DefaultIPReservationCreateInput o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } @@ -167,7 +167,7 @@ public RequestIPReservationRequest(VrfIPReservationCreateInput o) { } static { - schemas.put("IPReservationRequestInput", new GenericType() { + schemas.put("DefaultIPReservationCreateInput", new GenericType() { }); schemas.put("VrfIPReservationCreateInput", new GenericType() { }); @@ -181,14 +181,14 @@ public Map getSchemas() { /** * Set the instance that matches the oneOf child schema, check * the instance parameter is valid against the oneOf child schemas: - * IPReservationRequestInput, VrfIPReservationCreateInput + * DefaultIPReservationCreateInput, VrfIPReservationCreateInput * * It could be an instance of the 'oneOf' schemas. * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). */ @Override public void setActualInstance(Object instance) { - if (instance instanceof IPReservationRequestInput) { + if (instance instanceof DefaultIPReservationCreateInput) { super.setActualInstance(instance); return; } @@ -198,14 +198,14 @@ public void setActualInstance(Object instance) { return; } - throw new RuntimeException("Invalid instance type. Must be IPReservationRequestInput, VrfIPReservationCreateInput"); + throw new RuntimeException("Invalid instance type. Must be DefaultIPReservationCreateInput, VrfIPReservationCreateInput"); } /** * Get the actual instance, which can be the following: - * IPReservationRequestInput, VrfIPReservationCreateInput + * DefaultIPReservationCreateInput, VrfIPReservationCreateInput * - * @return The actual instance (IPReservationRequestInput, VrfIPReservationCreateInput) + * @return The actual instance (DefaultIPReservationCreateInput, VrfIPReservationCreateInput) */ @Override public Object getActualInstance() { @@ -213,14 +213,14 @@ public Object getActualInstance() { } /** - * Get the actual instance of `IPReservationRequestInput`. If the actual instance is not `IPReservationRequestInput`, + * Get the actual instance of `DefaultIPReservationCreateInput`. If the actual instance is not `DefaultIPReservationCreateInput`, * the ClassCastException will be thrown. * - * @return The actual instance of `IPReservationRequestInput` - * @throws ClassCastException if the instance is not `IPReservationRequestInput` + * @return The actual instance of `DefaultIPReservationCreateInput` + * @throws ClassCastException if the instance is not `DefaultIPReservationCreateInput` */ - public IPReservationRequestInput getIPReservationRequestInput() throws ClassCastException { - return (IPReservationRequestInput)super.getActualInstance(); + public DefaultIPReservationCreateInput getDefaultIPReservationCreateInput() throws ClassCastException { + return (DefaultIPReservationCreateInput)super.getActualInstance(); } /** @@ -245,12 +245,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate oneOf schemas one by one int validCount = 0; ArrayList errorMessages = new ArrayList<>(); - // validate the json string with IPReservationRequestInput + // validate the json string with DefaultIPReservationCreateInput try { - IPReservationRequestInput.validateJsonObject(jsonObj); + DefaultIPReservationCreateInput.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { - errorMessages.add(String.format("Deserialization for IPReservationRequestInput failed with `%s`.", e.getMessage())); + errorMessages.add(String.format("Deserialization for DefaultIPReservationCreateInput failed with `%s`.", e.getMessage())); // continue to the next one } // validate the json string with VrfIPReservationCreateInput @@ -262,7 +262,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // continue to the next one } if (validCount != 1) { - throw new IOException(String.format("The JSON string is invalid for RequestIPReservationRequest with oneOf schemas: IPReservationRequestInput, VrfIPReservationCreateInput. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); + throw new IOException(String.format("The JSON string is invalid for RequestIPReservationRequest with oneOf schemas: DefaultIPReservationCreateInput, VrfIPReservationCreateInput. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); } } diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/SSHKeyList.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/SSHKeyList.java index 4e9d34d1e..a2f4e37ea 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/SSHKeyList.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/SSHKeyList.java @@ -192,17 +192,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { throw new IllegalArgumentException(String.format("The required field(s) %s in SSHKeyList is not found in the empty JSON string", SSHKeyList.openapiRequiredFields.toString())); } } - JsonArray jsonArraysshKeys = jsonObj.getAsJsonArray("ssh_keys"); - if (jsonArraysshKeys != null) { - // ensure the json data is an array - if (!jsonObj.get("ssh_keys").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `ssh_keys` to be an array in the JSON string but got `%s`", jsonObj.get("ssh_keys").toString())); + if (jsonObj.get("ssh_keys") != null && !jsonObj.get("ssh_keys").isJsonNull()) { + JsonArray jsonArraysshKeys = jsonObj.getAsJsonArray("ssh_keys"); + if (jsonArraysshKeys != null) { + // ensure the json data is an array + if (!jsonObj.get("ssh_keys").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `ssh_keys` to be an array in the JSON string but got `%s`", jsonObj.get("ssh_keys").toString())); + } + + // validate the optional field `ssh_keys` (array) + for (int i = 0; i < jsonArraysshKeys.size(); i++) { + SSHKey.validateJsonObject(jsonArraysshKeys.get(i).getAsJsonObject()); + }; } - - // validate the optional field `ssh_keys` (array) - for (int i = 0; i < jsonArraysshKeys.size(); i++) { - SSHKey.validateJsonObject(jsonArraysshKeys.get(i).getAsJsonObject()); - }; } } diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/SelfServiceReservationList.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/SelfServiceReservationList.java index c65526aca..dad53fb2b 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/SelfServiceReservationList.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/SelfServiceReservationList.java @@ -192,17 +192,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { throw new IllegalArgumentException(String.format("The required field(s) %s in SelfServiceReservationList is not found in the empty JSON string", SelfServiceReservationList.openapiRequiredFields.toString())); } } - JsonArray jsonArrayreservations = jsonObj.getAsJsonArray("reservations"); - if (jsonArrayreservations != null) { - // ensure the json data is an array - if (!jsonObj.get("reservations").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `reservations` to be an array in the JSON string but got `%s`", jsonObj.get("reservations").toString())); + if (jsonObj.get("reservations") != null && !jsonObj.get("reservations").isJsonNull()) { + JsonArray jsonArrayreservations = jsonObj.getAsJsonArray("reservations"); + if (jsonArrayreservations != null) { + // ensure the json data is an array + if (!jsonObj.get("reservations").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `reservations` to be an array in the JSON string but got `%s`", jsonObj.get("reservations").toString())); + } + + // validate the optional field `reservations` (array) + for (int i = 0; i < jsonArrayreservations.size(); i++) { + SelfServiceReservationResponse.validateJsonObject(jsonArrayreservations.get(i).getAsJsonObject()); + }; } - - // validate the optional field `reservations` (array) - for (int i = 0; i < jsonArrayreservations.size(); i++) { - SelfServiceReservationResponse.validateJsonObject(jsonArrayreservations.get(i).getAsJsonObject()); - }; } } diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/SelfServiceReservationResponse.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/SelfServiceReservationResponse.java index bb766cd90..4188acdcf 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/SelfServiceReservationResponse.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/SelfServiceReservationResponse.java @@ -495,17 +495,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { throw new IllegalArgumentException(String.format("The required field(s) %s in SelfServiceReservationResponse is not found in the empty JSON string", SelfServiceReservationResponse.openapiRequiredFields.toString())); } } - JsonArray jsonArrayitem = jsonObj.getAsJsonArray("item"); - if (jsonArrayitem != null) { - // ensure the json data is an array - if (!jsonObj.get("item").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `item` to be an array in the JSON string but got `%s`", jsonObj.get("item").toString())); + if (jsonObj.get("item") != null && !jsonObj.get("item").isJsonNull()) { + JsonArray jsonArrayitem = jsonObj.getAsJsonArray("item"); + if (jsonArrayitem != null) { + // ensure the json data is an array + if (!jsonObj.get("item").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `item` to be an array in the JSON string but got `%s`", jsonObj.get("item").toString())); + } + + // validate the optional field `item` (array) + for (int i = 0; i < jsonArrayitem.size(); i++) { + SelfServiceReservationItemResponse.validateJsonObject(jsonArrayitem.get(i).getAsJsonObject()); + }; } - - // validate the optional field `item` (array) - for (int i = 0; i < jsonArrayitem.size(); i++) { - SelfServiceReservationItemResponse.validateJsonObject(jsonArrayitem.get(i).getAsJsonObject()); - }; } if ((jsonObj.get("notes") != null && !jsonObj.get("notes").isJsonNull()) && !jsonObj.get("notes").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `notes` to be a primitive type in the JSON string but got `%s`", jsonObj.get("notes").toString())); diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/SpotMarketRequestList.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/SpotMarketRequestList.java index 63bf1590c..0c4156f31 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/SpotMarketRequestList.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/SpotMarketRequestList.java @@ -192,17 +192,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { throw new IllegalArgumentException(String.format("The required field(s) %s in SpotMarketRequestList is not found in the empty JSON string", SpotMarketRequestList.openapiRequiredFields.toString())); } } - JsonArray jsonArrayspotMarketRequests = jsonObj.getAsJsonArray("spot_market_requests"); - if (jsonArrayspotMarketRequests != null) { - // ensure the json data is an array - if (!jsonObj.get("spot_market_requests").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `spot_market_requests` to be an array in the JSON string but got `%s`", jsonObj.get("spot_market_requests").toString())); + if (jsonObj.get("spot_market_requests") != null && !jsonObj.get("spot_market_requests").isJsonNull()) { + JsonArray jsonArrayspotMarketRequests = jsonObj.getAsJsonArray("spot_market_requests"); + if (jsonArrayspotMarketRequests != null) { + // ensure the json data is an array + if (!jsonObj.get("spot_market_requests").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `spot_market_requests` to be an array in the JSON string but got `%s`", jsonObj.get("spot_market_requests").toString())); + } + + // validate the optional field `spot_market_requests` (array) + for (int i = 0; i < jsonArrayspotMarketRequests.size(); i++) { + SpotMarketRequest.validateJsonObject(jsonArrayspotMarketRequests.get(i).getAsJsonObject()); + }; } - - // validate the optional field `spot_market_requests` (array) - for (int i = 0; i < jsonArrayspotMarketRequests.size(); i++) { - SpotMarketRequest.validateJsonObject(jsonArrayspotMarketRequests.get(i).getAsJsonObject()); - }; } } diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/TransferRequestList.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/TransferRequestList.java index f6c7ba56a..0840f4d44 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/TransferRequestList.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/TransferRequestList.java @@ -192,17 +192,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { throw new IllegalArgumentException(String.format("The required field(s) %s in TransferRequestList is not found in the empty JSON string", TransferRequestList.openapiRequiredFields.toString())); } } - JsonArray jsonArraytransfers = jsonObj.getAsJsonArray("transfers"); - if (jsonArraytransfers != null) { - // ensure the json data is an array - if (!jsonObj.get("transfers").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `transfers` to be an array in the JSON string but got `%s`", jsonObj.get("transfers").toString())); + if (jsonObj.get("transfers") != null && !jsonObj.get("transfers").isJsonNull()) { + JsonArray jsonArraytransfers = jsonObj.getAsJsonArray("transfers"); + if (jsonArraytransfers != null) { + // ensure the json data is an array + if (!jsonObj.get("transfers").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `transfers` to be an array in the JSON string but got `%s`", jsonObj.get("transfers").toString())); + } + + // validate the optional field `transfers` (array) + for (int i = 0; i < jsonArraytransfers.size(); i++) { + TransferRequest.validateJsonObject(jsonArraytransfers.get(i).getAsJsonObject()); + }; } - - // validate the optional field `transfers` (array) - for (int i = 0; i < jsonArraytransfers.size(); i++) { - TransferRequest.validateJsonObject(jsonArraytransfers.get(i).getAsJsonObject()); - }; } } diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/User.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/User.java index 22a4e23f3..e1ce7a454 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/User.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/User.java @@ -811,17 +811,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); } - JsonArray jsonArrayemails = jsonObj.getAsJsonArray("emails"); - if (jsonArrayemails != null) { - // ensure the json data is an array - if (!jsonObj.get("emails").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `emails` to be an array in the JSON string but got `%s`", jsonObj.get("emails").toString())); + if (jsonObj.get("emails") != null && !jsonObj.get("emails").isJsonNull()) { + JsonArray jsonArrayemails = jsonObj.getAsJsonArray("emails"); + if (jsonArrayemails != null) { + // ensure the json data is an array + if (!jsonObj.get("emails").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `emails` to be an array in the JSON string but got `%s`", jsonObj.get("emails").toString())); + } + + // validate the optional field `emails` (array) + for (int i = 0; i < jsonArrayemails.size(); i++) { + Href.validateJsonObject(jsonArrayemails.get(i).getAsJsonObject()); + }; } - - // validate the optional field `emails` (array) - for (int i = 0; i < jsonArrayemails.size(); i++) { - Href.validateJsonObject(jsonArrayemails.get(i).getAsJsonObject()); - }; } if ((jsonObj.get("first_name") != null && !jsonObj.get("first_name").isJsonNull()) && !jsonObj.get("first_name").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `first_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("first_name").toString())); diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/UserCreateInput.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/UserCreateInput.java index 5a4292ec9..b28156a33 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/UserCreateInput.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/UserCreateInput.java @@ -657,17 +657,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if ((jsonObj.get("company_url") != null && !jsonObj.get("company_url").isJsonNull()) && !jsonObj.get("company_url").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `company_url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("company_url").toString())); } - JsonArray jsonArrayemails = jsonObj.getAsJsonArray("emails"); - if (jsonArrayemails != null) { - // ensure the json data is an array - if (!jsonObj.get("emails").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `emails` to be an array in the JSON string but got `%s`", jsonObj.get("emails").toString())); + if (jsonObj.get("emails") != null && !jsonObj.get("emails").isJsonNull()) { + JsonArray jsonArrayemails = jsonObj.getAsJsonArray("emails"); + if (jsonArrayemails != null) { + // ensure the json data is an array + if (!jsonObj.get("emails").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `emails` to be an array in the JSON string but got `%s`", jsonObj.get("emails").toString())); + } + + // validate the optional field `emails` (array) + for (int i = 0; i < jsonArrayemails.size(); i++) { + EmailInput.validateJsonObject(jsonArrayemails.get(i).getAsJsonObject()); + }; } - - // validate the optional field `emails` (array) - for (int i = 0; i < jsonArrayemails.size(); i++) { - EmailInput.validateJsonObject(jsonArrayemails.get(i).getAsJsonObject()); - }; } if ((jsonObj.get("first_name") != null && !jsonObj.get("first_name").isJsonNull()) && !jsonObj.get("first_name").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `first_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("first_name").toString())); diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/UserList.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/UserList.java index 3a3617e6f..fe90b808b 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/UserList.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/UserList.java @@ -227,17 +227,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if (jsonObj.get("meta") != null && !jsonObj.get("meta").isJsonNull()) { Meta.validateJsonObject(jsonObj.getAsJsonObject("meta")); } - JsonArray jsonArrayusers = jsonObj.getAsJsonArray("users"); - if (jsonArrayusers != null) { - // ensure the json data is an array - if (!jsonObj.get("users").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `users` to be an array in the JSON string but got `%s`", jsonObj.get("users").toString())); + if (jsonObj.get("users") != null && !jsonObj.get("users").isJsonNull()) { + JsonArray jsonArrayusers = jsonObj.getAsJsonArray("users"); + if (jsonArrayusers != null) { + // ensure the json data is an array + if (!jsonObj.get("users").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `users` to be an array in the JSON string but got `%s`", jsonObj.get("users").toString())); + } + + // validate the optional field `users` (array) + for (int i = 0; i < jsonArrayusers.size(); i++) { + User.validateJsonObject(jsonArrayusers.get(i).getAsJsonObject()); + }; } - - // validate the optional field `users` (array) - for (int i = 0; i < jsonArrayusers.size(); i++) { - User.validateJsonObject(jsonArrayusers.get(i).getAsJsonObject()); - }; } } diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/VirtualCircuitList.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/VirtualCircuitList.java index c720b92a0..54898ae27 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/VirtualCircuitList.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/VirtualCircuitList.java @@ -192,17 +192,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { throw new IllegalArgumentException(String.format("The required field(s) %s in VirtualCircuitList is not found in the empty JSON string", VirtualCircuitList.openapiRequiredFields.toString())); } } - JsonArray jsonArrayvirtualCircuits = jsonObj.getAsJsonArray("virtual_circuits"); - if (jsonArrayvirtualCircuits != null) { - // ensure the json data is an array - if (!jsonObj.get("virtual_circuits").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `virtual_circuits` to be an array in the JSON string but got `%s`", jsonObj.get("virtual_circuits").toString())); + if (jsonObj.get("virtual_circuits") != null && !jsonObj.get("virtual_circuits").isJsonNull()) { + JsonArray jsonArrayvirtualCircuits = jsonObj.getAsJsonArray("virtual_circuits"); + if (jsonArrayvirtualCircuits != null) { + // ensure the json data is an array + if (!jsonObj.get("virtual_circuits").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `virtual_circuits` to be an array in the JSON string but got `%s`", jsonObj.get("virtual_circuits").toString())); + } + + // validate the optional field `virtual_circuits` (array) + for (int i = 0; i < jsonArrayvirtualCircuits.size(); i++) { + VirtualCircuitListVirtualCircuitsInner.validateJsonObject(jsonArrayvirtualCircuits.get(i).getAsJsonObject()); + }; } - - // validate the optional field `virtual_circuits` (array) - for (int i = 0; i < jsonArrayvirtualCircuits.size(); i++) { - VirtualCircuitListVirtualCircuitsInner.validateJsonObject(jsonArrayvirtualCircuits.get(i).getAsJsonObject()); - }; } } diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/VirtualNetwork.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/VirtualNetwork.java index b3f9cc0b3..7aa13091f 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/VirtualNetwork.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/VirtualNetwork.java @@ -518,29 +518,33 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) && !jsonObj.get("id").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } - JsonArray jsonArrayinstances = jsonObj.getAsJsonArray("instances"); - if (jsonArrayinstances != null) { - // ensure the json data is an array - if (!jsonObj.get("instances").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `instances` to be an array in the JSON string but got `%s`", jsonObj.get("instances").toString())); + if (jsonObj.get("instances") != null && !jsonObj.get("instances").isJsonNull()) { + JsonArray jsonArrayinstances = jsonObj.getAsJsonArray("instances"); + if (jsonArrayinstances != null) { + // ensure the json data is an array + if (!jsonObj.get("instances").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `instances` to be an array in the JSON string but got `%s`", jsonObj.get("instances").toString())); + } + + // validate the optional field `instances` (array) + for (int i = 0; i < jsonArrayinstances.size(); i++) { + Href.validateJsonObject(jsonArrayinstances.get(i).getAsJsonObject()); + }; } - - // validate the optional field `instances` (array) - for (int i = 0; i < jsonArrayinstances.size(); i++) { - Href.validateJsonObject(jsonArrayinstances.get(i).getAsJsonObject()); - }; } - JsonArray jsonArraymetalGateways = jsonObj.getAsJsonArray("metal_gateways"); - if (jsonArraymetalGateways != null) { - // ensure the json data is an array - if (!jsonObj.get("metal_gateways").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `metal_gateways` to be an array in the JSON string but got `%s`", jsonObj.get("metal_gateways").toString())); + if (jsonObj.get("metal_gateways") != null && !jsonObj.get("metal_gateways").isJsonNull()) { + JsonArray jsonArraymetalGateways = jsonObj.getAsJsonArray("metal_gateways"); + if (jsonArraymetalGateways != null) { + // ensure the json data is an array + if (!jsonObj.get("metal_gateways").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `metal_gateways` to be an array in the JSON string but got `%s`", jsonObj.get("metal_gateways").toString())); + } + + // validate the optional field `metal_gateways` (array) + for (int i = 0; i < jsonArraymetalGateways.size(); i++) { + Href.validateJsonObject(jsonArraymetalGateways.get(i).getAsJsonObject()); + }; } - - // validate the optional field `metal_gateways` (array) - for (int i = 0; i < jsonArraymetalGateways.size(); i++) { - Href.validateJsonObject(jsonArraymetalGateways.get(i).getAsJsonObject()); - }; } // validate the optional field `metro` if (jsonObj.get("metro") != null && !jsonObj.get("metro").isJsonNull()) { diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/VirtualNetworkCreateInput.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/VirtualNetworkCreateInput.java index 276755082..58782de5c 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/VirtualNetworkCreateInput.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/VirtualNetworkCreateInput.java @@ -23,7 +23,6 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import java.util.UUID; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -62,10 +61,6 @@ public class VirtualNetworkCreateInput { @SerializedName(SERIALIZED_NAME_METRO) private String metro; - public static final String SERIALIZED_NAME_PROJECT_ID = "project_id"; - @SerializedName(SERIALIZED_NAME_PROJECT_ID) - private UUID projectId; - public static final String SERIALIZED_NAME_VXLAN = "vxlan"; @SerializedName(SERIALIZED_NAME_VXLAN) private Integer vxlan; @@ -142,29 +137,6 @@ public void setMetro(String metro) { } - public VirtualNetworkCreateInput projectId(UUID projectId) { - - this.projectId = projectId; - return this; - } - - /** - * Get projectId - * @return projectId - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - - public UUID getProjectId() { - return projectId; - } - - - public void setProjectId(UUID projectId) { - this.projectId = projectId; - } - - public VirtualNetworkCreateInput vxlan(Integer vxlan) { this.vxlan = vxlan; @@ -236,14 +208,13 @@ public boolean equals(Object o) { return Objects.equals(this.description, virtualNetworkCreateInput.description) && Objects.equals(this.facility, virtualNetworkCreateInput.facility) && Objects.equals(this.metro, virtualNetworkCreateInput.metro) && - Objects.equals(this.projectId, virtualNetworkCreateInput.projectId) && Objects.equals(this.vxlan, virtualNetworkCreateInput.vxlan)&& Objects.equals(this.additionalProperties, virtualNetworkCreateInput.additionalProperties); } @Override public int hashCode() { - return Objects.hash(description, facility, metro, projectId, vxlan, additionalProperties); + return Objects.hash(description, facility, metro, vxlan, additionalProperties); } @Override @@ -253,7 +224,6 @@ public String toString() { sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" facility: ").append(toIndentedString(facility)).append("\n"); sb.append(" metro: ").append(toIndentedString(metro)).append("\n"); - sb.append(" projectId: ").append(toIndentedString(projectId)).append("\n"); sb.append(" vxlan: ").append(toIndentedString(vxlan)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); @@ -281,12 +251,10 @@ private String toIndentedString(Object o) { openapiFields.add("description"); openapiFields.add("facility"); openapiFields.add("metro"); - openapiFields.add("project_id"); openapiFields.add("vxlan"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("project_id"); } /** @@ -303,13 +271,6 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { throw new IllegalArgumentException(String.format("The required field(s) %s in VirtualNetworkCreateInput is not found in the empty JSON string", VirtualNetworkCreateInput.openapiRequiredFields.toString())); } } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : VirtualNetworkCreateInput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); } @@ -319,9 +280,6 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if ((jsonObj.get("metro") != null && !jsonObj.get("metro").isJsonNull()) && !jsonObj.get("metro").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `metro` to be a primitive type in the JSON string but got `%s`", jsonObj.get("metro").toString())); } - if ((jsonObj.get("project_id") != null && !jsonObj.get("project_id").isJsonNull()) && !jsonObj.get("project_id").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `project_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("project_id").toString())); - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/VirtualNetworkList.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/VirtualNetworkList.java index ea94afb2b..ac3382ae7 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/VirtualNetworkList.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/VirtualNetworkList.java @@ -192,17 +192,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { throw new IllegalArgumentException(String.format("The required field(s) %s in VirtualNetworkList is not found in the empty JSON string", VirtualNetworkList.openapiRequiredFields.toString())); } } - JsonArray jsonArrayvirtualNetworks = jsonObj.getAsJsonArray("virtual_networks"); - if (jsonArrayvirtualNetworks != null) { - // ensure the json data is an array - if (!jsonObj.get("virtual_networks").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `virtual_networks` to be an array in the JSON string but got `%s`", jsonObj.get("virtual_networks").toString())); + if (jsonObj.get("virtual_networks") != null && !jsonObj.get("virtual_networks").isJsonNull()) { + JsonArray jsonArrayvirtualNetworks = jsonObj.getAsJsonArray("virtual_networks"); + if (jsonArrayvirtualNetworks != null) { + // ensure the json data is an array + if (!jsonObj.get("virtual_networks").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `virtual_networks` to be an array in the JSON string but got `%s`", jsonObj.get("virtual_networks").toString())); + } + + // validate the optional field `virtual_networks` (array) + for (int i = 0; i < jsonArrayvirtualNetworks.size(); i++) { + VirtualNetwork.validateJsonObject(jsonArrayvirtualNetworks.get(i).getAsJsonObject()); + }; } - - // validate the optional field `virtual_networks` (array) - for (int i = 0; i < jsonArrayvirtualNetworks.size(); i++) { - VirtualNetwork.validateJsonObject(jsonArrayvirtualNetworks.get(i).getAsJsonObject()); - }; } } diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/VrfCreateInput.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/VrfCreateInput.java index e08d6ed57..0fb1daaea 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/VrfCreateInput.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/VrfCreateInput.java @@ -25,7 +25,6 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; -import java.util.UUID; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -72,10 +71,6 @@ public class VrfCreateInput { @SerializedName(SERIALIZED_NAME_NAME) private String name; - public static final String SERIALIZED_NAME_PROJECT_ID = "project_id"; - @SerializedName(SERIALIZED_NAME_PROJECT_ID) - private UUID projectId; - public VrfCreateInput() { } @@ -201,29 +196,6 @@ public void setName(String name) { this.name = name; } - - public VrfCreateInput projectId(UUID projectId) { - - this.projectId = projectId; - return this; - } - - /** - * Get projectId - * @return projectId - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - - public UUID getProjectId() { - return projectId; - } - - - public void setProjectId(UUID projectId) { - this.projectId = projectId; - } - /** * A container for additional, undeclared properties. * This is a holder for any undeclared properties as specified with @@ -274,14 +246,13 @@ public boolean equals(Object o) { Objects.equals(this.ipRanges, vrfCreateInput.ipRanges) && Objects.equals(this.localAsn, vrfCreateInput.localAsn) && Objects.equals(this.metro, vrfCreateInput.metro) && - Objects.equals(this.name, vrfCreateInput.name) && - Objects.equals(this.projectId, vrfCreateInput.projectId)&& + Objects.equals(this.name, vrfCreateInput.name)&& Objects.equals(this.additionalProperties, vrfCreateInput.additionalProperties); } @Override public int hashCode() { - return Objects.hash(description, ipRanges, localAsn, metro, name, projectId, additionalProperties); + return Objects.hash(description, ipRanges, localAsn, metro, name, additionalProperties); } @Override @@ -293,7 +264,6 @@ public String toString() { sb.append(" localAsn: ").append(toIndentedString(localAsn)).append("\n"); sb.append(" metro: ").append(toIndentedString(metro)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" projectId: ").append(toIndentedString(projectId)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); @@ -322,13 +292,11 @@ private String toIndentedString(Object o) { openapiFields.add("local_asn"); openapiFields.add("metro"); openapiFields.add("name"); - openapiFields.add("project_id"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); openapiRequiredFields.add("metro"); openapiRequiredFields.add("name"); - openapiRequiredFields.add("project_id"); } /** @@ -365,9 +333,6 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); } - if ((jsonObj.get("project_id") != null && !jsonObj.get("project_id").isJsonNull()) && !jsonObj.get("project_id").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `project_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("project_id").toString())); - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/VrfIPReservationList.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/VrfIPReservationList.java index c054a476f..72fd0a62b 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/VrfIPReservationList.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/VrfIPReservationList.java @@ -192,17 +192,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { throw new IllegalArgumentException(String.format("The required field(s) %s in VrfIPReservationList is not found in the empty JSON string", VrfIPReservationList.openapiRequiredFields.toString())); } } - JsonArray jsonArrayipAddresses = jsonObj.getAsJsonArray("ip_addresses"); - if (jsonArrayipAddresses != null) { - // ensure the json data is an array - if (!jsonObj.get("ip_addresses").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `ip_addresses` to be an array in the JSON string but got `%s`", jsonObj.get("ip_addresses").toString())); + if (jsonObj.get("ip_addresses") != null && !jsonObj.get("ip_addresses").isJsonNull()) { + JsonArray jsonArrayipAddresses = jsonObj.getAsJsonArray("ip_addresses"); + if (jsonArrayipAddresses != null) { + // ensure the json data is an array + if (!jsonObj.get("ip_addresses").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `ip_addresses` to be an array in the JSON string but got `%s`", jsonObj.get("ip_addresses").toString())); + } + + // validate the optional field `ip_addresses` (array) + for (int i = 0; i < jsonArrayipAddresses.size(); i++) { + VrfIPReservation.validateJsonObject(jsonArrayipAddresses.get(i).getAsJsonObject()); + }; } - - // validate the optional field `ip_addresses` (array) - for (int i = 0; i < jsonArrayipAddresses.size(); i++) { - VrfIPReservation.validateJsonObject(jsonArrayipAddresses.get(i).getAsJsonObject()); - }; } } diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/VrfList.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/VrfList.java index 50bbbbcf9..ebeee058d 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/VrfList.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/VrfList.java @@ -192,17 +192,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { throw new IllegalArgumentException(String.format("The required field(s) %s in VrfList is not found in the empty JSON string", VrfList.openapiRequiredFields.toString())); } } - JsonArray jsonArrayvrfs = jsonObj.getAsJsonArray("vrfs"); - if (jsonArrayvrfs != null) { - // ensure the json data is an array - if (!jsonObj.get("vrfs").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `vrfs` to be an array in the JSON string but got `%s`", jsonObj.get("vrfs").toString())); + if (jsonObj.get("vrfs") != null && !jsonObj.get("vrfs").isJsonNull()) { + JsonArray jsonArrayvrfs = jsonObj.getAsJsonArray("vrfs"); + if (jsonArrayvrfs != null) { + // ensure the json data is an array + if (!jsonObj.get("vrfs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `vrfs` to be an array in the JSON string but got `%s`", jsonObj.get("vrfs").toString())); + } + + // validate the optional field `vrfs` (array) + for (int i = 0; i < jsonArrayvrfs.size(); i++) { + Vrf.validateJsonObject(jsonArrayvrfs.get(i).getAsJsonObject()); + }; } - - // validate the optional field `vrfs` (array) - for (int i = 0; i < jsonArrayvrfs.size(); i++) { - Vrf.validateJsonObject(jsonArrayvrfs.get(i).getAsJsonObject()); - }; } } diff --git a/equinix-openapi-metal/src/main/java/com/equinix/workflow/MetalGatewayOperator.java b/equinix-openapi-metal/src/main/java/com/equinix/workflow/MetalGatewayOperator.java index 59e6dcf90..571d6b74f 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/workflow/MetalGatewayOperator.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/workflow/MetalGatewayOperator.java @@ -12,14 +12,16 @@ import com.equinix.openapi.metal.v1.model.CreateMetalGatewayRequest; import com.equinix.openapi.metal.v1.model.MetalGateway; import com.equinix.openapi.metal.v1.model.MetalGateway.StateEnum; -import com.equinix.openapi.metal.v1.model.MetalGatewayInput; +import com.equinix.openapi.metal.v1.model.MetalGatewayCreateInput; import com.equinix.openapi.metal.v1.model.VirtualNetwork; import com.equinix.workflow.helpers.VlanHelper; public class MetalGatewayOperator { private MetalGatewaysApi metalGatewaysApi; private VlanHelper vlanHelper; - private final List targetState= Arrays.asList(StateEnum.ACTIVE, StateEnum.READY); + private static final Integer RESPONSE_PAGE = 1; + private static final Integer RESPONSE_ITEMS_PER_PAGE = 10; + private static final String VIRTUAL_NETWORK = "virtual_network"; public MetalGatewayOperator(ApiClient apiClient) { this.metalGatewaysApi = new MetalGatewaysApi(apiClient); @@ -38,48 +40,61 @@ public VirtualNetwork getVlanOfMetalGateway(UUID metalGatewayId) throws ApiExcep } // Creates a Metal Gateway with a private IPv4 block specified for the associated Virtual Network - public MetalGateway createMetalGatewayWithPrivateIpBlockAndPoll(UUID projectId, String metro, Integer vxlan, Integer privateIpv4SubnetSize, int retries, Duration wait) + public MetalGateway createMetalGatewayWithPrivateIpBlock(UUID projectId, String metro, Integer vxlan, Integer privateIpv4SubnetSize) throws ApiException, InterruptedException { VirtualNetwork vlan = vlanHelper.getVlanByVxlanInProjectMetro(projectId, metro, vxlan); if (vlan==null) vlan = vlanHelper.createVlan(projectId, metro, vxlan); - MetalGatewayInput metalGatewayInput = new MetalGatewayInput() + MetalGatewayCreateInput metalGatewayCreateInput = new MetalGatewayCreateInput() .privateIpv4SubnetSize(privateIpv4SubnetSize) .virtualNetworkId(vlan.getId()); - CreateMetalGatewayRequest createMetalGatewayRequest = new CreateMetalGatewayRequest(metalGatewayInput); - MetalGateway metalGateway = metalGatewaysApi.createMetalGateway(projectId, createMetalGatewayRequest,1, 10); - return metalGatewayCreatedAndPoll(metalGateway, retries, wait); + CreateMetalGatewayRequest createMetalGatewayRequest = new CreateMetalGatewayRequest(metalGatewayCreateInput); + return metalGatewaysApi.createMetalGateway(projectId, createMetalGatewayRequest, RESPONSE_PAGE, RESPONSE_ITEMS_PER_PAGE); } - // Poll until state of metal gateway becomes "active" or "ready" - private MetalGateway metalGatewayCreatedAndPoll(MetalGateway metalGateway, int retries, Duration wait) - throws ApiException, InterruptedException { + // Poll until metal gateway record is deleted when state is "deleting" + private void metalGatewayDeletedAndPoll(MetalGateway metalGateway, int retries, Duration wait) + throws InterruptedException, ApiException { - UUID metalGatewayId; - for (int i=0; i. - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@equinixmetal.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.equinix.openapi.metal.v1.model; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.UUID; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - - -/** - * Model tests for CreateVrfRequest - */ -public class CreateVrfRequestTest { - private final CreateVrfRequest model = new CreateVrfRequest(); - - /** - * Model tests for CreateVrfRequest - */ - @Test - public void testCreateVrfRequest() { - // TODO: test CreateVrfRequest - } - - /** - * Test the property 'description' - */ - @Test - public void descriptionTest() { - // TODO: test description - } - - /** - * Test the property 'ipRanges' - */ - @Test - public void ipRangesTest() { - // TODO: test ipRanges - } - - /** - * Test the property 'localAsn' - */ - @Test - public void localAsnTest() { - // TODO: test localAsn - } - - /** - * Test the property 'metro' - */ - @Test - public void metroTest() { - // TODO: test metro - } - - /** - * Test the property 'name' - */ - @Test - public void nameTest() { - // TODO: test name - } - - /** - * Test the property 'projectId' - */ - @Test - public void projectIdTest() { - // TODO: test projectId - } - -} diff --git a/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/IPReservationRequestInputTest.java b/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/DefaultIPReservationCreateInputTest.java similarity index 86% rename from equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/IPReservationRequestInputTest.java rename to equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/DefaultIPReservationCreateInputTest.java index f547a7271..a9cd8dbe6 100644 --- a/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/IPReservationRequestInputTest.java +++ b/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/DefaultIPReservationCreateInputTest.java @@ -28,17 +28,17 @@ /** - * Model tests for IPReservationRequestInput + * Model tests for DefaultIPReservationCreateInput */ -public class IPReservationRequestInputTest { - private final IPReservationRequestInput model = new IPReservationRequestInput(); +public class DefaultIPReservationCreateInputTest { + private final DefaultIPReservationCreateInput model = new DefaultIPReservationCreateInput(); /** - * Model tests for IPReservationRequestInput + * Model tests for DefaultIPReservationCreateInput */ @Test - public void testIPReservationRequestInput() { - // TODO: test IPReservationRequestInput + public void testDefaultIPReservationCreateInput() { + // TODO: test DefaultIPReservationCreateInput } /** diff --git a/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/MetalGatewayInputTest.java b/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/MetalGatewayCreateInputTest.java similarity index 83% rename from equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/MetalGatewayInputTest.java rename to equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/MetalGatewayCreateInputTest.java index 7dab3bb69..049d412e2 100644 --- a/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/MetalGatewayInputTest.java +++ b/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/MetalGatewayCreateInputTest.java @@ -27,17 +27,17 @@ /** - * Model tests for MetalGatewayInput + * Model tests for MetalGatewayCreateInput */ -public class MetalGatewayInputTest { - private final MetalGatewayInput model = new MetalGatewayInput(); +public class MetalGatewayCreateInputTest { + private final MetalGatewayCreateInput model = new MetalGatewayCreateInput(); /** - * Model tests for MetalGatewayInput + * Model tests for MetalGatewayCreateInput */ @Test - public void testMetalGatewayInput() { - // TODO: test MetalGatewayInput + public void testMetalGatewayCreateInput() { + // TODO: test MetalGatewayCreateInput } /** diff --git a/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/RequestIPReservationRequestTest.java b/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/RequestIPReservationRequestTest.java index 3b461e862..b042c67af 100644 --- a/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/RequestIPReservationRequestTest.java +++ b/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/RequestIPReservationRequestTest.java @@ -13,7 +13,7 @@ package com.equinix.openapi.metal.v1.model; -import com.equinix.openapi.metal.v1.model.IPReservationRequestInput; +import com.equinix.openapi.metal.v1.model.DefaultIPReservationCreateInput; import com.equinix.openapi.metal.v1.model.VrfIPReservationCreateInput; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; diff --git a/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/VirtualNetworkCreateInputTest.java b/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/VirtualNetworkCreateInputTest.java index be18d4584..afff615c6 100644 --- a/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/VirtualNetworkCreateInputTest.java +++ b/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/VirtualNetworkCreateInputTest.java @@ -21,7 +21,6 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import java.util.UUID; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; @@ -64,14 +63,6 @@ public void metroTest() { // TODO: test metro } - /** - * Test the property 'projectId' - */ - @Test - public void projectIdTest() { - // TODO: test projectId - } - /** * Test the property 'vxlan' */ diff --git a/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/VrfCreateInputTest.java b/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/VrfCreateInputTest.java index 02402ae13..06e755584 100644 --- a/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/VrfCreateInputTest.java +++ b/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/VrfCreateInputTest.java @@ -23,7 +23,6 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; -import java.util.UUID; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; @@ -82,12 +81,4 @@ public void nameTest() { // TODO: test name } - /** - * Test the property 'projectId' - */ - @Test - public void projectIdTest() { - // TODO: test projectId - } - } From 1c69f661f8c5653522bb0873ae6aab065b0d98f6 Mon Sep 17 00:00:00 2001 From: Taeeb Bandwala Date: Thu, 22 Sep 2022 07:03:37 +0530 Subject: [PATCH 6/7] Update README --- README.md | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index e5263950e..53867cafd 100644 --- a/README.md +++ b/README.md @@ -47,18 +47,29 @@ make git_run Note : Both docker and git pulls latest version of openapi generator. -## Adding complex workflows: -Complex workflows requiring multiple granular, autogenerated apis can be implemented as part of Operator classes. These classes are included in the path _equinix-openapi-metal/src/main/java/com/equinix/workflow_ when building the sdk. +## Contribution guidelines +### Patching oas3.0 spec +1. Make changes in ``spec/oas3.patched.json``. +2. Create a patch file in metal-java: + ``` + cd spec + git diff oas3.patched.json > ../patches/spec.fetched.json/ + cd .. + ``` +3. ``patchfilename`` should be in format: ``-.patch`` +4. Run ``make docker_run`` to reapply the changes to oas spec. +5. Before pushing changes, commit ``spec/oas3.patches.json`` along with the patch file. -## Steps for development: +### Adding complex workflows +Complex workflows requiring multiple granular, autogenerated apis can be implemented as part of Operator classes. These classes are included in the path ``equinix-openapi-metal/src/main/java/com/equinix/workflow`` when building the sdk. An example use case for operator implementation can be for APIs requiring polling logic to fetch updated resource state. 1. Follow steps mentioned in section "Generate and build equinix metal java client" to generate and build the sdk in your cloned local. 2. Implement operator classes inside ```equinix-openapi-metal/src/main/java/com/equinix/workflow```. 3. Follow steps mentioned in section "Functional tests for complex workflows" to add functional tests for the same. -4. After testing and debugging in your local, move the newly added operator classes to _internal/workflow_. +4. After testing and debugging in your local, move the newly added operator classes to ``internal/workflow``. 5. Commit your changes made in ```internal/workflow```, ```.github/workflows```, ```equinix-functional-tests``` and push them to the remote branch. The auto commit git workflow would automatically build and generate the sdk in the remote branch with the newly added workflows. 6. Post completion of the auto commit workflow in your remote branch, you can do a ```git rebase origin/your-branch-name``` to sync your local. -## Functional tests for complex workflows: +### Adding functional tests for complex workflows 1. You can implement functional tests for your operator classes inside ```equinix-functional-test/src/test/java/com/equinix/test/functional```. Check existing operator test implementations for reference. 2. Input properties required for the tests can be mentioned in a separate .properties file inside ```equinix-functional-test/src/test/resources```. 3. To run functional tests locally: From 70a68ebae2310d479b464904d04b7c6d08002bbb Mon Sep 17 00:00:00 2001 From: Taeeb Bandwala Date: Thu, 22 Sep 2022 13:23:41 +0530 Subject: [PATCH 7/7] Fix typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 53867cafd..6d84deb82 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ Note : Both docker and git pulls latest version of openapi generator. ``` 3. ``patchfilename`` should be in format: ``-.patch`` 4. Run ``make docker_run`` to reapply the changes to oas spec. -5. Before pushing changes, commit ``spec/oas3.patches.json`` along with the patch file. +5. Before pushing changes, commit ``spec/oas3.patched.json`` along with the patch file. ### Adding complex workflows Complex workflows requiring multiple granular, autogenerated apis can be implemented as part of Operator classes. These classes are included in the path ``equinix-openapi-metal/src/main/java/com/equinix/workflow`` when building the sdk. An example use case for operator implementation can be for APIs requiring polling logic to fetch updated resource state.