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 8f7273560..4a61a586a 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 @@ -20,7 +20,7 @@ import com.equinix.workflow.helpers.VlanHelper; public class TestMetalGatewayOperator { - private static final Logger logger = LoggerFactory.getLogger(TestDeviceOperator.class); + 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"; diff --git a/equinix-openapi-metal/.openapi-generator/FILES b/equinix-openapi-metal/.openapi-generator/FILES index bef4fa4dc..b70e2acd0 100644 --- a/equinix-openapi-metal/.openapi-generator/FILES +++ b/equinix-openapi-metal/.openapi-generator/FILES @@ -47,6 +47,8 @@ docs/CreateMetalGatewayRequest.md docs/CreateSelfServiceReservationRequest.md docs/CreateSelfServiceReservationRequestPeriod.md docs/CreateVrfRequest.md +docs/DefaultIPReservation.md +docs/DefaultIPReservationAllOf.md docs/Device.md docs/DeviceActionsInner.md docs/DeviceCreateInput.md @@ -73,22 +75,20 @@ docs/FacilitiesApi.md docs/Facility.md docs/FacilityList.md docs/FindIPAddressById200Response.md -docs/FindMetalGatewayById200Response.md docs/GlobalBgpRange.md docs/GlobalBgpRangeList.md docs/HardwareReservation.md docs/HardwareReservationList.md docs/HardwareReservationsApi.md docs/Href.md +docs/HrefOnly.md docs/IPAssignment.md docs/IPAssignmentInput.md docs/IPAssignmentList.md docs/IPAssignmentMetro.md docs/IPAvailabilitiesList.md docs/IPReservation.md -docs/IPReservationFacility.md docs/IPReservationList.md -docs/IPReservationListIpAddressesInner.md docs/IPReservationMetro.md docs/IPReservationRequestInput.md docs/IncidentsApi.md @@ -119,8 +119,8 @@ docs/MembershipsApi.md docs/Meta.md docs/MetalGateway.md docs/MetalGatewayInput.md +docs/MetalGatewayIpReservation.md docs/MetalGatewayList.md -docs/MetalGatewayListMetalGatewaysInner.md docs/MetalGatewayLite.md docs/MetalGatewaysApi.md docs/Metro.md @@ -172,7 +172,6 @@ docs/ProjectUsage.md docs/ProjectUsageList.md docs/ProjectsApi.md docs/RecoveryCodeList.md -docs/RequestIPReservation201Response.md docs/RequestIPReservationRequest.md docs/SSHKey.md docs/SSHKeyCreateInput.md @@ -230,11 +229,11 @@ docs/VirtualNetworkList.md docs/VlansApi.md docs/Vrf.md docs/VrfCreateInput.md -docs/VrfIpReservation.md -docs/VrfIpReservationCreateInput.md -docs/VrfIpReservationList.md +docs/VrfIPReservation.md +docs/VrfIPReservationAllOf.md +docs/VrfIPReservationCreateInput.md +docs/VrfIPReservationList.md docs/VrfList.md -docs/VrfMetalGateway.md docs/VrfMetalGatewayCreateInput.md docs/VrfUpdateInput.md docs/VrfVirtualCircuit.md @@ -341,6 +340,8 @@ 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/Device.java src/main/java/com/equinix/openapi/metal/v1/model/DeviceActionsInner.java src/main/java/com/equinix/openapi/metal/v1/model/DeviceCreateInput.java @@ -363,21 +364,19 @@ src/main/java/com/equinix/openapi/metal/v1/model/FabricServiceToken.java src/main/java/com/equinix/openapi/metal/v1/model/Facility.java src/main/java/com/equinix/openapi/metal/v1/model/FacilityList.java src/main/java/com/equinix/openapi/metal/v1/model/FindIPAddressById200Response.java -src/main/java/com/equinix/openapi/metal/v1/model/FindMetalGatewayById200Response.java src/main/java/com/equinix/openapi/metal/v1/model/GlobalBgpRange.java src/main/java/com/equinix/openapi/metal/v1/model/GlobalBgpRangeList.java src/main/java/com/equinix/openapi/metal/v1/model/HardwareReservation.java src/main/java/com/equinix/openapi/metal/v1/model/HardwareReservationList.java src/main/java/com/equinix/openapi/metal/v1/model/Href.java +src/main/java/com/equinix/openapi/metal/v1/model/HrefOnly.java src/main/java/com/equinix/openapi/metal/v1/model/IPAssignment.java src/main/java/com/equinix/openapi/metal/v1/model/IPAssignmentInput.java src/main/java/com/equinix/openapi/metal/v1/model/IPAssignmentList.java src/main/java/com/equinix/openapi/metal/v1/model/IPAssignmentMetro.java 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/IPReservationFacility.java src/main/java/com/equinix/openapi/metal/v1/model/IPReservationList.java -src/main/java/com/equinix/openapi/metal/v1/model/IPReservationListIpAddressesInner.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 @@ -403,8 +402,8 @@ 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/MetalGatewayIpReservation.java src/main/java/com/equinix/openapi/metal/v1/model/MetalGatewayList.java -src/main/java/com/equinix/openapi/metal/v1/model/MetalGatewayListMetalGatewaysInner.java src/main/java/com/equinix/openapi/metal/v1/model/MetalGatewayLite.java src/main/java/com/equinix/openapi/metal/v1/model/Metro.java src/main/java/com/equinix/openapi/metal/v1/model/MetroCapacityList.java @@ -446,7 +445,6 @@ src/main/java/com/equinix/openapi/metal/v1/model/ProjectUpdateInput.java src/main/java/com/equinix/openapi/metal/v1/model/ProjectUsage.java src/main/java/com/equinix/openapi/metal/v1/model/ProjectUsageList.java src/main/java/com/equinix/openapi/metal/v1/model/RecoveryCodeList.java -src/main/java/com/equinix/openapi/metal/v1/model/RequestIPReservation201Response.java src/main/java/com/equinix/openapi/metal/v1/model/RequestIPReservationRequest.java src/main/java/com/equinix/openapi/metal/v1/model/SSHKey.java src/main/java/com/equinix/openapi/metal/v1/model/SSHKeyCreateInput.java @@ -493,11 +491,11 @@ src/main/java/com/equinix/openapi/metal/v1/model/VirtualNetworkCreateInput.java src/main/java/com/equinix/openapi/metal/v1/model/VirtualNetworkList.java src/main/java/com/equinix/openapi/metal/v1/model/Vrf.java src/main/java/com/equinix/openapi/metal/v1/model/VrfCreateInput.java -src/main/java/com/equinix/openapi/metal/v1/model/VrfIpReservation.java -src/main/java/com/equinix/openapi/metal/v1/model/VrfIpReservationCreateInput.java -src/main/java/com/equinix/openapi/metal/v1/model/VrfIpReservationList.java +src/main/java/com/equinix/openapi/metal/v1/model/VrfIPReservation.java +src/main/java/com/equinix/openapi/metal/v1/model/VrfIPReservationAllOf.java +src/main/java/com/equinix/openapi/metal/v1/model/VrfIPReservationCreateInput.java +src/main/java/com/equinix/openapi/metal/v1/model/VrfIPReservationList.java src/main/java/com/equinix/openapi/metal/v1/model/VrfList.java -src/main/java/com/equinix/openapi/metal/v1/model/VrfMetalGateway.java src/main/java/com/equinix/openapi/metal/v1/model/VrfMetalGatewayCreateInput.java src/main/java/com/equinix/openapi/metal/v1/model/VrfUpdateInput.java src/main/java/com/equinix/openapi/metal/v1/model/VrfVirtualCircuit.java @@ -576,6 +574,8 @@ src/test/java/com/equinix/openapi/metal/v1/model/CreateMetalGatewayRequestTest.j 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/DefaultIPReservationTest.java src/test/java/com/equinix/openapi/metal/v1/model/DeviceActionsInnerTest.java src/test/java/com/equinix/openapi/metal/v1/model/DeviceCreateInputIpAddressesInnerTest.java src/test/java/com/equinix/openapi/metal/v1/model/DeviceCreateInputTest.java @@ -598,19 +598,17 @@ src/test/java/com/equinix/openapi/metal/v1/model/FabricServiceTokenTest.java src/test/java/com/equinix/openapi/metal/v1/model/FacilityListTest.java src/test/java/com/equinix/openapi/metal/v1/model/FacilityTest.java src/test/java/com/equinix/openapi/metal/v1/model/FindIPAddressById200ResponseTest.java -src/test/java/com/equinix/openapi/metal/v1/model/FindMetalGatewayById200ResponseTest.java src/test/java/com/equinix/openapi/metal/v1/model/GlobalBgpRangeListTest.java src/test/java/com/equinix/openapi/metal/v1/model/GlobalBgpRangeTest.java src/test/java/com/equinix/openapi/metal/v1/model/HardwareReservationListTest.java src/test/java/com/equinix/openapi/metal/v1/model/HardwareReservationTest.java +src/test/java/com/equinix/openapi/metal/v1/model/HrefOnlyTest.java src/test/java/com/equinix/openapi/metal/v1/model/HrefTest.java src/test/java/com/equinix/openapi/metal/v1/model/IPAssignmentInputTest.java src/test/java/com/equinix/openapi/metal/v1/model/IPAssignmentListTest.java src/test/java/com/equinix/openapi/metal/v1/model/IPAssignmentMetroTest.java 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/IPReservationFacilityTest.java -src/test/java/com/equinix/openapi/metal/v1/model/IPReservationListIpAddressesInnerTest.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 @@ -637,7 +635,7 @@ 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/MetalGatewayListMetalGatewaysInnerTest.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 src/test/java/com/equinix/openapi/metal/v1/model/MetalGatewayTest.java @@ -681,7 +679,6 @@ src/test/java/com/equinix/openapi/metal/v1/model/ProjectUpdateInputTest.java src/test/java/com/equinix/openapi/metal/v1/model/ProjectUsageListTest.java src/test/java/com/equinix/openapi/metal/v1/model/ProjectUsageTest.java src/test/java/com/equinix/openapi/metal/v1/model/RecoveryCodeListTest.java -src/test/java/com/equinix/openapi/metal/v1/model/RequestIPReservation201ResponseTest.java src/test/java/com/equinix/openapi/metal/v1/model/RequestIPReservationRequestTest.java src/test/java/com/equinix/openapi/metal/v1/model/SSHKeyCreateInputTest.java src/test/java/com/equinix/openapi/metal/v1/model/SSHKeyInputTest.java @@ -727,12 +724,12 @@ src/test/java/com/equinix/openapi/metal/v1/model/VirtualNetworkCreateInputTest.j src/test/java/com/equinix/openapi/metal/v1/model/VirtualNetworkListTest.java src/test/java/com/equinix/openapi/metal/v1/model/VirtualNetworkTest.java src/test/java/com/equinix/openapi/metal/v1/model/VrfCreateInputTest.java -src/test/java/com/equinix/openapi/metal/v1/model/VrfIpReservationCreateInputTest.java -src/test/java/com/equinix/openapi/metal/v1/model/VrfIpReservationListTest.java -src/test/java/com/equinix/openapi/metal/v1/model/VrfIpReservationTest.java +src/test/java/com/equinix/openapi/metal/v1/model/VrfIPReservationAllOfTest.java +src/test/java/com/equinix/openapi/metal/v1/model/VrfIPReservationCreateInputTest.java +src/test/java/com/equinix/openapi/metal/v1/model/VrfIPReservationListTest.java +src/test/java/com/equinix/openapi/metal/v1/model/VrfIPReservationTest.java src/test/java/com/equinix/openapi/metal/v1/model/VrfListTest.java src/test/java/com/equinix/openapi/metal/v1/model/VrfMetalGatewayCreateInputTest.java -src/test/java/com/equinix/openapi/metal/v1/model/VrfMetalGatewayTest.java src/test/java/com/equinix/openapi/metal/v1/model/VrfTest.java src/test/java/com/equinix/openapi/metal/v1/model/VrfUpdateInputTest.java src/test/java/com/equinix/openapi/metal/v1/model/VrfVirtualCircuitCreateInputTest.java diff --git a/equinix-openapi-metal/.openapi-generator/VERSION b/equinix-openapi-metal/.openapi-generator/VERSION index 66672d4e9..7b7e20b57 100644 --- a/equinix-openapi-metal/.openapi-generator/VERSION +++ b/equinix-openapi-metal/.openapi-generator/VERSION @@ -1 +1 @@ -6.1.0-SNAPSHOT \ No newline at end of file +6.1.1-SNAPSHOT \ No newline at end of file diff --git a/equinix-openapi-metal/README.md b/equinix-openapi-metal/README.md index e24d295b3..ee5ab3e7f 100644 --- a/equinix-openapi-metal/README.md +++ b/equinix-openapi-metal/README.md @@ -319,7 +319,7 @@ Class | Method | HTTP request | Description *VrfsApi* | [**createVrf**](docs/VrfsApi.md#createVrf) | **POST** /projects/{id}/vrfs | Create a new VRF in the specified project *VrfsApi* | [**deleteVrf**](docs/VrfsApi.md#deleteVrf) | **DELETE** /vrfs/{id} | Delete the VRF *VrfsApi* | [**findVrfById**](docs/VrfsApi.md#findVrfById) | **GET** /vrfs/{id} | Retrieve a VRF -*VrfsApi* | [**findVrfIpReservations**](docs/VrfsApi.md#findVrfIpReservations) | **GET** /vrfs/{id}/ips | Retrieve all VRF IP Reservations in the VRF +*VrfsApi* | [**findVrfIPReservations**](docs/VrfsApi.md#findVrfIPReservations) | **GET** /vrfs/{id}/ips | Retrieve all VRF IP Reservations in the VRF *VrfsApi* | [**findVrfs**](docs/VrfsApi.md#findVrfs) | **GET** /projects/{id}/vrfs | Retrieve all VRFs in the project *VrfsApi* | [**updateVrf**](docs/VrfsApi.md#updateVrf) | **PUT** /vrfs/{id} | Update the VRF @@ -362,6 +362,8 @@ Class | Method | HTTP request | Description - [CreateSelfServiceReservationRequest](docs/CreateSelfServiceReservationRequest.md) - [CreateSelfServiceReservationRequestPeriod](docs/CreateSelfServiceReservationRequestPeriod.md) - [CreateVrfRequest](docs/CreateVrfRequest.md) + - [DefaultIPReservation](docs/DefaultIPReservation.md) + - [DefaultIPReservationAllOf](docs/DefaultIPReservationAllOf.md) - [Device](docs/Device.md) - [DeviceActionsInner](docs/DeviceActionsInner.md) - [DeviceCreateInput](docs/DeviceCreateInput.md) @@ -384,21 +386,19 @@ Class | Method | HTTP request | Description - [Facility](docs/Facility.md) - [FacilityList](docs/FacilityList.md) - [FindIPAddressById200Response](docs/FindIPAddressById200Response.md) - - [FindMetalGatewayById200Response](docs/FindMetalGatewayById200Response.md) - [GlobalBgpRange](docs/GlobalBgpRange.md) - [GlobalBgpRangeList](docs/GlobalBgpRangeList.md) - [HardwareReservation](docs/HardwareReservation.md) - [HardwareReservationList](docs/HardwareReservationList.md) - [Href](docs/Href.md) + - [HrefOnly](docs/HrefOnly.md) - [IPAssignment](docs/IPAssignment.md) - [IPAssignmentInput](docs/IPAssignmentInput.md) - [IPAssignmentList](docs/IPAssignmentList.md) - [IPAssignmentMetro](docs/IPAssignmentMetro.md) - [IPAvailabilitiesList](docs/IPAvailabilitiesList.md) - [IPReservation](docs/IPReservation.md) - - [IPReservationFacility](docs/IPReservationFacility.md) - [IPReservationList](docs/IPReservationList.md) - - [IPReservationListIpAddressesInner](docs/IPReservationListIpAddressesInner.md) - [IPReservationMetro](docs/IPReservationMetro.md) - [IPReservationRequestInput](docs/IPReservationRequestInput.md) - [InstancesBatchCreateInput](docs/InstancesBatchCreateInput.md) @@ -424,8 +424,8 @@ Class | Method | HTTP request | Description - [Meta](docs/Meta.md) - [MetalGateway](docs/MetalGateway.md) - [MetalGatewayInput](docs/MetalGatewayInput.md) + - [MetalGatewayIpReservation](docs/MetalGatewayIpReservation.md) - [MetalGatewayList](docs/MetalGatewayList.md) - - [MetalGatewayListMetalGatewaysInner](docs/MetalGatewayListMetalGatewaysInner.md) - [MetalGatewayLite](docs/MetalGatewayLite.md) - [Metro](docs/Metro.md) - [MetroCapacityList](docs/MetroCapacityList.md) @@ -467,7 +467,6 @@ Class | Method | HTTP request | Description - [ProjectUsage](docs/ProjectUsage.md) - [ProjectUsageList](docs/ProjectUsageList.md) - [RecoveryCodeList](docs/RecoveryCodeList.md) - - [RequestIPReservation201Response](docs/RequestIPReservation201Response.md) - [RequestIPReservationRequest](docs/RequestIPReservationRequest.md) - [SSHKey](docs/SSHKey.md) - [SSHKeyCreateInput](docs/SSHKeyCreateInput.md) @@ -514,11 +513,11 @@ Class | Method | HTTP request | Description - [VirtualNetworkList](docs/VirtualNetworkList.md) - [Vrf](docs/Vrf.md) - [VrfCreateInput](docs/VrfCreateInput.md) - - [VrfIpReservation](docs/VrfIpReservation.md) - - [VrfIpReservationCreateInput](docs/VrfIpReservationCreateInput.md) - - [VrfIpReservationList](docs/VrfIpReservationList.md) + - [VrfIPReservation](docs/VrfIPReservation.md) + - [VrfIPReservationAllOf](docs/VrfIPReservationAllOf.md) + - [VrfIPReservationCreateInput](docs/VrfIPReservationCreateInput.md) + - [VrfIPReservationList](docs/VrfIPReservationList.md) - [VrfList](docs/VrfList.md) - - [VrfMetalGateway](docs/VrfMetalGateway.md) - [VrfMetalGatewayCreateInput](docs/VrfMetalGatewayCreateInput.md) - [VrfUpdateInput](docs/VrfUpdateInput.md) - [VrfVirtualCircuit](docs/VrfVirtualCircuit.md) diff --git a/equinix-openapi-metal/api/openapi.yaml b/equinix-openapi-metal/api/openapi.yaml index b596de814..9f423438e 100644 --- a/equinix-openapi-metal/api/openapi.yaml +++ b/equinix-openapi-metal/api/openapi.yaml @@ -3853,7 +3853,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/findMetalGatewayById_200_response' + $ref: '#/components/schemas/MetalGateway' description: ok "401": content: @@ -7685,7 +7685,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/requestIPReservation_201_response' + $ref: '#/components/schemas/IPReservation' description: created "401": content: @@ -8997,7 +8997,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/findMetalGatewayById_200_response' + $ref: '#/components/schemas/MetalGateway' description: created "401": content: @@ -10986,7 +10986,7 @@ paths: /vrfs/{id}/ips: get: description: Returns the list of VRF IP Reservations for the VRF. - operationId: findVrfIpReservations + operationId: findVrfIPReservations parameters: - description: VRF UUID explode: false @@ -11026,7 +11026,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/VrfIpReservationList' + $ref: '#/components/schemas/VrfIPReservationList' description: ok "403": content: @@ -14413,6 +14413,10 @@ components: required: - href type: object + HrefOnly: + additionalProperties: false + allOf: + - $ref: '#/components/schemas/Href' IPAssignment: example: address: address @@ -14555,15 +14559,80 @@ components: type: array type: object IPReservation: + description: Base class for all IP Reservations + discriminator: + mapping: + vrf: '#/components/schemas/VrfIPReservation' + global_ipv4: '#/components/schemas/DefaultIPReservation' + public_ipv4: '#/components/schemas/DefaultIPReservation' + private_ipv4: '#/components/schemas/DefaultIPReservation' + public_ipv6: '#/components/schemas/DefaultIPReservation' + propertyName: type + example: + address: address + bill: true + created_at: 2000-01-23T04:56:07.000+00:00 + project: + devices: + - href: href + - href: href + volumes: + - href: href + - href: href + created_at: 2000-01-23T04:56:07.000+00:00 + memberships: + - href: href + - href: href + bgp_config: + href: href + max_devices: "{}" + ssh_keys: + - href: href + - href: href + updated_at: 2000-01-23T04:56:07.000+00:00 + invitations: + - href: href + - href: href + members: + - href: href + - href: href + name: name + network_status: "{}" + customdata: "{}" + id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + payment_method: + href: href + project_lite: + href: href + type: type + manageable: true + network: network + tags: + - tags + - tags + metal_gateway: + gateway_address: gateway_address + updated_at: 2000-01-23T04:56:07.000+00:00 + vlan: 1.4658129805029452 + created_at: 2000-01-23T04:56:07.000+00:00 + href: href + id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + state: ready + address_family: 0 + public: true + management: true + netmask: netmask + metro: null + cidr: 6 + details: details + href: href + id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + state: state + customdata: "{}" + gateway: gateway properties: - addon: - type: boolean address_family: type: integer - assignments: - items: - $ref: '#/components/schemas/IPAssignment' - type: array bill: type: boolean cidr: @@ -14571,12 +14640,6 @@ components: created_at: format: date-time type: string - enabled: - type: boolean - facility: - $ref: '#/components/schemas/IPReservation_facility' - global_ip: - type: boolean href: type: string id: @@ -14602,16 +14665,157 @@ components: items: type: string type: array + details: + type: string + customdata: + type: object + project: + $ref: '#/components/schemas/Project' + project_lite: + $ref: '#/components/schemas/Href' + address: + type: string + gateway: + type: string + type: + type: string + required: + - type + DefaultIPReservation: + additionalProperties: false + allOf: + - $ref: '#/components/schemas/IPReservation' + - $ref: '#/components/schemas/DefaultIPReservation_allOf' type: object IPReservationList: example: ip_addresses: - - null - - null + - address: address + bill: true + created_at: 2000-01-23T04:56:07.000+00:00 + project: + devices: + - href: href + - href: href + volumes: + - href: href + - href: href + created_at: 2000-01-23T04:56:07.000+00:00 + memberships: + - href: href + - href: href + bgp_config: + href: href + max_devices: "{}" + ssh_keys: + - href: href + - href: href + updated_at: 2000-01-23T04:56:07.000+00:00 + invitations: + - href: href + - href: href + members: + - href: href + - href: href + name: name + network_status: "{}" + customdata: "{}" + id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + payment_method: + href: href + project_lite: + href: href + type: type + manageable: true + network: network + tags: + - tags + - tags + metal_gateway: + gateway_address: gateway_address + updated_at: 2000-01-23T04:56:07.000+00:00 + vlan: 1.4658129805029452 + created_at: 2000-01-23T04:56:07.000+00:00 + href: href + id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + state: ready + address_family: 0 + public: true + management: true + netmask: netmask + metro: null + cidr: 6 + details: details + href: href + id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + state: state + customdata: "{}" + gateway: gateway + - address: address + bill: true + created_at: 2000-01-23T04:56:07.000+00:00 + project: + devices: + - href: href + - href: href + volumes: + - href: href + - href: href + created_at: 2000-01-23T04:56:07.000+00:00 + memberships: + - href: href + - href: href + bgp_config: + href: href + max_devices: "{}" + ssh_keys: + - href: href + - href: href + updated_at: 2000-01-23T04:56:07.000+00:00 + invitations: + - href: href + - href: href + members: + - href: href + - href: href + name: name + network_status: "{}" + customdata: "{}" + id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + payment_method: + href: href + project_lite: + href: href + type: type + manageable: true + network: network + tags: + - tags + - tags + metal_gateway: + gateway_address: gateway_address + updated_at: 2000-01-23T04:56:07.000+00:00 + vlan: 1.4658129805029452 + created_at: 2000-01-23T04:56:07.000+00:00 + href: href + id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + state: ready + address_family: 0 + public: true + management: true + netmask: netmask + metro: null + cidr: 6 + details: details + href: href + id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + state: state + customdata: "{}" + gateway: gateway properties: ip_addresses: items: - $ref: '#/components/schemas/IPReservationList_ip_addresses_inner' + $ref: '#/components/schemas/IPReservation' type: array type: object IPReservationRequestInput: @@ -15414,97 +15618,149 @@ components: type: integer type: object MetalGateway: - properties: - created_at: - format: date-time - type: string - created_by: - $ref: '#/components/schemas/Href' - href: - type: string - id: - format: uuid - type: string - ip_reservation: - $ref: '#/components/schemas/IPReservation' - project: - $ref: '#/components/schemas/Project' - state: - description: "The current state of the Metal Gateway. 'Ready' indicates\ - \ the gateway record has been configured, but is currently not active\ - \ on the network. 'Active' indicates the gateway has been configured on\ - \ the network. 'Deleting' is a temporary state used to indicate that the\ - \ gateway is in the process of being un-configured from the network, after\ - \ which the gateway record will be deleted." - enum: - - ready - - active - - deleting - type: string - updated_at: - format: date-time - type: string + example: virtual_network: - $ref: '#/components/schemas/VirtualNetwork' - type: object - MetalGatewayInput: - properties: - ip_reservation_id: - description: The UUID of an IP reservation that belongs to the same project - as where the metal gateway will be created in. This field is required - unless the private IPv4 subnet size is specified. - 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." - type: integer - virtual_network_id: - description: The UUID of a metro virtual network that belongs to the same - project as where the metal gateway will be created in. - format: uuid - type: string - required: - - virtual_network_id - type: object - MetalGatewayList: - example: - MetalGateways: - - null - - null - properties: - MetalGateways: - items: - $ref: '#/components/schemas/MetalGatewayList_MetalGateways_inner' - type: array - type: object - MetalGatewayLite: - example: - gateway_address: gateway_address + vxlan: 0 + metal_gateways: + - href: href + - href: href + metro_code: metro_code + instances: + - href: href + - href: href + metro: + href: href + description: description + href: href + id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + facility: + href: href + assigned_to_virtual_circuit: true + assigned_to: + href: href updated_at: 2000-01-23T04:56:07.000+00:00 - vlan: 1.4658129805029452 + ip_reservation: null created_at: 2000-01-23T04:56:07.000+00:00 + project: + devices: + - href: href + - href: href + volumes: + - href: href + - href: href + created_at: 2000-01-23T04:56:07.000+00:00 + memberships: + - href: href + - href: href + bgp_config: + href: href + max_devices: "{}" + ssh_keys: + - href: href + - href: href + updated_at: 2000-01-23T04:56:07.000+00:00 + invitations: + - href: href + - href: href + members: + - href: href + - href: href + name: name + network_status: "{}" + customdata: "{}" + id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + payment_method: + href: href href: href id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 state: ready + vrf: + local_asn: 6 + ip_ranges: + - ip_ranges + - ip_ranges + metro: + country: country + code: code + name: name + id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + name: name + description: description + project: + devices: + - href: href + - href: href + volumes: + - href: href + - href: href + created_at: 2000-01-23T04:56:07.000+00:00 + memberships: + - href: href + - href: href + bgp_config: + href: href + max_devices: "{}" + ssh_keys: + - href: href + - href: href + updated_at: 2000-01-23T04:56:07.000+00:00 + invitations: + - href: href + - href: href + members: + - href: href + - href: href + name: name + network_status: "{}" + customdata: "{}" + id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + payment_method: + href: href + id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + href: href + created_by: + avatar_thumb_url: avatar_thumb_url + last_login_at: 2000-01-23T04:56:07.000+00:00 + max_projects: 5 + timezone: timezone + created_at: 2000-01-23T04:56:07.000+00:00 + last_name: last_name + short_id: short_id + fraud_score: fraud_score + emails: + - href: href + - href: href + features: + - features + - features + full_name: full_name + avatar_url: avatar_url + updated_at: 2000-01-23T04:56:07.000+00:00 + phone_number: phone_number + customdata: "{}" + href: href + id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + first_name: first_name + max_organizations: 1 + two_factor_auth: two_factor_auth + email: email + created_by: + href: href properties: created_at: format: date-time type: string - gateway_address: - description: "The gateway address with subnet CIDR value for this Metal\ - \ Gateway. For example, a Metal Gateway using an IP reservation with block\ - \ 10.1.2.0/27 would have a gateway address of 10.1.2.1/27." - type: string + created_by: + $ref: '#/components/schemas/Href' href: type: string id: format: uuid type: string + ip_reservation: + $ref: '#/components/schemas/MetalGateway_ip_reservation' + project: + $ref: '#/components/schemas/Project' state: description: "The current state of the Metal Gateway. 'Ready' indicates\ \ the gateway record has been configured, but is currently not active\ @@ -15520,97 +15776,427 @@ components: updated_at: format: date-time type: string - vlan: - description: "The VLAN id of the Virtual Network record associated to this\ - \ Metal Gateway. Example: 1001." - type: number + virtual_network: + $ref: '#/components/schemas/VirtualNetwork' + vrf: + $ref: '#/components/schemas/Vrf' type: object - Metro: - example: - country: country - code: code - name: name - id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + MetalGatewayInput: properties: - code: - type: string - country: - type: string - id: + ip_reservation_id: + description: The UUID of an IP reservation that belongs to the same project + as where the metal gateway will be created in. This field is required + unless the private IPv4 subnet size is specified. format: uuid type: string - name: + 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." + type: integer + virtual_network_id: + description: The UUID of a metro virtual network that belongs to the same + project as where the metal gateway will be created in. + format: uuid type: string + required: + - virtual_network_id type: object - MetroCapacityList: + MetalGatewayList: example: - capacity: - hk: - c2.medium.x86: - level: level - baremetal_2a2: - level: level - m2.xlarge.x86: - level: level - baremetal_1: - level: level - baremetal_0: - level: level - baremetal_2a: - level: level - baremetal_3: - level: level - baremetal_s: - level: level - baremetal_2: - level: level - sv: - c2.medium.x86: - level: level - baremetal_2a2: - level: level - m2.xlarge.x86: - level: level - baremetal_1: - level: level - baremetal_0: - level: level - baremetal_2a: - level: level - baremetal_3: - level: level - baremetal_s: - level: level - baremetal_2: - level: level - ch: - c2.medium.x86: - level: level - baremetal_2a2: - level: level - m2.xlarge.x86: - level: level - baremetal_1: - level: level - baremetal_0: - level: level - baremetal_2a: - level: level - baremetal_3: - level: level - baremetal_s: - level: level - baremetal_2: - level: level - ty: - c2.medium.x86: - level: level - baremetal_2a2: - level: level - m2.xlarge.x86: - level: level - baremetal_1: - level: level + metal_gateways: + - virtual_network: + vxlan: 0 + metal_gateways: + - href: href + - href: href + metro_code: metro_code + instances: + - href: href + - href: href + metro: + href: href + description: description + href: href + id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + facility: + href: href + assigned_to_virtual_circuit: true + assigned_to: + href: href + updated_at: 2000-01-23T04:56:07.000+00:00 + ip_reservation: null + created_at: 2000-01-23T04:56:07.000+00:00 + project: + devices: + - href: href + - href: href + volumes: + - href: href + - href: href + created_at: 2000-01-23T04:56:07.000+00:00 + memberships: + - href: href + - href: href + bgp_config: + href: href + max_devices: "{}" + ssh_keys: + - href: href + - href: href + updated_at: 2000-01-23T04:56:07.000+00:00 + invitations: + - href: href + - href: href + members: + - href: href + - href: href + name: name + network_status: "{}" + customdata: "{}" + id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + payment_method: + href: href + href: href + id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + state: ready + vrf: + local_asn: 6 + ip_ranges: + - ip_ranges + - ip_ranges + metro: + country: country + code: code + name: name + id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + name: name + description: description + project: + devices: + - href: href + - href: href + volumes: + - href: href + - href: href + created_at: 2000-01-23T04:56:07.000+00:00 + memberships: + - href: href + - href: href + bgp_config: + href: href + max_devices: "{}" + ssh_keys: + - href: href + - href: href + updated_at: 2000-01-23T04:56:07.000+00:00 + invitations: + - href: href + - href: href + members: + - href: href + - href: href + name: name + network_status: "{}" + customdata: "{}" + id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + payment_method: + href: href + id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + href: href + created_by: + avatar_thumb_url: avatar_thumb_url + last_login_at: 2000-01-23T04:56:07.000+00:00 + max_projects: 5 + timezone: timezone + created_at: 2000-01-23T04:56:07.000+00:00 + last_name: last_name + short_id: short_id + fraud_score: fraud_score + emails: + - href: href + - href: href + features: + - features + - features + full_name: full_name + avatar_url: avatar_url + updated_at: 2000-01-23T04:56:07.000+00:00 + phone_number: phone_number + customdata: "{}" + href: href + id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + first_name: first_name + max_organizations: 1 + two_factor_auth: two_factor_auth + email: email + created_by: + href: href + - virtual_network: + vxlan: 0 + metal_gateways: + - href: href + - href: href + metro_code: metro_code + instances: + - href: href + - href: href + metro: + href: href + description: description + href: href + id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + facility: + href: href + assigned_to_virtual_circuit: true + assigned_to: + href: href + updated_at: 2000-01-23T04:56:07.000+00:00 + ip_reservation: null + created_at: 2000-01-23T04:56:07.000+00:00 + project: + devices: + - href: href + - href: href + volumes: + - href: href + - href: href + created_at: 2000-01-23T04:56:07.000+00:00 + memberships: + - href: href + - href: href + bgp_config: + href: href + max_devices: "{}" + ssh_keys: + - href: href + - href: href + updated_at: 2000-01-23T04:56:07.000+00:00 + invitations: + - href: href + - href: href + members: + - href: href + - href: href + name: name + network_status: "{}" + customdata: "{}" + id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + payment_method: + href: href + href: href + id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + state: ready + vrf: + local_asn: 6 + ip_ranges: + - ip_ranges + - ip_ranges + metro: + country: country + code: code + name: name + id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + name: name + description: description + project: + devices: + - href: href + - href: href + volumes: + - href: href + - href: href + created_at: 2000-01-23T04:56:07.000+00:00 + memberships: + - href: href + - href: href + bgp_config: + href: href + max_devices: "{}" + ssh_keys: + - href: href + - href: href + updated_at: 2000-01-23T04:56:07.000+00:00 + invitations: + - href: href + - href: href + members: + - href: href + - href: href + name: name + network_status: "{}" + customdata: "{}" + id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + payment_method: + href: href + id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + href: href + created_by: + avatar_thumb_url: avatar_thumb_url + last_login_at: 2000-01-23T04:56:07.000+00:00 + max_projects: 5 + timezone: timezone + created_at: 2000-01-23T04:56:07.000+00:00 + last_name: last_name + short_id: short_id + fraud_score: fraud_score + emails: + - href: href + - href: href + features: + - features + - features + full_name: full_name + avatar_url: avatar_url + updated_at: 2000-01-23T04:56:07.000+00:00 + phone_number: phone_number + customdata: "{}" + href: href + id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + first_name: first_name + max_organizations: 1 + two_factor_auth: two_factor_auth + email: email + created_by: + href: href + properties: + metal_gateways: + items: + $ref: '#/components/schemas/MetalGateway' + type: array + type: object + MetalGatewayLite: + example: + gateway_address: gateway_address + updated_at: 2000-01-23T04:56:07.000+00:00 + vlan: 1.4658129805029452 + created_at: 2000-01-23T04:56:07.000+00:00 + href: href + id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + state: ready + properties: + created_at: + format: date-time + type: string + gateway_address: + description: "The gateway address with subnet CIDR value for this Metal\ + \ Gateway. For example, a Metal Gateway using an IP reservation with block\ + \ 10.1.2.0/27 would have a gateway address of 10.1.2.1/27." + type: string + href: + type: string + id: + format: uuid + type: string + state: + description: "The current state of the Metal Gateway. 'Ready' indicates\ + \ the gateway record has been configured, but is currently not active\ + \ on the network. 'Active' indicates the gateway has been configured on\ + \ the network. 'Deleting' is a temporary state used to indicate that the\ + \ gateway is in the process of being un-configured from the network, after\ + \ which the gateway record will be deleted." + enum: + - ready + - active + - deleting + type: string + updated_at: + format: date-time + type: string + vlan: + description: "The VLAN id of the Virtual Network record associated to this\ + \ Metal Gateway. Example: 1001." + type: number + type: object + Metro: + example: + country: country + code: code + name: name + id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + properties: + code: + type: string + country: + type: string + id: + format: uuid + type: string + name: + type: string + type: object + MetroCapacityList: + example: + capacity: + hk: + c2.medium.x86: + level: level + baremetal_2a2: + level: level + m2.xlarge.x86: + level: level + baremetal_1: + level: level + baremetal_0: + level: level + baremetal_2a: + level: level + baremetal_3: + level: level + baremetal_s: + level: level + baremetal_2: + level: level + sv: + c2.medium.x86: + level: level + baremetal_2a2: + level: level + m2.xlarge.x86: + level: level + baremetal_1: + level: level + baremetal_0: + level: level + baremetal_2a: + level: level + baremetal_3: + level: level + baremetal_s: + level: level + baremetal_2: + level: level + ch: + c2.medium.x86: + level: level + baremetal_2a2: + level: level + m2.xlarge.x86: + level: level + baremetal_1: + level: level + baremetal_0: + level: level + baremetal_2a: + level: level + baremetal_3: + level: level + baremetal_s: + level: level + baremetal_2: + level: level + ty: + c2.medium.x86: + level: level + baremetal_2a2: + level: level + m2.xlarge.x86: + level: level + baremetal_1: + level: level baremetal_0: level: level baremetal_2a: @@ -18632,650 +19218,286 @@ components: priority: enum: - urgent - - high - - medium - - low - type: string - project_id: - type: string - subject: - type: string - required: - - message - - subject - type: object - Timeframe: - example: - started_at: 2000-01-23T04:56:07.000+00:00 - ended_at: 2000-01-23T04:56:07.000+00:00 - properties: - ended_at: - format: date-time - type: string - started_at: - format: date-time - type: string - required: - - ended_at - - started_at - type: object - TransferRequest: - example: - updated_at: 2000-01-23T04:56:07.000+00:00 - target_organization: - href: href - created_at: 2000-01-23T04:56:07.000+00:00 - project: - href: href - href: href - id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - properties: - created_at: - format: date-time - type: string - href: - type: string - id: - format: uuid - type: string - project: - $ref: '#/components/schemas/Href' - target_organization: - $ref: '#/components/schemas/Href' - updated_at: - format: date-time - type: string - type: object - TransferRequestInput: - example: - target_organization_id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - properties: - target_organization_id: - format: uuid - type: string - type: object - TransferRequestList: - example: - transfers: - - updated_at: 2000-01-23T04:56:07.000+00:00 - target_organization: - href: href - created_at: 2000-01-23T04:56:07.000+00:00 - project: - href: href - href: href - id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - - updated_at: 2000-01-23T04:56:07.000+00:00 - target_organization: - href: href - created_at: 2000-01-23T04:56:07.000+00:00 - project: - href: href - href: href - id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - properties: - transfers: - items: - $ref: '#/components/schemas/TransferRequest' - type: array - type: object - UpdateEmailInput: - example: - default: true - properties: - default: - type: boolean - type: object - User: - example: - avatar_thumb_url: avatar_thumb_url - last_login_at: 2000-01-23T04:56:07.000+00:00 - max_projects: 1 - timezone: timezone - created_at: 2000-01-23T04:56:07.000+00:00 - last_name: last_name - short_id: short_id - fraud_score: fraud_score - emails: - - href: href - - href: href - full_name: full_name - avatar_url: avatar_url - updated_at: 2000-01-23T04:56:07.000+00:00 - phone_number: phone_number - customdata: "{}" - href: href - id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - first_name: first_name - max_organizations: 6 - two_factor_auth: two_factor_auth - email: email - properties: - avatar_thumb_url: - type: string - avatar_url: - type: string - created_at: - format: date-time - type: string - customdata: - type: object - email: - type: string - emails: - items: - $ref: '#/components/schemas/Href' - type: array - first_name: - type: string - fraud_score: - type: string - full_name: - type: string - href: - type: string - id: - format: uuid - type: string - last_login_at: - format: date-time - type: string - last_name: - type: string - max_organizations: - type: integer - max_projects: - type: integer - phone_number: - type: string - short_id: - type: string - timezone: - type: string - two_factor_auth: - type: string - updated_at: - format: date-time - type: string - type: object - UserCreateInput: - example: - level: level - timezone: timezone - last_name: last_name - avatar: "" - title: title - emails: - - default: true - address: address - - default: true - address: address - social_accounts: "{}" - password: password - verified_at: 2000-01-23T04:56:07.000+00:00 - company_name: company_name - company_url: company_url - phone_number: phone_number - customdata: "{}" - locked: true - first_name: first_name - two_factor_auth: two_factor_auth - properties: - avatar: - format: binary - type: string - company_name: - type: string - company_url: - type: string - customdata: - type: object - emails: - items: - $ref: '#/components/schemas/EmailInput' - type: array - first_name: - type: string - last_name: - type: string - level: - type: string - locked: - type: boolean - password: - type: string - phone_number: + - high + - medium + - low type: string - social_accounts: - type: object - timezone: + project_id: type: string - title: + subject: type: string - two_factor_auth: + required: + - message + - subject + type: object + Timeframe: + example: + started_at: 2000-01-23T04:56:07.000+00:00 + ended_at: 2000-01-23T04:56:07.000+00:00 + properties: + ended_at: + format: date-time type: string - verified_at: + started_at: format: date-time type: string required: - - emails - - first_name - - last_name + - ended_at + - started_at type: object - UserList: + TransferRequest: example: - meta: - next: - href: href - total: 0 - last: - href: href - previous: - href: href - self: - href: href - first: - href: href - users: - - avatar_thumb_url: avatar_thumb_url - last_login_at: 2000-01-23T04:56:07.000+00:00 - max_projects: 1 - timezone: timezone - created_at: 2000-01-23T04:56:07.000+00:00 - last_name: last_name - short_id: short_id - fraud_score: fraud_score - emails: - - href: href - - href: href - full_name: full_name - avatar_url: avatar_url - updated_at: 2000-01-23T04:56:07.000+00:00 - phone_number: phone_number - customdata: "{}" + updated_at: 2000-01-23T04:56:07.000+00:00 + target_organization: href: href - id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - first_name: first_name - max_organizations: 6 - two_factor_auth: two_factor_auth - email: email - - avatar_thumb_url: avatar_thumb_url - last_login_at: 2000-01-23T04:56:07.000+00:00 - max_projects: 1 - timezone: timezone - created_at: 2000-01-23T04:56:07.000+00:00 - last_name: last_name - short_id: short_id - fraud_score: fraud_score - emails: - - href: href - - href: href - full_name: full_name - avatar_url: avatar_url - updated_at: 2000-01-23T04:56:07.000+00:00 - phone_number: phone_number - customdata: "{}" + created_at: 2000-01-23T04:56:07.000+00:00 + project: href: href - id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - first_name: first_name - max_organizations: 6 - two_factor_auth: two_factor_auth - email: email - properties: - meta: - $ref: '#/components/schemas/Meta' - users: - items: - $ref: '#/components/schemas/User' - type: array - type: object - UserLite: + href: href + id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 properties: - avatar_thumb_url: - description: Avatar thumbnail URL of the User - type: string created_at: - description: When the user was created format: date-time type: string - email: - description: Primary email address of the User - type: string - first_name: - description: First name of the User - type: string - full_name: - description: Full name of the User - type: string href: - description: API URL uniquely representing the User type: string id: - description: ID of the User format: uuid type: string - last_name: - description: Last name of the User - type: string - short_id: - description: Short ID of the User - type: string + project: + $ref: '#/components/schemas/Href' + target_organization: + $ref: '#/components/schemas/Href' updated_at: - description: When the user details were last updated format: date-time type: string - required: - - id - - short_id type: object - UserUpdateInput: + TransferRequestInput: example: - password: password + target_organization_id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + properties: + target_organization_id: + format: uuid + type: string + type: object + TransferRequestList: + example: + transfers: + - updated_at: 2000-01-23T04:56:07.000+00:00 + target_organization: + href: href + created_at: 2000-01-23T04:56:07.000+00:00 + project: + href: href + href: href + id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + - updated_at: 2000-01-23T04:56:07.000+00:00 + target_organization: + href: href + created_at: 2000-01-23T04:56:07.000+00:00 + project: + href: href + href: href + id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + properties: + transfers: + items: + $ref: '#/components/schemas/TransferRequest' + type: array + type: object + UpdateEmailInput: + example: + default: true + properties: + default: + type: boolean + type: object + User: + example: + avatar_thumb_url: avatar_thumb_url + last_login_at: 2000-01-23T04:56:07.000+00:00 + max_projects: 5 timezone: timezone + created_at: 2000-01-23T04:56:07.000+00:00 last_name: last_name + short_id: short_id + fraud_score: fraud_score + emails: + - href: href + - href: href + features: + - features + - features + full_name: full_name + avatar_url: avatar_url + updated_at: 2000-01-23T04:56:07.000+00:00 phone_number: phone_number customdata: "{}" + href: href + id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 first_name: first_name + max_organizations: 1 + two_factor_auth: two_factor_auth + email: email properties: - customdata: - type: object - first_name: - type: string - last_name: - type: string - password: - type: string - phone_number: - type: string - timezone: - type: string - type: object - VirtualCircuit: - properties: - bill: - default: false - description: "True if the Virtual Circuit is being billed. Currently, only\ - \ Virtual Circuits that are created with A-side service tokens will be\ - \ billed. Usage will start the first time the Virtual Circuit becomes\ - \ active, and will not stop until it is deleted." - type: boolean - description: + avatar_thumb_url: type: string - id: - format: uuid + avatar_url: type: string - name: + created_at: + format: date-time type: string - nni_vlan: - type: integer - port: - $ref: '#/components/schemas/Href' - project: - $ref: '#/components/schemas/Href' - speed: - description: integer representing bps speed - type: integer - status: + customdata: + type: object + email: type: string - tags: + emails: items: - type: string + $ref: '#/components/schemas/Href' type: array - virtual_network: - $ref: '#/components/schemas/Href' - vnid: - type: integer - required: - - bill - - description - - id - - name - - nni_vlan - - port - - project - - status - - tags - - virtual_network - - vnid - type: object - VirtualCircuitCreateInput: - properties: - description: + first_name: + type: string + fraud_score: type: string - name: + full_name: type: string - nni_vlan: - maximum: 4094 - minimum: 2 - type: integer - project: + href: + type: string + id: format: uuid type: string - speed: - description: speed can be passed as integer number representing bps speed - or string (e.g. '52m' or '100g' or '4 gbps') + last_login_at: + format: date-time + type: string + last_name: + type: string + max_organizations: type: integer - tags: - items: - type: string - type: array - vnid: - description: A Virtual Network record UUID or the VNID of a Virtual Network - in your project (sent as integer). - format: uuid + max_projects: + type: integer + phone_number: type: string - type: object - VirtualCircuitList: - example: - virtual_circuits: - - null - - null - properties: - virtual_circuits: - items: - $ref: '#/components/schemas/VirtualCircuitList_virtual_circuits_inner' - type: array - type: object - VirtualCircuitUpdateInput: - properties: - description: + short_id: type: string - name: + timezone: type: string - speed: - description: Speed can be changed only if it is a dedicated connection + two_factor_auth: type: string - tags: + updated_at: + format: date-time + type: string + features: items: type: string type: array - vnid: - description: A Virtual Network record UUID or the VNID of a Virtual Network - in your project. - type: string type: object - VirtualNetwork: + UserCreateInput: example: - vxlan: 0 - metal_gateways: - - href: href - - href: href - metro_code: metro_code - instances: - - href: href - - href: href - metro: - href: href - description: description - href: href - id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - facility: - href: href - assigned_to_virtual_circuit: true - assigned_to: - href: href + level: level + timezone: timezone + last_name: last_name + avatar: "" + title: title + emails: + - default: true + address: address + - default: true + address: address + social_accounts: "{}" + password: password + verified_at: 2000-01-23T04:56:07.000+00:00 + company_name: company_name + company_url: company_url + phone_number: phone_number + customdata: "{}" + locked: true + first_name: first_name + two_factor_auth: two_factor_auth properties: - assigned_to: - $ref: '#/components/schemas/Href' - assigned_to_virtual_circuit: - description: True if the virtual network is attached to a virtual circuit. - False if not. - type: boolean - description: + avatar: + format: binary type: string - facility: - $ref: '#/components/schemas/Href' - href: + company_name: type: string - id: - format: uuid + company_url: type: string - instances: - description: A list of instances with ports currently associated to this - Virtual Network. - items: - $ref: '#/components/schemas/Href' - type: array - metal_gateways: - description: A list of metal gateways currently associated to this Virtual - Network. + customdata: + type: object + emails: items: - $ref: '#/components/schemas/Href' + $ref: '#/components/schemas/EmailInput' type: array - metro: - $ref: '#/components/schemas/Href' - metro_code: - description: The Metro code of the metro in which this Virtual Network is - defined. + first_name: type: string - vxlan: - type: integer - type: object - VirtualNetworkCreateInput: - example: - vxlan: 1099 - project_id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - metro: metro - description: description - facility: facility - properties: - description: + last_name: type: string - facility: - description: The UUID (or facility code) for the Facility in which to create - this Virtual network. + level: type: string - metro: - description: The UUID (or metro code) for the Metro in which to create this - Virtual Network. + locked: + type: boolean + password: type: string - project_id: - format: uuid + phone_number: + type: string + social_accounts: + type: object + timezone: + type: string + title: + type: string + two_factor_auth: + type: string + verified_at: + format: date-time 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 + - emails + - first_name + - last_name type: object - VirtualNetworkList: + UserList: example: - virtual_networks: - - vxlan: 0 - metal_gateways: - - href: href - - href: href - metro_code: metro_code - instances: - - href: href - - href: href - metro: - href: href - description: description - href: href - id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - facility: - href: href - assigned_to_virtual_circuit: true - assigned_to: - href: href - - vxlan: 0 - metal_gateways: - - href: href - - href: href - metro_code: metro_code - instances: - - href: href - - href: href - metro: - href: href - description: description - href: href - id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - facility: + meta: + next: href: href - assigned_to_virtual_circuit: true - assigned_to: + total: 0 + last: href: href - properties: - virtual_networks: - items: - $ref: '#/components/schemas/VirtualNetwork' - type: array - type: object - Vrf: - example: - local_asn: 0 - ip_ranges: - - ip_ranges - - ip_ranges - metro: - country: country - code: code - name: name - id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - name: name - description: description - project: - devices: - - href: href - - href: href - volumes: - - href: href - - href: href - created_at: 2000-01-23T04:56:07.000+00:00 - memberships: - - href: href - - href: href - bgp_config: + previous: href: href - max_devices: "{}" - ssh_keys: + self: + href: href + first: + href: href + users: + - avatar_thumb_url: avatar_thumb_url + last_login_at: 2000-01-23T04:56:07.000+00:00 + max_projects: 5 + timezone: timezone + created_at: 2000-01-23T04:56:07.000+00:00 + last_name: last_name + short_id: short_id + fraud_score: fraud_score + emails: - href: href - href: href + features: + - features + - features + full_name: full_name + avatar_url: avatar_url updated_at: 2000-01-23T04:56:07.000+00:00 - invitations: - - href: href - - href: href - members: - - href: href - - href: href - name: name - network_status: "{}" + phone_number: phone_number customdata: "{}" + href: href id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - payment_method: - href: href - id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - href: href - created_by: - avatar_thumb_url: avatar_thumb_url + first_name: first_name + max_organizations: 1 + two_factor_auth: two_factor_auth + email: email + - avatar_thumb_url: avatar_thumb_url last_login_at: 2000-01-23T04:56:07.000+00:00 - max_projects: 1 + max_projects: 5 timezone: timezone created_at: 2000-01-23T04:56:07.000+00:00 last_name: last_name @@ -19284,6 +19506,9 @@ components: emails: - href: href - href: href + features: + - features + - features full_name: full_name avatar_url: avatar_url updated_at: 2000-01-23T04:56:07.000+00:00 @@ -19292,544 +19517,530 @@ components: href: href id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 first_name: first_name - max_organizations: 6 + max_organizations: 1 two_factor_auth: two_factor_auth email: email properties: - id: - format: uuid - type: string - name: - type: string - description: - description: Optional field that can be set to describe the VRF - type: string - local_asn: - description: A 4-byte ASN associated with the VRF. - format: int32 - type: integer - ip_ranges: - description: "A list of CIDR network addresses. Like [\"10.0.0.0/16\", \"\ - 2001:d78::/56\"]." + meta: + $ref: '#/components/schemas/Meta' + users: items: - type: string + $ref: '#/components/schemas/User' type: array - project: - $ref: '#/components/schemas/Project' - metro: - $ref: '#/components/schemas/Metro' - created_by: - $ref: '#/components/schemas/User' - href: - type: string type: object - VrfCreateInput: + UserLite: 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 + avatar_thumb_url: + description: Avatar thumbnail URL of the User 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\ - \ /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 - VrfIpRangeList: - description: "A list of CIDR network addresses. Like [\"10.0.0.0/16\", \"2001:d78::/56\"\ - ]." - items: - type: string - type: array - VrfIpRangeUpdateInput: - 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.\ - \ Adding a new CIDR address to the list will result in the creation of a new\ - \ IP Range for this VRF. Removal of an existing CIDR address from the list\ - \ will result in the deletion of an existing IP Range for this VRF. Deleting\ - \ an IP Range will result in the deletion of any VRF IP Reservations contained\ - \ within the IP Range, as well as the VRF IP Reservation\\'s associated Metal\ - \ Gateways or Virtual Circuits. If you do not wish to add or remove IP Ranges,\ - \ either include the full existing list of IP Ranges in the update request,\ - \ or do not specify the `ip_ranges` field in the update request. Specifying\ - \ a value of `[]` will remove all existing IP Ranges from the VRF." - items: - type: string - type: array - VrfIpReservation: - example: - created_at: 2000-01-23T04:56:07.000+00:00 - project: - devices: - - href: href - - href: href - volumes: - - href: href - - href: href - created_at: 2000-01-23T04:56:07.000+00:00 - memberships: - - href: href - - href: href - bgp_config: - href: href - max_devices: "{}" - ssh_keys: - - href: href - - href: href - updated_at: 2000-01-23T04:56:07.000+00:00 - invitations: - - href: href - - href: href - members: - - href: href - - href: href - name: name - network_status: "{}" - customdata: "{}" - id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - payment_method: - href: href - vrf: - local_asn: 0 - ip_ranges: - - ip_ranges - - ip_ranges - metro: - country: country - code: code - name: name - id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - name: name - description: description - project: - devices: - - href: href - - href: href - volumes: - - href: href - - href: href - created_at: 2000-01-23T04:56:07.000+00:00 - memberships: - - href: href - - href: href - bgp_config: - href: href - max_devices: "{}" - ssh_keys: - - href: href - - href: href - updated_at: 2000-01-23T04:56:07.000+00:00 - invitations: - - href: href - - href: href - members: - - href: href - - href: href - name: name - network_status: "{}" - customdata: "{}" - id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - payment_method: - href: href - id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - href: href - created_by: - avatar_thumb_url: avatar_thumb_url - last_login_at: 2000-01-23T04:56:07.000+00:00 - max_projects: 1 - timezone: timezone - created_at: 2000-01-23T04:56:07.000+00:00 - last_name: last_name - short_id: short_id - fraud_score: fraud_score - emails: - - href: href - - href: href - full_name: full_name - avatar_url: avatar_url - updated_at: 2000-01-23T04:56:07.000+00:00 - phone_number: phone_number - customdata: "{}" - href: href - id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - first_name: first_name - max_organizations: 6 - two_factor_auth: two_factor_auth - email: email - type: vrf - created_by: - href: href - network: network - tags: - - tags - - tags - metal_gateway: - gateway_address: gateway_address - updated_at: 2000-01-23T04:56:07.000+00:00 - vlan: 1.4658129805029452 - created_at: 2000-01-23T04:56:07.000+00:00 - href: href - id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - state: ready - address_family: 0 - netmask: netmask - cidr: 6 - details: details - href: href - id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - state: state - properties: - address_family: - type: integer - cidr: - type: integer created_at: + description: When the user was created format: date-time type: string - created_by: - $ref: '#/components/schemas/Href' - details: + email: + description: Primary email address of the User + type: string + first_name: + description: First name of the User + type: string + full_name: + description: Full name of the User type: string href: + description: API URL uniquely representing the User type: string id: + description: ID of the User format: uuid type: string - metal_gateway: - $ref: '#/components/schemas/MetalGatewayLite' - netmask: + last_name: + description: Last name of the User type: string - network: + short_id: + description: Short ID of the User + type: string + updated_at: + description: When the user details were last updated + format: date-time + type: string + required: + - id + - short_id + type: object + UserUpdateInput: + example: + password: password + timezone: timezone + last_name: last_name + phone_number: phone_number + customdata: "{}" + first_name: first_name + properties: + customdata: + type: object + first_name: + type: string + last_name: + type: string + password: + type: string + phone_number: + type: string + timezone: + type: string + type: object + VirtualCircuit: + properties: + bill: + default: false + description: "True if the Virtual Circuit is being billed. Currently, only\ + \ Virtual Circuits that are created with A-side service tokens will be\ + \ billed. Usage will start the first time the Virtual Circuit becomes\ + \ active, and will not stop until it is deleted." + type: boolean + description: + type: string + id: + format: uuid + type: string + name: type: string + nni_vlan: + type: integer + port: + $ref: '#/components/schemas/Href' project: - $ref: '#/components/schemas/Project' - state: + $ref: '#/components/schemas/Href' + speed: + description: integer representing bps speed + type: integer + status: type: string tags: items: type: string type: array - type: - example: vrf - type: string - vrf: - $ref: '#/components/schemas/Vrf' + virtual_network: + $ref: '#/components/schemas/Href' + vnid: + type: integer required: - - vrf + - bill + - description + - id + - name + - nni_vlan + - port + - project + - status + - tags + - virtual_network + - vnid type: object - VrfIpReservationCreateInput: + VirtualCircuitCreateInput: properties: - cidr: - description: The size of the VRF IP Reservation's subnet - example: 16 - type: integer - customdata: - type: object - details: + description: type: string - network: - description: The starting address for this VRF IP Reservation's subnet - example: 10.1.2.0 + name: + type: string + nni_vlan: + maximum: 4094 + minimum: 2 + type: integer + project: + format: uuid type: string + speed: + description: speed can be passed as integer number representing bps speed + or string (e.g. '52m' or '100g' or '4 gbps') + type: integer tags: items: type: string type: array - type: - description: Must be set to 'vrf' - example: vrf - type: string - vrf_id: - description: The ID of the VRF in which this VRF IP Reservation is created. - The VRF must have an existing IP Range that contains the requested subnet. - This field may be aliased as just 'vrf'. + vnid: + description: A Virtual Network record UUID or the VNID of a Virtual Network + in your project (sent as integer). format: uuid type: string - required: - - cidr - - network - - type - - vrf_id - VrfIpReservationList: + type: object + VirtualCircuitList: example: - ip_addresses: - - created_at: 2000-01-23T04:56:07.000+00:00 - project: - devices: - - href: href - - href: href - volumes: - - href: href - - href: href - created_at: 2000-01-23T04:56:07.000+00:00 - memberships: - - href: href - - href: href - bgp_config: - href: href - max_devices: "{}" - ssh_keys: - - href: href - - href: href - updated_at: 2000-01-23T04:56:07.000+00:00 - invitations: - - href: href - - href: href - members: - - href: href - - href: href - name: name - network_status: "{}" - customdata: "{}" - id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - payment_method: - href: href - vrf: - local_asn: 0 - ip_ranges: - - ip_ranges - - ip_ranges - metro: - country: country - code: code - name: name - id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - name: name - description: description - project: - devices: - - href: href - - href: href - volumes: - - href: href - - href: href - created_at: 2000-01-23T04:56:07.000+00:00 - memberships: - - href: href - - href: href - bgp_config: - href: href - max_devices: "{}" - ssh_keys: - - href: href - - href: href - updated_at: 2000-01-23T04:56:07.000+00:00 - invitations: - - href: href - - href: href - members: - - href: href - - href: href - name: name - network_status: "{}" - customdata: "{}" - id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - payment_method: - href: href - id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + virtual_circuits: + - null + - null + properties: + virtual_circuits: + items: + $ref: '#/components/schemas/VirtualCircuitList_virtual_circuits_inner' + type: array + type: object + VirtualCircuitUpdateInput: + properties: + description: + type: string + name: + type: string + speed: + description: Speed can be changed only if it is a dedicated connection + type: string + tags: + items: + type: string + type: array + vnid: + description: A Virtual Network record UUID or the VNID of a Virtual Network + in your project. + type: string + type: object + VirtualNetwork: + example: + vxlan: 0 + metal_gateways: + - href: href + - href: href + metro_code: metro_code + instances: + - href: href + - href: href + metro: + href: href + description: description + href: href + id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + facility: + href: href + assigned_to_virtual_circuit: true + assigned_to: + href: href + properties: + assigned_to: + $ref: '#/components/schemas/Href' + assigned_to_virtual_circuit: + description: True if the virtual network is attached to a virtual circuit. + False if not. + type: boolean + description: + type: string + facility: + $ref: '#/components/schemas/Href' + href: + type: string + id: + format: uuid + type: string + instances: + description: A list of instances with ports currently associated to this + Virtual Network. + items: + $ref: '#/components/schemas/Href' + type: array + metal_gateways: + description: A list of metal gateways currently associated to this Virtual + Network. + items: + $ref: '#/components/schemas/Href' + type: array + metro: + $ref: '#/components/schemas/Href' + metro_code: + description: The Metro code of the metro in which this Virtual Network is + defined. + type: string + vxlan: + type: integer + type: object + VirtualNetworkCreateInput: + example: + vxlan: 1099 + project_id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + metro: metro + description: description + facility: facility + properties: + description: + type: string + facility: + description: The UUID (or facility code) for the Facility in which to create + this Virtual network. + type: string + metro: + 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: + example: + virtual_networks: + - vxlan: 0 + metal_gateways: + - href: href + - href: href + metro_code: metro_code + instances: + - href: href + - href: href + metro: href: href - created_by: - avatar_thumb_url: avatar_thumb_url - last_login_at: 2000-01-23T04:56:07.000+00:00 - max_projects: 1 - timezone: timezone - created_at: 2000-01-23T04:56:07.000+00:00 - last_name: last_name - short_id: short_id - fraud_score: fraud_score - emails: - - href: href - - href: href - full_name: full_name - avatar_url: avatar_url - updated_at: 2000-01-23T04:56:07.000+00:00 - phone_number: phone_number - customdata: "{}" - href: href - id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - first_name: first_name - max_organizations: 6 - two_factor_auth: two_factor_auth - email: email - type: vrf - created_by: + description: description + href: href + id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + facility: href: href - network: network - tags: - - tags - - tags - metal_gateway: - gateway_address: gateway_address - updated_at: 2000-01-23T04:56:07.000+00:00 - vlan: 1.4658129805029452 - created_at: 2000-01-23T04:56:07.000+00:00 + assigned_to_virtual_circuit: true + assigned_to: href: href - id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - state: ready - address_family: 0 - netmask: netmask - cidr: 6 - details: details + - vxlan: 0 + metal_gateways: + - href: href + - href: href + metro_code: metro_code + instances: + - href: href + - href: href + metro: + href: href + description: description href: href id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - state: state - - created_at: 2000-01-23T04:56:07.000+00:00 - project: - devices: - - href: href - - href: href - volumes: - - href: href - - href: href - created_at: 2000-01-23T04:56:07.000+00:00 - memberships: - - href: href - - href: href - bgp_config: - href: href - max_devices: "{}" - ssh_keys: - - href: href - - href: href - updated_at: 2000-01-23T04:56:07.000+00:00 - invitations: - - href: href - - href: href - members: - - href: href - - href: href - name: name - network_status: "{}" - customdata: "{}" - id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - payment_method: - href: href - vrf: - local_asn: 0 - ip_ranges: - - ip_ranges - - ip_ranges - metro: - country: country - code: code - name: name - id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - name: name - description: description - project: - devices: - - href: href - - href: href - volumes: - - href: href - - href: href - created_at: 2000-01-23T04:56:07.000+00:00 - memberships: - - href: href - - href: href - bgp_config: - href: href - max_devices: "{}" - ssh_keys: - - href: href - - href: href - updated_at: 2000-01-23T04:56:07.000+00:00 - invitations: - - href: href - - href: href - members: - - href: href - - href: href - name: name - network_status: "{}" - customdata: "{}" - id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - payment_method: - href: href - id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + facility: href: href - created_by: - avatar_thumb_url: avatar_thumb_url - last_login_at: 2000-01-23T04:56:07.000+00:00 - max_projects: 1 - timezone: timezone - created_at: 2000-01-23T04:56:07.000+00:00 - last_name: last_name - short_id: short_id - fraud_score: fraud_score - emails: - - href: href - - href: href - full_name: full_name - avatar_url: avatar_url - updated_at: 2000-01-23T04:56:07.000+00:00 - phone_number: phone_number - customdata: "{}" - href: href - id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - first_name: first_name - max_organizations: 6 - two_factor_auth: two_factor_auth - email: email - type: vrf - created_by: + assigned_to_virtual_circuit: true + assigned_to: + href: href + properties: + virtual_networks: + items: + $ref: '#/components/schemas/VirtualNetwork' + type: array + type: object + Vrf: + example: + local_asn: 6 + ip_ranges: + - ip_ranges + - ip_ranges + metro: + country: country + code: code + name: name + id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + name: name + description: description + project: + devices: + - href: href + - href: href + volumes: + - href: href + - href: href + created_at: 2000-01-23T04:56:07.000+00:00 + memberships: + - href: href + - href: href + bgp_config: href: href - network: network - tags: - - tags - - tags - metal_gateway: - gateway_address: gateway_address - updated_at: 2000-01-23T04:56:07.000+00:00 - vlan: 1.4658129805029452 - created_at: 2000-01-23T04:56:07.000+00:00 + max_devices: "{}" + ssh_keys: + - href: href + - href: href + updated_at: 2000-01-23T04:56:07.000+00:00 + invitations: + - href: href + - href: href + members: + - href: href + - href: href + name: name + network_status: "{}" + customdata: "{}" + id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + payment_method: href: href - id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - state: ready - address_family: 0 - netmask: netmask - cidr: 6 - details: details + id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + href: href + created_by: + avatar_thumb_url: avatar_thumb_url + last_login_at: 2000-01-23T04:56:07.000+00:00 + max_projects: 5 + timezone: timezone + created_at: 2000-01-23T04:56:07.000+00:00 + last_name: last_name + short_id: short_id + fraud_score: fraud_score + emails: + - href: href + - href: href + features: + - features + - features + full_name: full_name + avatar_url: avatar_url + updated_at: 2000-01-23T04:56:07.000+00:00 + phone_number: phone_number + customdata: "{}" href: href id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - state: state + first_name: first_name + max_organizations: 1 + two_factor_auth: two_factor_auth + email: email + properties: + id: + format: uuid + type: string + name: + type: string + description: + description: Optional field that can be set to describe the VRF + type: string + local_asn: + description: A 4-byte ASN associated with the VRF. + format: int32 + type: integer + ip_ranges: + description: "A list of CIDR network addresses. Like [\"10.0.0.0/16\", \"\ + 2001:d78::/56\"]." + items: + type: string + type: array + project: + $ref: '#/components/schemas/Project' + metro: + $ref: '#/components/schemas/Metro' + created_by: + $ref: '#/components/schemas/User' + href: + type: string + type: object + VrfCreateInput: + 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 + 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\ + \ /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 + VrfIPRangeList: + description: "A list of CIDR network addresses. Like [\"10.0.0.0/16\", \"2001:d78::/56\"\ + ]." + items: + type: string + type: array + VrfIPRangeUpdateInput: + 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.\ + \ Adding a new CIDR address to the list will result in the creation of a new\ + \ IP Range for this VRF. Removal of an existing CIDR address from the list\ + \ will result in the deletion of an existing IP Range for this VRF. Deleting\ + \ an IP Range will result in the deletion of any VRF IP Reservations contained\ + \ within the IP Range, as well as the VRF IP Reservation\\'s associated Metal\ + \ Gateways or Virtual Circuits. If you do not wish to add or remove IP Ranges,\ + \ either include the full existing list of IP Ranges in the update request,\ + \ or do not specify the `ip_ranges` field in the update request. Specifying\ + \ a value of `[]` will remove all existing IP Ranges from the VRF." + items: + type: string + type: array + VrfIPReservation: + additionalProperties: false + allOf: + - $ref: '#/components/schemas/IPReservation' + - $ref: '#/components/schemas/VrfIPReservation_allOf' + required: + - vrf + type: object + VrfIPReservationCreateInput: + properties: + cidr: + description: The size of the VRF IP Reservation's subnet + example: 16 + type: integer + customdata: + type: object + details: + type: string + network: + description: The starting address for this VRF IP Reservation's subnet + example: 10.1.2.0 + type: string + tags: + items: + type: string + type: array + type: + description: Must be set to 'vrf' + example: vrf + type: string + vrf_id: + description: The ID of the VRF in which this VRF IP Reservation is created. + The VRF must have an existing IP Range that contains the requested subnet. + This field may be aliased as just 'vrf'. + format: uuid + type: string + required: + - cidr + - network + - type + - vrf_id + VrfIPReservationList: + example: + ip_addresses: + - null + - null properties: ip_addresses: items: - $ref: '#/components/schemas/VrfIpReservation' + $ref: '#/components/schemas/VrfIPReservation' type: array type: object VrfList: example: vrfs: - - local_asn: 0 + - local_asn: 6 ip_ranges: - ip_ranges - ip_ranges @@ -19875,7 +20086,7 @@ components: created_by: avatar_thumb_url: avatar_thumb_url last_login_at: 2000-01-23T04:56:07.000+00:00 - max_projects: 1 + max_projects: 5 timezone: timezone created_at: 2000-01-23T04:56:07.000+00:00 last_name: last_name @@ -19884,6 +20095,9 @@ components: emails: - href: href - href: href + features: + - features + - features full_name: full_name avatar_url: avatar_url updated_at: 2000-01-23T04:56:07.000+00:00 @@ -19892,10 +20106,10 @@ components: href: href id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 first_name: first_name - max_organizations: 6 + max_organizations: 1 two_factor_auth: two_factor_auth email: email - - local_asn: 0 + - local_asn: 6 ip_ranges: - ip_ranges - ip_ranges @@ -19941,7 +20155,7 @@ components: created_by: avatar_thumb_url: avatar_thumb_url last_login_at: 2000-01-23T04:56:07.000+00:00 - max_projects: 1 + max_projects: 5 timezone: timezone created_at: 2000-01-23T04:56:07.000+00:00 last_name: last_name @@ -19950,6 +20164,9 @@ components: emails: - href: href - href: href + features: + - features + - features full_name: full_name avatar_url: avatar_url updated_at: 2000-01-23T04:56:07.000+00:00 @@ -19958,7 +20175,7 @@ components: href: href id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 first_name: first_name - max_organizations: 6 + max_organizations: 1 two_factor_auth: two_factor_auth email: email properties: @@ -19967,42 +20184,6 @@ components: $ref: '#/components/schemas/Vrf' type: array type: object - VrfMetalGateway: - properties: - created_at: - format: date-time - type: string - created_by: - $ref: '#/components/schemas/Href' - href: - type: string - id: - format: uuid - type: string - ip_reservation: - $ref: '#/components/schemas/VrfIpReservation' - project: - $ref: '#/components/schemas/Project' - state: - description: "The current state of the Metal Gateway. 'Ready' indicates\ - \ the gateway record has been configured, but is currently not active\ - \ on the network. 'Active' indicates the gateway has been configured on\ - \ the network. 'Deleting' is a temporary state used to indicate that the\ - \ gateway is in the process of being un-configured from the network, after\ - \ which the gateway record will be deleted." - enum: - - ready - - active - - deleting - type: string - updated_at: - format: date-time - type: string - virtual_network: - $ref: '#/components/schemas/VirtualNetwork' - vrf: - $ref: '#/components/schemas/Vrf' - type: object VrfMetalGatewayCreateInput: properties: ip_reservation_id: @@ -20207,19 +20388,10 @@ components: oneOf: - $ref: '#/components/schemas/IPAssignment' - $ref: '#/components/schemas/IPReservation' - - $ref: '#/components/schemas/VrfIpReservation' - findMetalGatewayById_200_response: - oneOf: - - $ref: '#/components/schemas/MetalGateway' - - $ref: '#/components/schemas/VrfMetalGateway' requestIPReservation_request: oneOf: - $ref: '#/components/schemas/IPReservationRequestInput' - - $ref: '#/components/schemas/VrfIpReservationCreateInput' - requestIPReservation_201_response: - oneOf: - - $ref: '#/components/schemas/IPReservation' - - $ref: '#/components/schemas/VrfIpReservation' + - $ref: '#/components/schemas/VrfIPReservationCreateInput' createVrf_request: properties: description: @@ -20368,23 +20540,35 @@ components: allOf: - $ref: '#/components/schemas/Metro' - description: The metro the IP address is in - IPReservation_facility: - allOf: - - $ref: '#/components/schemas/Facility' - - description: "The facility the IP reservation is in. If the facility the IP\ - \ reservation was requested in is in a metro, a metro value will also be\ - \ set, and the subsequent IP reservation can be used on a metro level. Can\ - \ be null if requesting an IP reservation in a metro." IPReservation_metro: allOf: - $ref: '#/components/schemas/Metro' - description: "The metro the IP reservation is in. As long as the IP reservation\ \ has a metro, it can be used on a metro level. Can be null if requesting\ \ an IP reservation in a facility that is not in a metro." - IPReservationList_ip_addresses_inner: - anyOf: - - $ref: '#/components/schemas/IPReservation' - - $ref: '#/components/schemas/VrfIpReservation' + DefaultIPReservation_allOf: + properties: + addon: + type: boolean + assignments: + items: + $ref: '#/components/schemas/IPAssignment' + type: array + enabled: + type: boolean + facility: + allOf: + - $ref: '#/components/schemas/Facility' + - description: "The facility the IP reservation is in. If the facility the\ + \ IP reservation was requested in is in a metro, a metro value will\ + \ also be set, and the subsequent IP reservation can be used on a metro\ + \ level. Can be null if requesting an IP reservation in a metro." + global_ip: + type: boolean + requested_by: + $ref: '#/components/schemas/User' + available: + type: string InstancesBatchCreateInput_batches_inner_ip_addresses_inner: example: address_family: 4 @@ -20533,10 +20717,10 @@ components: allOf: - $ref: '#/components/schemas/Metro' - description: Details of the metro the facility is in - MetalGatewayList_MetalGateways_inner: - anyOf: - - $ref: '#/components/schemas/MetalGateway' - - $ref: '#/components/schemas/VrfMetalGateway' + MetalGateway_ip_reservation: + oneOf: + - $ref: '#/components/schemas/IPReservation' + - $ref: '#/components/schemas/HrefOnly' Plan_available_in_metros_inner_price: example: hour: 5.637377 @@ -20693,6 +20877,12 @@ components: anyOf: - $ref: '#/components/schemas/VirtualCircuit' - $ref: '#/components/schemas/VrfVirtualCircuit' + VrfIPReservation_allOf: + properties: + vrf: + $ref: '#/components/schemas/Vrf' + created_by: + $ref: '#/components/schemas/User' securitySchemes: x_auth_token: in: header diff --git a/equinix-openapi-metal/docs/AuthTokenUser.md b/equinix-openapi-metal/docs/AuthTokenUser.md index 9664ed00d..bf066dba7 100644 --- a/equinix-openapi-metal/docs/AuthTokenUser.md +++ b/equinix-openapi-metal/docs/AuthTokenUser.md @@ -27,6 +27,7 @@ |**timezone** | **String** | | [optional] | |**twoFactorAuth** | **String** | | [optional] | |**updatedAt** | **OffsetDateTime** | | [optional] | +|**features** | **List<String>** | | [optional] | diff --git a/equinix-openapi-metal/docs/DefaultIPReservation.md b/equinix-openapi-metal/docs/DefaultIPReservation.md new file mode 100644 index 000000000..187539395 --- /dev/null +++ b/equinix-openapi-metal/docs/DefaultIPReservation.md @@ -0,0 +1,19 @@ + + +# DefaultIPReservation + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**addon** | **Boolean** | | [optional] | +|**assignments** | [**List<IPAssignment>**](IPAssignment.md) | | [optional] | +|**enabled** | **Boolean** | | [optional] | +|**facility** | [**Facility**](Facility.md) | | [optional] | +|**globalIp** | **Boolean** | | [optional] | +|**requestedBy** | [**User**](User.md) | | [optional] | +|**available** | **String** | | [optional] | + + + diff --git a/equinix-openapi-metal/docs/DefaultIPReservationAllOf.md b/equinix-openapi-metal/docs/DefaultIPReservationAllOf.md new file mode 100644 index 000000000..d02c46de3 --- /dev/null +++ b/equinix-openapi-metal/docs/DefaultIPReservationAllOf.md @@ -0,0 +1,19 @@ + + +# DefaultIPReservationAllOf + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**addon** | **Boolean** | | [optional] | +|**assignments** | [**List<IPAssignment>**](IPAssignment.md) | | [optional] | +|**enabled** | **Boolean** | | [optional] | +|**facility** | [**Facility**](Facility.md) | | [optional] | +|**globalIp** | **Boolean** | | [optional] | +|**requestedBy** | [**User**](User.md) | | [optional] | +|**available** | **String** | | [optional] | + + + diff --git a/equinix-openapi-metal/docs/FindIPAddressById200Response.md b/equinix-openapi-metal/docs/FindIPAddressById200Response.md index 12ee1b052..c3bd848ec 100644 --- a/equinix-openapi-metal/docs/FindIPAddressById200Response.md +++ b/equinix-openapi-metal/docs/FindIPAddressById200Response.md @@ -19,23 +19,11 @@ |**id** | **UUID** | | [optional] | |**manageable** | **Boolean** | | [optional] | |**management** | **Boolean** | | [optional] | -|**metro** | [**IPReservationMetro**](IPReservationMetro.md) | | [optional] | +|**metro** | [**IPAssignmentMetro**](IPAssignmentMetro.md) | | [optional] | |**netmask** | **String** | | [optional] | |**network** | **String** | | [optional] | |**parentBlock** | [**ParentBlock**](ParentBlock.md) | | [optional] | |**_public** | **Boolean** | | [optional] | -|**addon** | **Boolean** | | [optional] | -|**assignments** | [**List<IPAssignment>**](IPAssignment.md) | | [optional] | -|**bill** | **Boolean** | | [optional] | -|**facility** | [**IPReservationFacility**](IPReservationFacility.md) | | [optional] | -|**metalGateway** | [**MetalGatewayLite**](MetalGatewayLite.md) | | [optional] | -|**state** | **String** | | [optional] | -|**tags** | **List<String>** | | [optional] | -|**createdBy** | [**Href**](Href.md) | | [optional] | -|**details** | **String** | | [optional] | -|**project** | [**Project**](Project.md) | | [optional] | -|**type** | **String** | | [optional] | -|**vrf** | [**Vrf**](Vrf.md) | | | diff --git a/equinix-openapi-metal/docs/FindMetalGatewayById200Response.md b/equinix-openapi-metal/docs/FindMetalGatewayById200Response.md deleted file mode 100644 index 55e36c0af..000000000 --- a/equinix-openapi-metal/docs/FindMetalGatewayById200Response.md +++ /dev/null @@ -1,32 +0,0 @@ - - -# FindMetalGatewayById200Response - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**createdAt** | **OffsetDateTime** | | [optional] | -|**createdBy** | [**Href**](Href.md) | | [optional] | -|**href** | **String** | | [optional] | -|**id** | **UUID** | | [optional] | -|**ipReservation** | [**VrfIpReservation**](VrfIpReservation.md) | | [optional] | -|**project** | [**Project**](Project.md) | | [optional] | -|**state** | [**StateEnum**](#StateEnum) | The current state of the Metal Gateway. 'Ready' indicates the gateway record has been configured, but is currently not active on the network. 'Active' indicates the gateway has been configured on the network. 'Deleting' is a temporary state used to indicate that the gateway is in the process of being un-configured from the network, after which the gateway record will be deleted. | [optional] | -|**updatedAt** | **OffsetDateTime** | | [optional] | -|**virtualNetwork** | [**VirtualNetwork**](VirtualNetwork.md) | | [optional] | -|**vrf** | [**Vrf**](Vrf.md) | | [optional] | - - - -## Enum: StateEnum - -| Name | Value | -|---- | -----| -| READY | "ready" | -| ACTIVE | "active" | -| DELETING | "deleting" | - - - diff --git a/equinix-openapi-metal/docs/HrefOnly.md b/equinix-openapi-metal/docs/HrefOnly.md new file mode 100644 index 000000000..c9b43b617 --- /dev/null +++ b/equinix-openapi-metal/docs/HrefOnly.md @@ -0,0 +1,13 @@ + + +# HrefOnly + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**href** | **String** | | | + + + diff --git a/equinix-openapi-metal/docs/IPReservation.md b/equinix-openapi-metal/docs/IPReservation.md index 7b9ab9acd..313badc27 100644 --- a/equinix-openapi-metal/docs/IPReservation.md +++ b/equinix-openapi-metal/docs/IPReservation.md @@ -2,20 +2,16 @@ # IPReservation +Base class for all IP Reservations ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**addon** | **Boolean** | | [optional] | |**addressFamily** | **Integer** | | [optional] | -|**assignments** | [**List<IPAssignment>**](IPAssignment.md) | | [optional] | |**bill** | **Boolean** | | [optional] | |**cidr** | **Integer** | | [optional] | |**createdAt** | **OffsetDateTime** | | [optional] | -|**enabled** | **Boolean** | | [optional] | -|**facility** | [**IPReservationFacility**](IPReservationFacility.md) | | [optional] | -|**globalIp** | **Boolean** | | [optional] | |**href** | **String** | | [optional] | |**id** | **UUID** | | [optional] | |**manageable** | **Boolean** | | [optional] | @@ -27,6 +23,13 @@ |**_public** | **Boolean** | | [optional] | |**state** | **String** | | [optional] | |**tags** | **List<String>** | | [optional] | +|**details** | **String** | | [optional] | +|**customdata** | **Object** | | [optional] | +|**project** | [**Project**](Project.md) | | [optional] | +|**projectLite** | [**Href**](Href.md) | | [optional] | +|**address** | **String** | | [optional] | +|**gateway** | **String** | | [optional] | +|**type** | **String** | | | diff --git a/equinix-openapi-metal/docs/IPReservationFacility.md b/equinix-openapi-metal/docs/IPReservationFacility.md deleted file mode 100644 index d3dcfbfdf..000000000 --- a/equinix-openapi-metal/docs/IPReservationFacility.md +++ /dev/null @@ -1,31 +0,0 @@ - - -# IPReservationFacility - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**address** | [**Address**](Address.md) | | [optional] | -|**code** | **String** | | [optional] | -|**features** | [**List<FeaturesEnum>**](#List<FeaturesEnum>) | | [optional] | -|**id** | **UUID** | | [optional] | -|**ipRanges** | **List<String>** | IP ranges registered in facility. Can be used for GeoIP location | [optional] | -|**metro** | [**DeviceMetro**](DeviceMetro.md) | | [optional] | -|**name** | **String** | | [optional] | - - - -## Enum: List<FeaturesEnum> - -| Name | Value | -|---- | -----| -| BAREMETAL | "baremetal" | -| BACKEND_TRANSFER | "backend_transfer" | -| LAYER_2 | "layer_2" | -| GLOBAL_IPV4 | "global_ipv4" | -| IBX | "ibx" | - - - diff --git a/equinix-openapi-metal/docs/IPReservationList.md b/equinix-openapi-metal/docs/IPReservationList.md index 894becb01..811513919 100644 --- a/equinix-openapi-metal/docs/IPReservationList.md +++ b/equinix-openapi-metal/docs/IPReservationList.md @@ -7,7 +7,7 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**ipAddresses** | [**List<IPReservationListIpAddressesInner>**](IPReservationListIpAddressesInner.md) | | [optional] | +|**ipAddresses** | [**List<IPReservation>**](IPReservation.md) | | [optional] | diff --git a/equinix-openapi-metal/docs/IPReservationListIpAddressesInner.md b/equinix-openapi-metal/docs/IPReservationListIpAddressesInner.md deleted file mode 100644 index 102ad9fd2..000000000 --- a/equinix-openapi-metal/docs/IPReservationListIpAddressesInner.md +++ /dev/null @@ -1,37 +0,0 @@ - - -# IPReservationListIpAddressesInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**addon** | **Boolean** | | [optional] | -|**addressFamily** | **Integer** | | [optional] | -|**assignments** | [**List<IPAssignment>**](IPAssignment.md) | | [optional] | -|**bill** | **Boolean** | | [optional] | -|**cidr** | **Integer** | | [optional] | -|**createdAt** | **OffsetDateTime** | | [optional] | -|**enabled** | **Boolean** | | [optional] | -|**facility** | [**IPReservationFacility**](IPReservationFacility.md) | | [optional] | -|**globalIp** | **Boolean** | | [optional] | -|**href** | **String** | | [optional] | -|**id** | **UUID** | | [optional] | -|**manageable** | **Boolean** | | [optional] | -|**management** | **Boolean** | | [optional] | -|**metalGateway** | [**MetalGatewayLite**](MetalGatewayLite.md) | | [optional] | -|**metro** | [**IPReservationMetro**](IPReservationMetro.md) | | [optional] | -|**netmask** | **String** | | [optional] | -|**network** | **String** | | [optional] | -|**_public** | **Boolean** | | [optional] | -|**state** | **String** | | [optional] | -|**tags** | **List<String>** | | [optional] | -|**createdBy** | [**Href**](Href.md) | | [optional] | -|**details** | **String** | | [optional] | -|**project** | [**Project**](Project.md) | | [optional] | -|**type** | **String** | | [optional] | -|**vrf** | [**Vrf**](Vrf.md) | | | - - - diff --git a/equinix-openapi-metal/docs/IpAddressesApi.md b/equinix-openapi-metal/docs/IpAddressesApi.md index 8ae0ea4c8..54cd0c4c7 100644 --- a/equinix-openapi-metal/docs/IpAddressesApi.md +++ b/equinix-openapi-metal/docs/IpAddressesApi.md @@ -385,7 +385,7 @@ public class Example { # **requestIPReservation** -> RequestIPReservation201Response requestIPReservation(id, requestIPReservationRequest) +> IPReservation requestIPReservation(id, requestIPReservationRequest) Requesting IP reservations @@ -416,7 +416,7 @@ public class Example { UUID id = UUID.randomUUID(); // UUID | Project UUID RequestIPReservationRequest requestIPReservationRequest = new RequestIPReservationRequest(); // RequestIPReservationRequest | IP Reservation Request to create try { - RequestIPReservation201Response result = apiInstance.requestIPReservation(id, requestIPReservationRequest); + IPReservation result = apiInstance.requestIPReservation(id, requestIPReservationRequest); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling IpAddressesApi#requestIPReservation"); @@ -438,7 +438,7 @@ public class Example { ### Return type -[**RequestIPReservation201Response**](RequestIPReservation201Response.md) +[**IPReservation**](IPReservation.md) ### Authorization diff --git a/equinix-openapi-metal/docs/MetalGateway.md b/equinix-openapi-metal/docs/MetalGateway.md index b978ac01c..54379b766 100644 --- a/equinix-openapi-metal/docs/MetalGateway.md +++ b/equinix-openapi-metal/docs/MetalGateway.md @@ -11,11 +11,12 @@ |**createdBy** | [**Href**](Href.md) | | [optional] | |**href** | **String** | | [optional] | |**id** | **UUID** | | [optional] | -|**ipReservation** | [**IPReservation**](IPReservation.md) | | [optional] | +|**ipReservation** | [**MetalGatewayIpReservation**](MetalGatewayIpReservation.md) | | [optional] | |**project** | [**Project**](Project.md) | | [optional] | |**state** | [**StateEnum**](#StateEnum) | The current state of the Metal Gateway. 'Ready' indicates the gateway record has been configured, but is currently not active on the network. 'Active' indicates the gateway has been configured on the network. 'Deleting' is a temporary state used to indicate that the gateway is in the process of being un-configured from the network, after which the gateway record will be deleted. | [optional] | |**updatedAt** | **OffsetDateTime** | | [optional] | |**virtualNetwork** | [**VirtualNetwork**](VirtualNetwork.md) | | [optional] | +|**vrf** | [**Vrf**](Vrf.md) | | [optional] | diff --git a/equinix-openapi-metal/docs/MetalGatewayIpReservation.md b/equinix-openapi-metal/docs/MetalGatewayIpReservation.md new file mode 100644 index 000000000..0bdfd2057 --- /dev/null +++ b/equinix-openapi-metal/docs/MetalGatewayIpReservation.md @@ -0,0 +1,13 @@ + + +# MetalGatewayIpReservation + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**href** | **String** | | | + + + diff --git a/equinix-openapi-metal/docs/MetalGatewayList.md b/equinix-openapi-metal/docs/MetalGatewayList.md index 7ec30d54a..88965e9d2 100644 --- a/equinix-openapi-metal/docs/MetalGatewayList.md +++ b/equinix-openapi-metal/docs/MetalGatewayList.md @@ -7,7 +7,7 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**metalGateways** | [**List<MetalGatewayListMetalGatewaysInner>**](MetalGatewayListMetalGatewaysInner.md) | | [optional] | +|**metalGateways** | [**List<MetalGateway>**](MetalGateway.md) | | [optional] | diff --git a/equinix-openapi-metal/docs/MetalGatewayListMetalGatewaysInner.md b/equinix-openapi-metal/docs/MetalGatewayListMetalGatewaysInner.md deleted file mode 100644 index abf3f2e9d..000000000 --- a/equinix-openapi-metal/docs/MetalGatewayListMetalGatewaysInner.md +++ /dev/null @@ -1,32 +0,0 @@ - - -# MetalGatewayListMetalGatewaysInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**createdAt** | **OffsetDateTime** | | [optional] | -|**createdBy** | [**Href**](Href.md) | | [optional] | -|**href** | **String** | | [optional] | -|**id** | **UUID** | | [optional] | -|**ipReservation** | [**VrfIpReservation**](VrfIpReservation.md) | | [optional] | -|**project** | [**Project**](Project.md) | | [optional] | -|**state** | [**StateEnum**](#StateEnum) | The current state of the Metal Gateway. 'Ready' indicates the gateway record has been configured, but is currently not active on the network. 'Active' indicates the gateway has been configured on the network. 'Deleting' is a temporary state used to indicate that the gateway is in the process of being un-configured from the network, after which the gateway record will be deleted. | [optional] | -|**updatedAt** | **OffsetDateTime** | | [optional] | -|**virtualNetwork** | [**VirtualNetwork**](VirtualNetwork.md) | | [optional] | -|**vrf** | [**Vrf**](Vrf.md) | | [optional] | - - - -## Enum: StateEnum - -| Name | Value | -|---- | -----| -| READY | "ready" | -| ACTIVE | "active" | -| DELETING | "deleting" | - - - diff --git a/equinix-openapi-metal/docs/MetalGatewaysApi.md b/equinix-openapi-metal/docs/MetalGatewaysApi.md index d4fa58807..582f67fd6 100644 --- a/equinix-openapi-metal/docs/MetalGatewaysApi.md +++ b/equinix-openapi-metal/docs/MetalGatewaysApi.md @@ -12,7 +12,7 @@ All URIs are relative to *https://api.equinix.com/metal/v1* # **createMetalGateway** -> FindMetalGatewayById200Response createMetalGateway(projectId, createMetalGatewayRequest, page, perPage) +> MetalGateway createMetalGateway(projectId, createMetalGatewayRequest, page, perPage) Create a metal gateway @@ -45,7 +45,7 @@ public class Example { Integer page = 1; // Integer | Page to return Integer perPage = 10; // Integer | Items returned per page try { - FindMetalGatewayById200Response result = apiInstance.createMetalGateway(projectId, createMetalGatewayRequest, page, perPage); + MetalGateway result = apiInstance.createMetalGateway(projectId, createMetalGatewayRequest, page, perPage); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling MetalGatewaysApi#createMetalGateway"); @@ -69,7 +69,7 @@ public class Example { ### Return type -[**FindMetalGatewayById200Response**](FindMetalGatewayById200Response.md) +[**MetalGateway**](MetalGateway.md) ### Authorization @@ -160,7 +160,7 @@ null (empty response body) # **findMetalGatewayById** -> FindMetalGatewayById200Response findMetalGatewayById(id, include, exclude) +> MetalGateway findMetalGatewayById(id, include, exclude) Returns the metal gateway @@ -192,7 +192,7 @@ public class Example { List include = Arrays.asList(); // List | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. List exclude = Arrays.asList(); // List | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. try { - FindMetalGatewayById200Response result = apiInstance.findMetalGatewayById(id, include, exclude); + MetalGateway result = apiInstance.findMetalGatewayById(id, include, exclude); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling MetalGatewaysApi#findMetalGatewayById"); @@ -215,7 +215,7 @@ public class Example { ### Return type -[**FindMetalGatewayById200Response**](FindMetalGatewayById200Response.md) +[**MetalGateway**](MetalGateway.md) ### Authorization diff --git a/equinix-openapi-metal/docs/RequestIPReservation201Response.md b/equinix-openapi-metal/docs/RequestIPReservation201Response.md deleted file mode 100644 index 7b3c9696b..000000000 --- a/equinix-openapi-metal/docs/RequestIPReservation201Response.md +++ /dev/null @@ -1,37 +0,0 @@ - - -# RequestIPReservation201Response - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**addon** | **Boolean** | | [optional] | -|**addressFamily** | **Integer** | | [optional] | -|**assignments** | [**List<IPAssignment>**](IPAssignment.md) | | [optional] | -|**bill** | **Boolean** | | [optional] | -|**cidr** | **Integer** | | [optional] | -|**createdAt** | **OffsetDateTime** | | [optional] | -|**enabled** | **Boolean** | | [optional] | -|**facility** | [**IPReservationFacility**](IPReservationFacility.md) | | [optional] | -|**globalIp** | **Boolean** | | [optional] | -|**href** | **String** | | [optional] | -|**id** | **UUID** | | [optional] | -|**manageable** | **Boolean** | | [optional] | -|**management** | **Boolean** | | [optional] | -|**metalGateway** | [**MetalGatewayLite**](MetalGatewayLite.md) | | [optional] | -|**metro** | [**IPReservationMetro**](IPReservationMetro.md) | | [optional] | -|**netmask** | **String** | | [optional] | -|**network** | **String** | | [optional] | -|**_public** | **Boolean** | | [optional] | -|**state** | **String** | | [optional] | -|**tags** | **List<String>** | | [optional] | -|**createdBy** | [**Href**](Href.md) | | [optional] | -|**details** | **String** | | [optional] | -|**project** | [**Project**](Project.md) | | [optional] | -|**type** | **String** | | [optional] | -|**vrf** | [**Vrf**](Vrf.md) | | | - - - diff --git a/equinix-openapi-metal/docs/User.md b/equinix-openapi-metal/docs/User.md index 0ef604090..f16a77722 100644 --- a/equinix-openapi-metal/docs/User.md +++ b/equinix-openapi-metal/docs/User.md @@ -27,6 +27,7 @@ |**timezone** | **String** | | [optional] | |**twoFactorAuth** | **String** | | [optional] | |**updatedAt** | **OffsetDateTime** | | [optional] | +|**features** | **List<String>** | | [optional] | diff --git a/equinix-openapi-metal/docs/VrfIPReservation.md b/equinix-openapi-metal/docs/VrfIPReservation.md new file mode 100644 index 000000000..6cdb04c12 --- /dev/null +++ b/equinix-openapi-metal/docs/VrfIPReservation.md @@ -0,0 +1,14 @@ + + +# VrfIPReservation + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**vrf** | [**Vrf**](Vrf.md) | | | +|**createdBy** | [**User**](User.md) | | [optional] | + + + diff --git a/equinix-openapi-metal/docs/VrfIPReservationAllOf.md b/equinix-openapi-metal/docs/VrfIPReservationAllOf.md new file mode 100644 index 000000000..0b8a2c164 --- /dev/null +++ b/equinix-openapi-metal/docs/VrfIPReservationAllOf.md @@ -0,0 +1,14 @@ + + +# VrfIPReservationAllOf + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**vrf** | [**Vrf**](Vrf.md) | | [optional] | +|**createdBy** | [**User**](User.md) | | [optional] | + + + diff --git a/equinix-openapi-metal/docs/VrfIpReservationCreateInput.md b/equinix-openapi-metal/docs/VrfIPReservationCreateInput.md similarity index 95% rename from equinix-openapi-metal/docs/VrfIpReservationCreateInput.md rename to equinix-openapi-metal/docs/VrfIPReservationCreateInput.md index 1b224621f..5c651404a 100644 --- a/equinix-openapi-metal/docs/VrfIpReservationCreateInput.md +++ b/equinix-openapi-metal/docs/VrfIPReservationCreateInput.md @@ -1,6 +1,6 @@ -# VrfIpReservationCreateInput +# VrfIPReservationCreateInput ## Properties diff --git a/equinix-openapi-metal/docs/VrfIpReservationList.md b/equinix-openapi-metal/docs/VrfIPReservationList.md similarity index 63% rename from equinix-openapi-metal/docs/VrfIpReservationList.md rename to equinix-openapi-metal/docs/VrfIPReservationList.md index b800f0487..b10365813 100644 --- a/equinix-openapi-metal/docs/VrfIpReservationList.md +++ b/equinix-openapi-metal/docs/VrfIPReservationList.md @@ -1,13 +1,13 @@ -# VrfIpReservationList +# VrfIPReservationList ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**ipAddresses** | [**List<VrfIpReservation>**](VrfIpReservation.md) | | [optional] | +|**ipAddresses** | [**List<VrfIPReservation>**](VrfIPReservation.md) | | [optional] | diff --git a/equinix-openapi-metal/docs/VrfIpReservation.md b/equinix-openapi-metal/docs/VrfIpReservation.md deleted file mode 100644 index 1acdb43f5..000000000 --- a/equinix-openapi-metal/docs/VrfIpReservation.md +++ /dev/null @@ -1,27 +0,0 @@ - - -# VrfIpReservation - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**addressFamily** | **Integer** | | [optional] | -|**cidr** | **Integer** | | [optional] | -|**createdAt** | **OffsetDateTime** | | [optional] | -|**createdBy** | [**Href**](Href.md) | | [optional] | -|**details** | **String** | | [optional] | -|**href** | **String** | | [optional] | -|**id** | **UUID** | | [optional] | -|**metalGateway** | [**MetalGatewayLite**](MetalGatewayLite.md) | | [optional] | -|**netmask** | **String** | | [optional] | -|**network** | **String** | | [optional] | -|**project** | [**Project**](Project.md) | | [optional] | -|**state** | **String** | | [optional] | -|**tags** | **List<String>** | | [optional] | -|**type** | **String** | | [optional] | -|**vrf** | [**Vrf**](Vrf.md) | | | - - - diff --git a/equinix-openapi-metal/docs/VrfMetalGateway.md b/equinix-openapi-metal/docs/VrfMetalGateway.md deleted file mode 100644 index 7b8d1557b..000000000 --- a/equinix-openapi-metal/docs/VrfMetalGateway.md +++ /dev/null @@ -1,32 +0,0 @@ - - -# VrfMetalGateway - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**createdAt** | **OffsetDateTime** | | [optional] | -|**createdBy** | [**Href**](Href.md) | | [optional] | -|**href** | **String** | | [optional] | -|**id** | **UUID** | | [optional] | -|**ipReservation** | [**VrfIpReservation**](VrfIpReservation.md) | | [optional] | -|**project** | [**Project**](Project.md) | | [optional] | -|**state** | [**StateEnum**](#StateEnum) | The current state of the Metal Gateway. 'Ready' indicates the gateway record has been configured, but is currently not active on the network. 'Active' indicates the gateway has been configured on the network. 'Deleting' is a temporary state used to indicate that the gateway is in the process of being un-configured from the network, after which the gateway record will be deleted. | [optional] | -|**updatedAt** | **OffsetDateTime** | | [optional] | -|**virtualNetwork** | [**VirtualNetwork**](VirtualNetwork.md) | | [optional] | -|**vrf** | [**Vrf**](Vrf.md) | | [optional] | - - - -## Enum: StateEnum - -| Name | Value | -|---- | -----| -| READY | "ready" | -| ACTIVE | "active" | -| DELETING | "deleting" | - - - diff --git a/equinix-openapi-metal/docs/VrfsApi.md b/equinix-openapi-metal/docs/VrfsApi.md index 4e34d15f9..93e1a697a 100644 --- a/equinix-openapi-metal/docs/VrfsApi.md +++ b/equinix-openapi-metal/docs/VrfsApi.md @@ -7,7 +7,7 @@ All URIs are relative to *https://api.equinix.com/metal/v1* | [**createVrf**](VrfsApi.md#createVrf) | **POST** /projects/{id}/vrfs | Create a new VRF in the specified project | | [**deleteVrf**](VrfsApi.md#deleteVrf) | **DELETE** /vrfs/{id} | Delete the VRF | | [**findVrfById**](VrfsApi.md#findVrfById) | **GET** /vrfs/{id} | Retrieve a VRF | -| [**findVrfIpReservations**](VrfsApi.md#findVrfIpReservations) | **GET** /vrfs/{id}/ips | Retrieve all VRF IP Reservations in the VRF | +| [**findVrfIPReservations**](VrfsApi.md#findVrfIPReservations) | **GET** /vrfs/{id}/ips | Retrieve all VRF IP Reservations in the VRF | | [**findVrfs**](VrfsApi.md#findVrfs) | **GET** /projects/{id}/vrfs | Retrieve all VRFs in the project | | [**updateVrf**](VrfsApi.md#updateVrf) | **PUT** /vrfs/{id} | Update the VRF | @@ -233,9 +233,9 @@ public class Example { | **403** | forbidden | - | | **404** | not found | - | - -# **findVrfIpReservations** -> VrfIpReservationList findVrfIpReservations(id, include, exclude) + +# **findVrfIPReservations** +> VrfIPReservationList findVrfIPReservations(id, include, exclude) Retrieve all VRF IP Reservations in the VRF @@ -267,10 +267,10 @@ public class Example { List include = Arrays.asList(); // List | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. List exclude = Arrays.asList(); // List | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. try { - VrfIpReservationList result = apiInstance.findVrfIpReservations(id, include, exclude); + VrfIPReservationList result = apiInstance.findVrfIPReservations(id, include, exclude); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling VrfsApi#findVrfIpReservations"); + System.err.println("Exception when calling VrfsApi#findVrfIPReservations"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -290,7 +290,7 @@ public class Example { ### Return type -[**VrfIpReservationList**](VrfIpReservationList.md) +[**VrfIPReservationList**](VrfIPReservationList.md) ### Authorization 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 207e811ee..d5ce139a4 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 @@ -58,6 +58,20 @@ public class JSON { @SuppressWarnings("unchecked") public static GsonBuilder createGson() { GsonFireBuilder fireBuilder = new GsonFireBuilder() + .registerTypeSelector(com.equinix.openapi.metal.v1.model.IPReservation.class, new TypeSelector() { + @Override + public Class getClassForElement(JsonElement readElement) { + Map classByDiscriminatorValue = new HashMap(); + classByDiscriminatorValue.put("global_ipv4", com.equinix.openapi.metal.v1.model.DefaultIPReservation.class); + classByDiscriminatorValue.put("private_ipv4", com.equinix.openapi.metal.v1.model.DefaultIPReservation.class); + classByDiscriminatorValue.put("public_ipv4", com.equinix.openapi.metal.v1.model.DefaultIPReservation.class); + classByDiscriminatorValue.put("public_ipv6", com.equinix.openapi.metal.v1.model.DefaultIPReservation.class); + classByDiscriminatorValue.put("vrf", com.equinix.openapi.metal.v1.model.VrfIPReservation.class); + classByDiscriminatorValue.put("IPReservation", com.equinix.openapi.metal.v1.model.IPReservation.class); + return getClassByDiscriminator(classByDiscriminatorValue, + getDiscriminatorValue(readElement, "type")); + } + }) ; GsonBuilder builder = fireBuilder.createGsonBuilder(); return builder; @@ -129,6 +143,8 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri 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.Device.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.DeviceActionsInner.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.DeviceCreateInput.CustomTypeAdapterFactory()); @@ -151,21 +167,18 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.Facility.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.FacilityList.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.FindIPAddressById200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.FindMetalGatewayById200Response.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.GlobalBgpRange.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.GlobalBgpRangeList.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.HardwareReservation.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.HardwareReservationList.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.Href.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.HrefOnly.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.IPAssignment.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.IPAssignmentInput.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.IPAssignmentList.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.IPAssignmentMetro.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.IPAvailabilitiesList.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.IPReservation.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.IPReservationFacility.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.IPReservationList.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.IPReservationListIpAddressesInner.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()); @@ -191,8 +204,8 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri 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.MetalGatewayIpReservation.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.MetalGatewayList.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.MetalGatewayListMetalGatewaysInner.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.MetalGatewayLite.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.Metro.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.MetroCapacityList.CustomTypeAdapterFactory()); @@ -234,7 +247,6 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.ProjectUsage.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.ProjectUsageList.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.RecoveryCodeList.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.RequestIPReservation201Response.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.RequestIPReservationRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.SSHKey.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.SSHKeyCreateInput.CustomTypeAdapterFactory()); @@ -281,11 +293,11 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.VirtualNetworkList.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.Vrf.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.VrfCreateInput.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.VrfIpReservation.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.VrfIpReservationCreateInput.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.VrfIpReservationList.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.VrfIPReservation.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.VrfIPReservationAllOf.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.VrfIPReservationCreateInput.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.VrfIPReservationList.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.VrfList.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.VrfMetalGateway.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.VrfMetalGatewayCreateInput.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.VrfUpdateInput.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.VrfVirtualCircuit.CustomTypeAdapterFactory()); diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/api/IpAddressesApi.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/api/IpAddressesApi.java index 600890d84..02d4d4e4e 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/api/IpAddressesApi.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/api/IpAddressesApi.java @@ -30,8 +30,8 @@ import com.equinix.openapi.metal.v1.model.Error; import com.equinix.openapi.metal.v1.model.FindIPAddressById200Response; import com.equinix.openapi.metal.v1.model.IPAvailabilitiesList; +import com.equinix.openapi.metal.v1.model.IPReservation; import com.equinix.openapi.metal.v1.model.IPReservationList; -import com.equinix.openapi.metal.v1.model.RequestIPReservation201Response; import com.equinix.openapi.metal.v1.model.RequestIPReservationRequest; import java.util.UUID; @@ -906,7 +906,7 @@ private okhttp3.Call requestIPReservationValidateBeforeCall(UUID id, RequestIPRe * Request more IP space for a project in order to have additional IP addresses to assign to devices. If the request is within the max quota, an IP reservation will be created. If the project will exceed its IP quota, a request will be submitted for review, and will return an IP Reservation with a `state` of `pending`. You can automatically have the request fail with HTTP status 422 instead of triggering the review process by providing the `fail_on_approval_required` parameter set to `true` in the request. * @param id Project UUID (required) * @param requestIPReservationRequest IP Reservation Request to create (required) - * @return RequestIPReservation201Response + * @return IPReservation * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -918,8 +918,8 @@ private okhttp3.Call requestIPReservationValidateBeforeCall(UUID id, RequestIPRe
422 unprocessable entity -
*/ - public RequestIPReservation201Response requestIPReservation(UUID id, RequestIPReservationRequest requestIPReservationRequest) throws ApiException { - ApiResponse localVarResp = requestIPReservationWithHttpInfo(id, requestIPReservationRequest); + public IPReservation requestIPReservation(UUID id, RequestIPReservationRequest requestIPReservationRequest) throws ApiException { + ApiResponse localVarResp = requestIPReservationWithHttpInfo(id, requestIPReservationRequest); return localVarResp.getData(); } @@ -928,7 +928,7 @@ public RequestIPReservation201Response requestIPReservation(UUID id, RequestIPRe * Request more IP space for a project in order to have additional IP addresses to assign to devices. If the request is within the max quota, an IP reservation will be created. If the project will exceed its IP quota, a request will be submitted for review, and will return an IP Reservation with a `state` of `pending`. You can automatically have the request fail with HTTP status 422 instead of triggering the review process by providing the `fail_on_approval_required` parameter set to `true` in the request. * @param id Project UUID (required) * @param requestIPReservationRequest IP Reservation Request to create (required) - * @return ApiResponse<RequestIPReservation201Response> + * @return ApiResponse<IPReservation> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -940,9 +940,9 @@ public RequestIPReservation201Response requestIPReservation(UUID id, RequestIPRe
422 unprocessable entity -
*/ - public ApiResponse requestIPReservationWithHttpInfo(UUID id, RequestIPReservationRequest requestIPReservationRequest) throws ApiException { + public ApiResponse requestIPReservationWithHttpInfo(UUID id, RequestIPReservationRequest requestIPReservationRequest) throws ApiException { okhttp3.Call localVarCall = requestIPReservationValidateBeforeCall(id, requestIPReservationRequest, null); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -964,10 +964,10 @@ public ApiResponse requestIPReservationWithHttp 422 unprocessable entity - */ - public okhttp3.Call requestIPReservationAsync(UUID id, RequestIPReservationRequest requestIPReservationRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call requestIPReservationAsync(UUID id, RequestIPReservationRequest requestIPReservationRequest, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = requestIPReservationValidateBeforeCall(id, requestIPReservationRequest, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + 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/api/MetalGatewaysApi.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/api/MetalGatewaysApi.java index 0ca2a26ff..3f5c592cd 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/api/MetalGatewaysApi.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/api/MetalGatewaysApi.java @@ -29,7 +29,7 @@ import com.equinix.openapi.metal.v1.model.CreateMetalGatewayRequest; import com.equinix.openapi.metal.v1.model.Error; -import com.equinix.openapi.metal.v1.model.FindMetalGatewayById200Response; +import com.equinix.openapi.metal.v1.model.MetalGateway; import com.equinix.openapi.metal.v1.model.MetalGatewayList; import java.util.UUID; @@ -175,7 +175,7 @@ private okhttp3.Call createMetalGatewayValidateBeforeCall(UUID projectId, Create * @param createMetalGatewayRequest Metal Gateway to create (required) * @param page Page to return (optional, default to 1) * @param perPage Items returned per page (optional, default to 10) - * @return FindMetalGatewayById200Response + * @return MetalGateway * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -186,8 +186,8 @@ private okhttp3.Call createMetalGatewayValidateBeforeCall(UUID projectId, Create
422 unprocessable entity -
*/ - public FindMetalGatewayById200Response createMetalGateway(UUID projectId, CreateMetalGatewayRequest createMetalGatewayRequest, Integer page, Integer perPage) throws ApiException { - ApiResponse localVarResp = createMetalGatewayWithHttpInfo(projectId, createMetalGatewayRequest, page, perPage); + public MetalGateway createMetalGateway(UUID projectId, CreateMetalGatewayRequest createMetalGatewayRequest, Integer page, Integer perPage) throws ApiException { + ApiResponse localVarResp = createMetalGatewayWithHttpInfo(projectId, createMetalGatewayRequest, page, perPage); return localVarResp.getData(); } @@ -198,7 +198,7 @@ public FindMetalGatewayById200Response createMetalGateway(UUID projectId, Create * @param createMetalGatewayRequest Metal Gateway to create (required) * @param page Page to return (optional, default to 1) * @param perPage Items returned per page (optional, default to 10) - * @return ApiResponse<FindMetalGatewayById200Response> + * @return ApiResponse<MetalGateway> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -209,9 +209,9 @@ public FindMetalGatewayById200Response createMetalGateway(UUID projectId, Create
422 unprocessable entity -
*/ - public ApiResponse createMetalGatewayWithHttpInfo(UUID projectId, CreateMetalGatewayRequest createMetalGatewayRequest, Integer page, Integer perPage) throws ApiException { + public ApiResponse createMetalGatewayWithHttpInfo(UUID projectId, CreateMetalGatewayRequest createMetalGatewayRequest, Integer page, Integer perPage) throws ApiException { okhttp3.Call localVarCall = createMetalGatewayValidateBeforeCall(projectId, createMetalGatewayRequest, page, perPage, null); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -234,10 +234,10 @@ public ApiResponse createMetalGatewayWithHttpIn 422 unprocessable entity - */ - public okhttp3.Call createMetalGatewayAsync(UUID projectId, CreateMetalGatewayRequest createMetalGatewayRequest, Integer page, Integer perPage, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createMetalGatewayAsync(UUID projectId, CreateMetalGatewayRequest createMetalGatewayRequest, Integer page, Integer perPage, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = createMetalGatewayValidateBeforeCall(projectId, createMetalGatewayRequest, page, perPage, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } @@ -462,7 +462,7 @@ private okhttp3.Call findMetalGatewayByIdValidateBeforeCall(UUID id, List @@ -472,8 +472,8 @@ private okhttp3.Call findMetalGatewayByIdValidateBeforeCall(UUID id, List 404 not found - */ - public FindMetalGatewayById200Response findMetalGatewayById(UUID id, List include, List exclude) throws ApiException { - ApiResponse localVarResp = findMetalGatewayByIdWithHttpInfo(id, include, exclude); + public MetalGateway findMetalGatewayById(UUID id, List include, List exclude) throws ApiException { + ApiResponse localVarResp = findMetalGatewayByIdWithHttpInfo(id, include, exclude); return localVarResp.getData(); } @@ -483,7 +483,7 @@ public FindMetalGatewayById200Response findMetalGatewayById(UUID id, List @@ -493,9 +493,9 @@ public FindMetalGatewayById200Response findMetalGatewayById(UUID id, List 404 not found - */ - public ApiResponse findMetalGatewayByIdWithHttpInfo(UUID id, List include, List exclude) throws ApiException { + public ApiResponse findMetalGatewayByIdWithHttpInfo(UUID id, List include, List exclude) throws ApiException { okhttp3.Call localVarCall = findMetalGatewayByIdValidateBeforeCall(id, include, exclude, null); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -516,10 +516,10 @@ public ApiResponse findMetalGatewayByIdWithHttp 404 not found - */ - public okhttp3.Call findMetalGatewayByIdAsync(UUID id, List include, List exclude, final ApiCallback _callback) throws ApiException { + public okhttp3.Call findMetalGatewayByIdAsync(UUID id, List include, List exclude, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = findMetalGatewayByIdValidateBeforeCall(id, include, exclude, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + 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/api/VrfsApi.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/api/VrfsApi.java index cf9a97fa3..a78ddf36b 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 @@ -31,7 +31,7 @@ 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.VrfIpReservationList; +import com.equinix.openapi.metal.v1.model.VrfIPReservationList; import com.equinix.openapi.metal.v1.model.VrfList; import com.equinix.openapi.metal.v1.model.VrfUpdateInput; @@ -518,7 +518,7 @@ public okhttp3.Call findVrfByIdAsync(UUID id, List include, List return localVarCall; } /** - * Build call for findVrfIpReservations + * Build call for findVrfIPReservations * @param id VRF UUID (required) * @param include Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) * @param exclude Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) @@ -533,7 +533,7 @@ public okhttp3.Call findVrfByIdAsync(UUID id, List include, List 404 not found - */ - public okhttp3.Call findVrfIpReservationsCall(UUID id, List include, List exclude, final ApiCallback _callback) throws ApiException { + public okhttp3.Call findVrfIPReservationsCall(UUID id, List include, List exclude, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -588,15 +588,15 @@ public okhttp3.Call findVrfIpReservationsCall(UUID id, List include, Lis } @SuppressWarnings("rawtypes") - private okhttp3.Call findVrfIpReservationsValidateBeforeCall(UUID id, List include, List exclude, final ApiCallback _callback) throws ApiException { + private okhttp3.Call findVrfIPReservationsValidateBeforeCall(UUID id, List include, List exclude, 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 findVrfIpReservations(Async)"); + throw new ApiException("Missing the required parameter 'id' when calling findVrfIPReservations(Async)"); } - okhttp3.Call localVarCall = findVrfIpReservationsCall(id, include, exclude, _callback); + okhttp3.Call localVarCall = findVrfIPReservationsCall(id, include, exclude, _callback); return localVarCall; } @@ -607,7 +607,7 @@ private okhttp3.Call findVrfIpReservationsValidateBeforeCall(UUID id, List @@ -617,8 +617,8 @@ private okhttp3.Call findVrfIpReservationsValidateBeforeCall(UUID id, List 404 not found - */ - public VrfIpReservationList findVrfIpReservations(UUID id, List include, List exclude) throws ApiException { - ApiResponse localVarResp = findVrfIpReservationsWithHttpInfo(id, include, exclude); + public VrfIPReservationList findVrfIPReservations(UUID id, List include, List exclude) throws ApiException { + ApiResponse localVarResp = findVrfIPReservationsWithHttpInfo(id, include, exclude); return localVarResp.getData(); } @@ -628,7 +628,7 @@ public VrfIpReservationList findVrfIpReservations(UUID id, List include, * @param id VRF UUID (required) * @param include Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) * @param exclude Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) - * @return ApiResponse<VrfIpReservationList> + * @return ApiResponse<VrfIPReservationList> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -638,9 +638,9 @@ public VrfIpReservationList findVrfIpReservations(UUID id, List include,
404 not found -
*/ - public ApiResponse findVrfIpReservationsWithHttpInfo(UUID id, List include, List exclude) throws ApiException { - okhttp3.Call localVarCall = findVrfIpReservationsValidateBeforeCall(id, include, exclude, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse findVrfIPReservationsWithHttpInfo(UUID id, List include, List exclude) throws ApiException { + okhttp3.Call localVarCall = findVrfIPReservationsValidateBeforeCall(id, include, exclude, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -661,10 +661,10 @@ public ApiResponse findVrfIpReservationsWithHttpInfo(UUID 404 not found - */ - public okhttp3.Call findVrfIpReservationsAsync(UUID id, List include, List exclude, final ApiCallback _callback) throws ApiException { + public okhttp3.Call findVrfIPReservationsAsync(UUID id, List include, List exclude, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = findVrfIpReservationsValidateBeforeCall(id, include, exclude, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = findVrfIPReservationsValidateBeforeCall(id, include, exclude, _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/AuthTokenUser.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/AuthTokenUser.java index 216c6ce08..15563a731 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 @@ -134,6 +134,10 @@ public class AuthTokenUser { @SerializedName(SERIALIZED_NAME_UPDATED_AT) private OffsetDateTime updatedAt; + public static final String SERIALIZED_NAME_FEATURES = "features"; + @SerializedName(SERIALIZED_NAME_FEATURES) + private List features = null; + public AuthTokenUser() { } @@ -604,6 +608,37 @@ public void setUpdatedAt(OffsetDateTime updatedAt) { this.updatedAt = updatedAt; } + + public AuthTokenUser features(List features) { + + this.features = features; + return this; + } + + public AuthTokenUser addFeaturesItem(String featuresItem) { + if (this.features == null) { + this.features = new ArrayList<>(); + } + this.features.add(featuresItem); + return this; + } + + /** + * Get features + * @return features + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public List getFeatures() { + return features; + } + + + public void setFeatures(List features) { + this.features = features; + } + /** * A container for additional, undeclared properties. * This is a holder for any undeclared properties as specified with @@ -669,13 +704,14 @@ public boolean equals(Object o) { Objects.equals(this.shortId, authTokenUser.shortId) && Objects.equals(this.timezone, authTokenUser.timezone) && Objects.equals(this.twoFactorAuth, authTokenUser.twoFactorAuth) && - Objects.equals(this.updatedAt, authTokenUser.updatedAt)&& + Objects.equals(this.updatedAt, authTokenUser.updatedAt) && + Objects.equals(this.features, authTokenUser.features)&& Objects.equals(this.additionalProperties, authTokenUser.additionalProperties); } @Override public int hashCode() { - return Objects.hash(avatarThumbUrl, avatarUrl, createdAt, customdata, email, emails, firstName, fraudScore, fullName, href, id, lastLoginAt, lastName, maxOrganizations, maxProjects, phoneNumber, shortId, timezone, twoFactorAuth, updatedAt, additionalProperties); + return Objects.hash(avatarThumbUrl, avatarUrl, createdAt, customdata, email, emails, firstName, fraudScore, fullName, href, id, lastLoginAt, lastName, maxOrganizations, maxProjects, phoneNumber, shortId, timezone, twoFactorAuth, updatedAt, features, additionalProperties); } @Override @@ -702,6 +738,7 @@ public String toString() { sb.append(" timezone: ").append(toIndentedString(timezone)).append("\n"); sb.append(" twoFactorAuth: ").append(toIndentedString(twoFactorAuth)).append("\n"); sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" features: ").append(toIndentedString(features)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); @@ -745,6 +782,7 @@ private String toIndentedString(Object o) { openapiFields.add("timezone"); openapiFields.add("two_factor_auth"); openapiFields.add("updated_at"); + openapiFields.add("features"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -815,6 +853,10 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if ((jsonObj.get("two_factor_auth") != null && !jsonObj.get("two_factor_auth").isJsonNull()) && !jsonObj.get("two_factor_auth").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `two_factor_auth` to be a primitive type in the JSON string but got `%s`", jsonObj.get("two_factor_auth").toString())); } + // ensure the json data is an array + if ((jsonObj.get("features") != null && !jsonObj.get("features").isJsonNull()) && !jsonObj.get("features").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `features` to be an array in the JSON string but got `%s`", jsonObj.get("features").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { 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 new file mode 100644 index 000000000..6e1237aaf --- /dev/null +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/DefaultIPReservation.java @@ -0,0 +1,461 @@ +/* + * 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.equinix.openapi.metal.v1.model.Facility; +import com.equinix.openapi.metal.v1.model.Href; +import com.equinix.openapi.metal.v1.model.IPAssignment; +import com.equinix.openapi.metal.v1.model.IPReservation; +import com.equinix.openapi.metal.v1.model.IPReservationMetro; +import com.equinix.openapi.metal.v1.model.MetalGatewayLite; +import com.equinix.openapi.metal.v1.model.Project; +import com.equinix.openapi.metal.v1.model.User; +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.time.OffsetDateTime; +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; + +/** + * DefaultIPReservation + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DefaultIPReservation extends IPReservation { + public static final String SERIALIZED_NAME_ADDON = "addon"; + @SerializedName(SERIALIZED_NAME_ADDON) + private Boolean addon; + + public static final String SERIALIZED_NAME_ASSIGNMENTS = "assignments"; + @SerializedName(SERIALIZED_NAME_ASSIGNMENTS) + private List assignments = null; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public static final String SERIALIZED_NAME_FACILITY = "facility"; + @SerializedName(SERIALIZED_NAME_FACILITY) + private Facility facility; + + public static final String SERIALIZED_NAME_GLOBAL_IP = "global_ip"; + @SerializedName(SERIALIZED_NAME_GLOBAL_IP) + private Boolean globalIp; + + public static final String SERIALIZED_NAME_REQUESTED_BY = "requested_by"; + @SerializedName(SERIALIZED_NAME_REQUESTED_BY) + private User requestedBy; + + public static final String SERIALIZED_NAME_AVAILABLE = "available"; + @SerializedName(SERIALIZED_NAME_AVAILABLE) + private String available; + + public DefaultIPReservation() { + } + + public DefaultIPReservation addon(Boolean addon) { + + this.addon = addon; + return this; + } + + /** + * Get addon + * @return addon + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Boolean getAddon() { + return addon; + } + + + public void setAddon(Boolean addon) { + this.addon = addon; + } + + + public DefaultIPReservation assignments(List assignments) { + + this.assignments = assignments; + return this; + } + + public DefaultIPReservation addAssignmentsItem(IPAssignment assignmentsItem) { + if (this.assignments == null) { + this.assignments = new ArrayList<>(); + } + this.assignments.add(assignmentsItem); + return this; + } + + /** + * Get assignments + * @return assignments + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public List getAssignments() { + return assignments; + } + + + public void setAssignments(List assignments) { + this.assignments = assignments; + } + + + public DefaultIPReservation enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * Get enabled + * @return enabled + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Boolean getEnabled() { + return enabled; + } + + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + + public DefaultIPReservation facility(Facility facility) { + + this.facility = facility; + return this; + } + + /** + * Get facility + * @return facility + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Facility getFacility() { + return facility; + } + + + public void setFacility(Facility facility) { + this.facility = facility; + } + + + public DefaultIPReservation globalIp(Boolean globalIp) { + + this.globalIp = globalIp; + return this; + } + + /** + * Get globalIp + * @return globalIp + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Boolean getGlobalIp() { + return globalIp; + } + + + public void setGlobalIp(Boolean globalIp) { + this.globalIp = globalIp; + } + + + public DefaultIPReservation requestedBy(User requestedBy) { + + this.requestedBy = requestedBy; + return this; + } + + /** + * Get requestedBy + * @return requestedBy + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public User getRequestedBy() { + return requestedBy; + } + + + public void setRequestedBy(User requestedBy) { + this.requestedBy = requestedBy; + } + + + public DefaultIPReservation available(String available) { + + this.available = available; + return this; + } + + /** + * Get available + * @return available + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getAvailable() { + return available; + } + + + public void setAvailable(String available) { + this.available = available; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DefaultIPReservation defaultIPReservation = (DefaultIPReservation) o; + return Objects.equals(this.addon, defaultIPReservation.addon) && + Objects.equals(this.assignments, defaultIPReservation.assignments) && + Objects.equals(this.enabled, defaultIPReservation.enabled) && + Objects.equals(this.facility, defaultIPReservation.facility) && + Objects.equals(this.globalIp, defaultIPReservation.globalIp) && + Objects.equals(this.requestedBy, defaultIPReservation.requestedBy) && + Objects.equals(this.available, defaultIPReservation.available) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(addon, assignments, enabled, facility, globalIp, requestedBy, available, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DefaultIPReservation {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" addon: ").append(toIndentedString(addon)).append("\n"); + sb.append(" assignments: ").append(toIndentedString(assignments)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" facility: ").append(toIndentedString(facility)).append("\n"); + sb.append(" globalIp: ").append(toIndentedString(globalIp)).append("\n"); + sb.append(" requestedBy: ").append(toIndentedString(requestedBy)).append("\n"); + sb.append(" available: ").append(toIndentedString(available)).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("address_family"); + openapiFields.add("bill"); + openapiFields.add("cidr"); + openapiFields.add("created_at"); + openapiFields.add("href"); + openapiFields.add("id"); + openapiFields.add("manageable"); + openapiFields.add("management"); + openapiFields.add("metal_gateway"); + openapiFields.add("metro"); + openapiFields.add("netmask"); + openapiFields.add("network"); + openapiFields.add("public"); + openapiFields.add("state"); + openapiFields.add("tags"); + openapiFields.add("details"); + openapiFields.add("customdata"); + openapiFields.add("project"); + openapiFields.add("project_lite"); + openapiFields.add("address"); + openapiFields.add("gateway"); + openapiFields.add("type"); + openapiFields.add("addon"); + openapiFields.add("assignments"); + openapiFields.add("enabled"); + openapiFields.add("facility"); + openapiFields.add("global_ip"); + openapiFields.add("requested_by"); + openapiFields.add("available"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + } + + /** + * 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 DefaultIPReservation + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (DefaultIPReservation.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in DefaultIPReservation is not found in the empty JSON string", DefaultIPReservation.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DefaultIPReservation.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DefaultIPReservation` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DefaultIPReservation.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())); + } + } + 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 `facility` + if (jsonObj.get("facility") != null && !jsonObj.get("facility").isJsonNull()) { + Facility.validateJsonObject(jsonObj.getAsJsonObject("facility")); + } + // validate the optional field `requested_by` + if (jsonObj.get("requested_by") != null && !jsonObj.get("requested_by").isJsonNull()) { + User.validateJsonObject(jsonObj.getAsJsonObject("requested_by")); + } + if ((jsonObj.get("available") != null && !jsonObj.get("available").isJsonNull()) && !jsonObj.get("available").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `available` to be a primitive type in the JSON string but got `%s`", jsonObj.get("available").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DefaultIPReservation.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DefaultIPReservation' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DefaultIPReservation.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DefaultIPReservation value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DefaultIPReservation read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DefaultIPReservation given an JSON string + * + * @param jsonString JSON string + * @return An instance of DefaultIPReservation + * @throws IOException if the JSON string is invalid with respect to DefaultIPReservation + */ + public static DefaultIPReservation fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DefaultIPReservation.class); + } + + /** + * Convert an instance of DefaultIPReservation 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/DefaultIPReservationAllOf.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/DefaultIPReservationAllOf.java new file mode 100644 index 000000000..bcbd5a38b --- /dev/null +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/DefaultIPReservationAllOf.java @@ -0,0 +1,486 @@ +/* + * 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.equinix.openapi.metal.v1.model.Facility; +import com.equinix.openapi.metal.v1.model.IPAssignment; +import com.equinix.openapi.metal.v1.model.User; +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 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; + +/** + * DefaultIPReservationAllOf + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DefaultIPReservationAllOf { + public static final String SERIALIZED_NAME_ADDON = "addon"; + @SerializedName(SERIALIZED_NAME_ADDON) + private Boolean addon; + + public static final String SERIALIZED_NAME_ASSIGNMENTS = "assignments"; + @SerializedName(SERIALIZED_NAME_ASSIGNMENTS) + private List assignments = null; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public static final String SERIALIZED_NAME_FACILITY = "facility"; + @SerializedName(SERIALIZED_NAME_FACILITY) + private Facility facility; + + public static final String SERIALIZED_NAME_GLOBAL_IP = "global_ip"; + @SerializedName(SERIALIZED_NAME_GLOBAL_IP) + private Boolean globalIp; + + public static final String SERIALIZED_NAME_REQUESTED_BY = "requested_by"; + @SerializedName(SERIALIZED_NAME_REQUESTED_BY) + private User requestedBy; + + public static final String SERIALIZED_NAME_AVAILABLE = "available"; + @SerializedName(SERIALIZED_NAME_AVAILABLE) + private String available; + + public DefaultIPReservationAllOf() { + } + + public DefaultIPReservationAllOf addon(Boolean addon) { + + this.addon = addon; + return this; + } + + /** + * Get addon + * @return addon + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Boolean getAddon() { + return addon; + } + + + public void setAddon(Boolean addon) { + this.addon = addon; + } + + + public DefaultIPReservationAllOf assignments(List assignments) { + + this.assignments = assignments; + return this; + } + + public DefaultIPReservationAllOf addAssignmentsItem(IPAssignment assignmentsItem) { + if (this.assignments == null) { + this.assignments = new ArrayList<>(); + } + this.assignments.add(assignmentsItem); + return this; + } + + /** + * Get assignments + * @return assignments + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public List getAssignments() { + return assignments; + } + + + public void setAssignments(List assignments) { + this.assignments = assignments; + } + + + public DefaultIPReservationAllOf enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * Get enabled + * @return enabled + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Boolean getEnabled() { + return enabled; + } + + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + + public DefaultIPReservationAllOf facility(Facility facility) { + + this.facility = facility; + return this; + } + + /** + * Get facility + * @return facility + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Facility getFacility() { + return facility; + } + + + public void setFacility(Facility facility) { + this.facility = facility; + } + + + public DefaultIPReservationAllOf globalIp(Boolean globalIp) { + + this.globalIp = globalIp; + return this; + } + + /** + * Get globalIp + * @return globalIp + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Boolean getGlobalIp() { + return globalIp; + } + + + public void setGlobalIp(Boolean globalIp) { + this.globalIp = globalIp; + } + + + public DefaultIPReservationAllOf requestedBy(User requestedBy) { + + this.requestedBy = requestedBy; + return this; + } + + /** + * Get requestedBy + * @return requestedBy + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public User getRequestedBy() { + return requestedBy; + } + + + public void setRequestedBy(User requestedBy) { + this.requestedBy = requestedBy; + } + + + public DefaultIPReservationAllOf available(String available) { + + this.available = available; + return this; + } + + /** + * Get available + * @return available + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getAvailable() { + return available; + } + + + public void setAvailable(String available) { + this.available = available; + } + + /** + * 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 DefaultIPReservationAllOf 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; + } + DefaultIPReservationAllOf defaultIPReservationAllOf = (DefaultIPReservationAllOf) o; + return Objects.equals(this.addon, defaultIPReservationAllOf.addon) && + Objects.equals(this.assignments, defaultIPReservationAllOf.assignments) && + Objects.equals(this.enabled, defaultIPReservationAllOf.enabled) && + Objects.equals(this.facility, defaultIPReservationAllOf.facility) && + Objects.equals(this.globalIp, defaultIPReservationAllOf.globalIp) && + Objects.equals(this.requestedBy, defaultIPReservationAllOf.requestedBy) && + Objects.equals(this.available, defaultIPReservationAllOf.available)&& + Objects.equals(this.additionalProperties, defaultIPReservationAllOf.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(addon, assignments, enabled, facility, globalIp, requestedBy, available, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DefaultIPReservationAllOf {\n"); + sb.append(" addon: ").append(toIndentedString(addon)).append("\n"); + sb.append(" assignments: ").append(toIndentedString(assignments)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" facility: ").append(toIndentedString(facility)).append("\n"); + sb.append(" globalIp: ").append(toIndentedString(globalIp)).append("\n"); + sb.append(" requestedBy: ").append(toIndentedString(requestedBy)).append("\n"); + sb.append(" available: ").append(toIndentedString(available)).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("addon"); + openapiFields.add("assignments"); + openapiFields.add("enabled"); + openapiFields.add("facility"); + openapiFields.add("global_ip"); + openapiFields.add("requested_by"); + openapiFields.add("available"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * 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 DefaultIPReservationAllOf + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (DefaultIPReservationAllOf.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + 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())); + } + + // 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()) { + Facility.validateJsonObject(jsonObj.getAsJsonObject("facility")); + } + // validate the optional field `requested_by` + if (jsonObj.get("requested_by") != null && !jsonObj.get("requested_by").isJsonNull()) { + User.validateJsonObject(jsonObj.getAsJsonObject("requested_by")); + } + if ((jsonObj.get("available") != null && !jsonObj.get("available").isJsonNull()) && !jsonObj.get("available").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `available` to be a primitive type in the JSON string but got `%s`", jsonObj.get("available").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DefaultIPReservationAllOf.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DefaultIPReservationAllOf' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DefaultIPReservationAllOf.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DefaultIPReservationAllOf 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 DefaultIPReservationAllOf read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + DefaultIPReservationAllOf 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 DefaultIPReservationAllOf given an JSON string + * + * @param jsonString JSON string + * @return An instance of DefaultIPReservationAllOf + * @throws IOException if the JSON string is invalid with respect to DefaultIPReservationAllOf + */ + public static DefaultIPReservationAllOf fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DefaultIPReservationAllOf.class); + } + + /** + * Convert an instance of DefaultIPReservationAllOf 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/FindIPAddressById200Response.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/FindIPAddressById200Response.java index ba55465ee..42a1645b6 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/FindIPAddressById200Response.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/FindIPAddressById200Response.java @@ -17,14 +17,11 @@ import java.util.Arrays; import com.equinix.openapi.metal.v1.model.Href; import com.equinix.openapi.metal.v1.model.IPAssignment; +import com.equinix.openapi.metal.v1.model.IPAssignmentMetro; import com.equinix.openapi.metal.v1.model.IPReservation; -import com.equinix.openapi.metal.v1.model.IPReservationFacility; -import com.equinix.openapi.metal.v1.model.IPReservationMetro; import com.equinix.openapi.metal.v1.model.MetalGatewayLite; import com.equinix.openapi.metal.v1.model.ParentBlock; import com.equinix.openapi.metal.v1.model.Project; -import com.equinix.openapi.metal.v1.model.Vrf; -import com.equinix.openapi.metal.v1.model.VrfIpReservation; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -85,7 +82,6 @@ public TypeAdapter create(Gson gson, TypeToken type) { final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); final TypeAdapter adapterIPAssignment = gson.getDelegateAdapter(this, TypeToken.get(IPAssignment.class)); final TypeAdapter adapterIPReservation = gson.getDelegateAdapter(this, TypeToken.get(IPReservation.class)); - final TypeAdapter adapterVrfIpReservation = gson.getDelegateAdapter(this, TypeToken.get(VrfIpReservation.class)); return (TypeAdapter) new TypeAdapter() { @Override @@ -109,14 +105,7 @@ public void write(JsonWriter out, FindIPAddressById200Response value) throws IOE return; } - // check if the actual instance is of the type `VrfIpReservation` - if (value.getActualInstance() instanceof VrfIpReservation) { - JsonObject obj = adapterVrfIpReservation.toJsonTree((VrfIpReservation)value.getActualInstance()).getAsJsonObject(); - elementAdapter.write(out, obj); - return; - } - - throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: IPAssignment, IPReservation, VrfIpReservation"); + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: IPAssignment, IPReservation"); } @Override @@ -154,19 +143,6 @@ public FindIPAddressById200Response read(JsonReader in) throws IOException { log.log(Level.FINER, "Input data does not match schema 'IPReservation'", e); } - // deserialize VrfIpReservation - try { - // validate the JSON object to see if any exception is thrown - VrfIpReservation.validateJsonObject(jsonObject); - actualAdapter = adapterVrfIpReservation; - match++; - log.log(Level.FINER, "Input data matches schema 'VrfIpReservation'"); - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add(String.format("Deserialization for VrfIpReservation failed with `%s`.", e.getMessage())); - log.log(Level.FINER, "Input data does not match schema 'VrfIpReservation'", e); - } - if (match == 1) { FindIPAddressById200Response ret = new FindIPAddressById200Response(); ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); @@ -196,18 +172,11 @@ public FindIPAddressById200Response(IPReservation o) { setActualInstance(o); } - public FindIPAddressById200Response(VrfIpReservation o) { - super("oneOf", Boolean.FALSE); - setActualInstance(o); - } - static { schemas.put("IPAssignment", new GenericType() { }); schemas.put("IPReservation", new GenericType() { }); - schemas.put("VrfIpReservation", new GenericType() { - }); } @Override @@ -218,7 +187,7 @@ public Map getSchemas() { /** * Set the instance that matches the oneOf child schema, check * the instance parameter is valid against the oneOf child schemas: - * IPAssignment, IPReservation, VrfIpReservation + * IPAssignment, IPReservation * * It could be an instance of the 'oneOf' schemas. * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). @@ -235,19 +204,14 @@ public void setActualInstance(Object instance) { return; } - if (instance instanceof VrfIpReservation) { - super.setActualInstance(instance); - return; - } - - throw new RuntimeException("Invalid instance type. Must be IPAssignment, IPReservation, VrfIpReservation"); + throw new RuntimeException("Invalid instance type. Must be IPAssignment, IPReservation"); } /** * Get the actual instance, which can be the following: - * IPAssignment, IPReservation, VrfIpReservation + * IPAssignment, IPReservation * - * @return The actual instance (IPAssignment, IPReservation, VrfIpReservation) + * @return The actual instance (IPAssignment, IPReservation) */ @Override public Object getActualInstance() { @@ -276,17 +240,6 @@ public IPReservation getIPReservation() throws ClassCastException { return (IPReservation)super.getActualInstance(); } - /** - * Get the actual instance of `VrfIpReservation`. If the actual instance is not `VrfIpReservation`, - * the ClassCastException will be thrown. - * - * @return The actual instance of `VrfIpReservation` - * @throws ClassCastException if the instance is not `VrfIpReservation` - */ - public VrfIpReservation getVrfIpReservation() throws ClassCastException { - return (VrfIpReservation)super.getActualInstance(); - } - /** * Validates the JSON Object and throws an exception if issues found @@ -314,16 +267,8 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { errorMessages.add(String.format("Deserialization for IPReservation failed with `%s`.", e.getMessage())); // continue to the next one } - // validate the json string with VrfIpReservation - try { - VrfIpReservation.validateJsonObject(jsonObj); - validCount++; - } catch (Exception e) { - errorMessages.add(String.format("Deserialization for VrfIpReservation failed with `%s`.", e.getMessage())); - // continue to the next one - } if (validCount != 1) { - throw new IOException(String.format("The JSON string is invalid for FindIPAddressById200Response with oneOf schemas: IPAssignment, IPReservation, VrfIpReservation. %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 FindIPAddressById200Response with oneOf schemas: IPAssignment, IPReservation. %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/FindMetalGatewayById200Response.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/FindMetalGatewayById200Response.java deleted file mode 100644 index 6650daa7d..000000000 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/FindMetalGatewayById200Response.java +++ /dev/null @@ -1,293 +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.equinix.openapi.metal.v1.model.Href; -import com.equinix.openapi.metal.v1.model.MetalGateway; -import com.equinix.openapi.metal.v1.model.Project; -import com.equinix.openapi.metal.v1.model.VirtualNetwork; -import com.equinix.openapi.metal.v1.model.Vrf; -import com.equinix.openapi.metal.v1.model.VrfIpReservation; -import com.equinix.openapi.metal.v1.model.VrfMetalGateway; -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.time.OffsetDateTime; -import java.util.UUID; - -import javax.ws.rs.core.GenericType; - -import java.io.IOException; -import java.lang.reflect.Type; -import java.util.logging.Level; -import java.util.logging.Logger; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashSet; -import java.util.HashMap; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.JsonPrimitive; -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 com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonSerializationContext; -import com.google.gson.JsonSerializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; - -import com.equinix.openapi.JSON; - -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class FindMetalGatewayById200Response extends AbstractOpenApiSchema { - private static final Logger log = Logger.getLogger(FindMetalGatewayById200Response.class.getName()); - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!FindMetalGatewayById200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'FindMetalGatewayById200Response' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter adapterMetalGateway = gson.getDelegateAdapter(this, TypeToken.get(MetalGateway.class)); - final TypeAdapter adapterVrfMetalGateway = gson.getDelegateAdapter(this, TypeToken.get(VrfMetalGateway.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, FindMetalGatewayById200Response value) throws IOException { - if (value == null || value.getActualInstance() == null) { - elementAdapter.write(out, null); - return; - } - - // check if the actual instance is of the type `MetalGateway` - if (value.getActualInstance() instanceof MetalGateway) { - JsonObject obj = adapterMetalGateway.toJsonTree((MetalGateway)value.getActualInstance()).getAsJsonObject(); - elementAdapter.write(out, obj); - return; - } - - // check if the actual instance is of the type `VrfMetalGateway` - if (value.getActualInstance() instanceof VrfMetalGateway) { - JsonObject obj = adapterVrfMetalGateway.toJsonTree((VrfMetalGateway)value.getActualInstance()).getAsJsonObject(); - elementAdapter.write(out, obj); - return; - } - - throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: MetalGateway, VrfMetalGateway"); - } - - @Override - public FindMetalGatewayById200Response read(JsonReader in) throws IOException { - Object deserialized = null; - JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); - - int match = 0; - ArrayList errorMessages = new ArrayList<>(); - TypeAdapter actualAdapter = elementAdapter; - - // deserialize MetalGateway - try { - // validate the JSON object to see if any exception is thrown - MetalGateway.validateJsonObject(jsonObject); - actualAdapter = adapterMetalGateway; - match++; - log.log(Level.FINER, "Input data matches schema 'MetalGateway'"); - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add(String.format("Deserialization for MetalGateway failed with `%s`.", e.getMessage())); - log.log(Level.FINER, "Input data does not match schema 'MetalGateway'", e); - } - - // deserialize VrfMetalGateway - try { - // validate the JSON object to see if any exception is thrown - VrfMetalGateway.validateJsonObject(jsonObject); - actualAdapter = adapterVrfMetalGateway; - match++; - log.log(Level.FINER, "Input data matches schema 'VrfMetalGateway'"); - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add(String.format("Deserialization for VrfMetalGateway failed with `%s`.", e.getMessage())); - log.log(Level.FINER, "Input data does not match schema 'VrfMetalGateway'", e); - } - - if (match == 1) { - FindMetalGatewayById200Response ret = new FindMetalGatewayById200Response(); - ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); - return ret; - } - - throw new IOException(String.format("Failed deserialization for FindMetalGatewayById200Response: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); - } - }.nullSafe(); - } - } - - // store a list of schema names defined in oneOf - public static final Map schemas = new HashMap(); - - public FindMetalGatewayById200Response() { - super("oneOf", Boolean.FALSE); - } - - public FindMetalGatewayById200Response(MetalGateway o) { - super("oneOf", Boolean.FALSE); - setActualInstance(o); - } - - public FindMetalGatewayById200Response(VrfMetalGateway o) { - super("oneOf", Boolean.FALSE); - setActualInstance(o); - } - - static { - schemas.put("MetalGateway", new GenericType() { - }); - schemas.put("VrfMetalGateway", new GenericType() { - }); - } - - @Override - public Map getSchemas() { - return FindMetalGatewayById200Response.schemas; - } - - /** - * Set the instance that matches the oneOf child schema, check - * the instance parameter is valid against the oneOf child schemas: - * MetalGateway, VrfMetalGateway - * - * 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 MetalGateway) { - super.setActualInstance(instance); - return; - } - - if (instance instanceof VrfMetalGateway) { - super.setActualInstance(instance); - return; - } - - throw new RuntimeException("Invalid instance type. Must be MetalGateway, VrfMetalGateway"); - } - - /** - * Get the actual instance, which can be the following: - * MetalGateway, VrfMetalGateway - * - * @return The actual instance (MetalGateway, VrfMetalGateway) - */ - @Override - public Object getActualInstance() { - return super.getActualInstance(); - } - - /** - * Get the actual instance of `MetalGateway`. If the actual instance is not `MetalGateway`, - * the ClassCastException will be thrown. - * - * @return The actual instance of `MetalGateway` - * @throws ClassCastException if the instance is not `MetalGateway` - */ - public MetalGateway getMetalGateway() throws ClassCastException { - return (MetalGateway)super.getActualInstance(); - } - - /** - * Get the actual instance of `VrfMetalGateway`. If the actual instance is not `VrfMetalGateway`, - * the ClassCastException will be thrown. - * - * @return The actual instance of `VrfMetalGateway` - * @throws ClassCastException if the instance is not `VrfMetalGateway` - */ - public VrfMetalGateway getVrfMetalGateway() throws ClassCastException { - return (VrfMetalGateway)super.getActualInstance(); - } - - - /** - * 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 FindMetalGatewayById200Response - */ - 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 MetalGateway - try { - MetalGateway.validateJsonObject(jsonObj); - validCount++; - } catch (Exception e) { - errorMessages.add(String.format("Deserialization for MetalGateway failed with `%s`.", e.getMessage())); - // continue to the next one - } - // validate the json string with VrfMetalGateway - try { - VrfMetalGateway.validateJsonObject(jsonObj); - validCount++; - } catch (Exception e) { - errorMessages.add(String.format("Deserialization for VrfMetalGateway failed with `%s`.", e.getMessage())); - // continue to the next one - } - if (validCount != 1) { - throw new IOException(String.format("The JSON string is invalid for FindMetalGatewayById200Response with oneOf schemas: MetalGateway, VrfMetalGateway. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); - } - } - - /** - * Create an instance of FindMetalGatewayById200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of FindMetalGatewayById200Response - * @throws IOException if the JSON string is invalid with respect to FindMetalGatewayById200Response - */ - public static FindMetalGatewayById200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, FindMetalGatewayById200Response.class); - } - - /** - * Convert an instance of FindMetalGatewayById200Response 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/HrefOnly.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/HrefOnly.java new file mode 100644 index 000000000..63b348a97 --- /dev/null +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/HrefOnly.java @@ -0,0 +1,217 @@ +/* + * 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 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; + +/** + * HrefOnly + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class HrefOnly { + public static final String SERIALIZED_NAME_HREF = "href"; + @SerializedName(SERIALIZED_NAME_HREF) + private String href; + + public HrefOnly() { + } + + public HrefOnly href(String href) { + + this.href = href; + return this; + } + + /** + * Get href + * @return href + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public String getHref() { + return href; + } + + + public void setHref(String href) { + this.href = href; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HrefOnly hrefOnly = (HrefOnly) o; + return Objects.equals(this.href, hrefOnly.href); + } + + @Override + public int hashCode() { + return Objects.hash(href); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HrefOnly {\n"); + sb.append(" href: ").append(toIndentedString(href)).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("href"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("href"); + } + + /** + * 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 HrefOnly + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (HrefOnly.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in HrefOnly is not found in the empty JSON string", HrefOnly.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!HrefOnly.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HrefOnly` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : HrefOnly.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("href") != null && !jsonObj.get("href").isJsonNull()) && !jsonObj.get("href").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `href` to be a primitive type in the JSON string but got `%s`", jsonObj.get("href").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!HrefOnly.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'HrefOnly' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(HrefOnly.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, HrefOnly value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public HrefOnly read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of HrefOnly given an JSON string + * + * @param jsonString JSON string + * @return An instance of HrefOnly + * @throws IOException if the JSON string is invalid with respect to HrefOnly + */ + public static HrefOnly fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, HrefOnly.class); + } + + /** + * Convert an instance of HrefOnly 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/IPReservation.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/IPReservation.java index 29db6123b..63d5dd137 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/IPReservation.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/IPReservation.java @@ -15,10 +15,10 @@ import java.util.Objects; import java.util.Arrays; -import com.equinix.openapi.metal.v1.model.IPAssignment; -import com.equinix.openapi.metal.v1.model.IPReservationFacility; +import com.equinix.openapi.metal.v1.model.Href; import com.equinix.openapi.metal.v1.model.IPReservationMetro; import com.equinix.openapi.metal.v1.model.MetalGatewayLite; +import com.equinix.openapi.metal.v1.model.Project; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -53,22 +53,15 @@ import com.equinix.openapi.JSON; /** - * IPReservation + * Base class for all IP Reservations */ +@ApiModel(description = "Base class for all IP Reservations") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class IPReservation { - public static final String SERIALIZED_NAME_ADDON = "addon"; - @SerializedName(SERIALIZED_NAME_ADDON) - private Boolean addon; - public static final String SERIALIZED_NAME_ADDRESS_FAMILY = "address_family"; @SerializedName(SERIALIZED_NAME_ADDRESS_FAMILY) private Integer addressFamily; - public static final String SERIALIZED_NAME_ASSIGNMENTS = "assignments"; - @SerializedName(SERIALIZED_NAME_ASSIGNMENTS) - private List assignments = null; - public static final String SERIALIZED_NAME_BILL = "bill"; @SerializedName(SERIALIZED_NAME_BILL) private Boolean bill; @@ -81,18 +74,6 @@ public class IPReservation { @SerializedName(SERIALIZED_NAME_CREATED_AT) private OffsetDateTime createdAt; - public static final String SERIALIZED_NAME_ENABLED = "enabled"; - @SerializedName(SERIALIZED_NAME_ENABLED) - private Boolean enabled; - - public static final String SERIALIZED_NAME_FACILITY = "facility"; - @SerializedName(SERIALIZED_NAME_FACILITY) - private IPReservationFacility facility; - - public static final String SERIALIZED_NAME_GLOBAL_IP = "global_ip"; - @SerializedName(SERIALIZED_NAME_GLOBAL_IP) - private Boolean globalIp; - public static final String SERIALIZED_NAME_HREF = "href"; @SerializedName(SERIALIZED_NAME_HREF) private String href; @@ -137,31 +118,37 @@ public class IPReservation { @SerializedName(SERIALIZED_NAME_TAGS) private List tags = null; - public IPReservation() { - } + public static final String SERIALIZED_NAME_DETAILS = "details"; + @SerializedName(SERIALIZED_NAME_DETAILS) + private String details; - public IPReservation addon(Boolean addon) { - - this.addon = addon; - return this; - } + public static final String SERIALIZED_NAME_CUSTOMDATA = "customdata"; + @SerializedName(SERIALIZED_NAME_CUSTOMDATA) + private Object customdata; - /** - * Get addon - * @return addon - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public static final String SERIALIZED_NAME_PROJECT = "project"; + @SerializedName(SERIALIZED_NAME_PROJECT) + private Project project; - public Boolean getAddon() { - return addon; - } + public static final String SERIALIZED_NAME_PROJECT_LITE = "project_lite"; + @SerializedName(SERIALIZED_NAME_PROJECT_LITE) + private Href projectLite; + public static final String SERIALIZED_NAME_ADDRESS = "address"; + @SerializedName(SERIALIZED_NAME_ADDRESS) + private String address; - public void setAddon(Boolean addon) { - this.addon = addon; - } + public static final String SERIALIZED_NAME_GATEWAY = "gateway"; + @SerializedName(SERIALIZED_NAME_GATEWAY) + private String gateway; + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + protected String type; + + public IPReservation() { + this.type = this.getClass().getSimpleName(); + } public IPReservation addressFamily(Integer addressFamily) { @@ -186,37 +173,6 @@ public void setAddressFamily(Integer addressFamily) { } - public IPReservation assignments(List assignments) { - - this.assignments = assignments; - return this; - } - - public IPReservation addAssignmentsItem(IPAssignment assignmentsItem) { - if (this.assignments == null) { - this.assignments = new ArrayList<>(); - } - this.assignments.add(assignmentsItem); - return this; - } - - /** - * Get assignments - * @return assignments - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public List getAssignments() { - return assignments; - } - - - public void setAssignments(List assignments) { - this.assignments = assignments; - } - - public IPReservation bill(Boolean bill) { this.bill = bill; @@ -286,75 +242,6 @@ public void setCreatedAt(OffsetDateTime createdAt) { } - public IPReservation enabled(Boolean enabled) { - - this.enabled = enabled; - return this; - } - - /** - * Get enabled - * @return enabled - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public Boolean getEnabled() { - return enabled; - } - - - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } - - - public IPReservation facility(IPReservationFacility facility) { - - this.facility = facility; - return this; - } - - /** - * Get facility - * @return facility - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public IPReservationFacility getFacility() { - return facility; - } - - - public void setFacility(IPReservationFacility facility) { - this.facility = facility; - } - - - public IPReservation globalIp(Boolean globalIp) { - - this.globalIp = globalIp; - return this; - } - - /** - * Get globalIp - * @return globalIp - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public Boolean getGlobalIp() { - return globalIp; - } - - - public void setGlobalIp(Boolean globalIp) { - this.globalIp = globalIp; - } - - public IPReservation href(String href) { this.href = href; @@ -615,6 +502,167 @@ public void setTags(List tags) { this.tags = tags; } + + public IPReservation details(String details) { + + this.details = details; + return this; + } + + /** + * Get details + * @return details + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getDetails() { + return details; + } + + + public void setDetails(String details) { + this.details = details; + } + + + public IPReservation customdata(Object customdata) { + + this.customdata = customdata; + return this; + } + + /** + * Get customdata + * @return customdata + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Object getCustomdata() { + return customdata; + } + + + public void setCustomdata(Object customdata) { + this.customdata = customdata; + } + + + public IPReservation project(Project project) { + + this.project = project; + return this; + } + + /** + * Get project + * @return project + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Project getProject() { + return project; + } + + + public void setProject(Project project) { + this.project = project; + } + + + public IPReservation projectLite(Href projectLite) { + + this.projectLite = projectLite; + return this; + } + + /** + * Get projectLite + * @return projectLite + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Href getProjectLite() { + return projectLite; + } + + + public void setProjectLite(Href projectLite) { + this.projectLite = projectLite; + } + + + public IPReservation address(String address) { + + this.address = address; + return this; + } + + /** + * Get address + * @return address + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getAddress() { + return address; + } + + + public void setAddress(String address) { + this.address = address; + } + + + public IPReservation gateway(String gateway) { + + this.gateway = gateway; + return this; + } + + /** + * Get gateway + * @return gateway + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getGateway() { + return gateway; + } + + + public void setGateway(String gateway) { + this.gateway = gateway; + } + + + public IPReservation type(String type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public String getType() { + return type; + } + + + public void setType(String type) { + this.type = type; + } + /** * A container for additional, undeclared properties. * This is a holder for any undeclared properties as specified with @@ -661,15 +709,10 @@ public boolean equals(Object o) { return false; } IPReservation ipReservation = (IPReservation) o; - return Objects.equals(this.addon, ipReservation.addon) && - Objects.equals(this.addressFamily, ipReservation.addressFamily) && - Objects.equals(this.assignments, ipReservation.assignments) && + return Objects.equals(this.addressFamily, ipReservation.addressFamily) && Objects.equals(this.bill, ipReservation.bill) && Objects.equals(this.cidr, ipReservation.cidr) && Objects.equals(this.createdAt, ipReservation.createdAt) && - Objects.equals(this.enabled, ipReservation.enabled) && - Objects.equals(this.facility, ipReservation.facility) && - Objects.equals(this.globalIp, ipReservation.globalIp) && Objects.equals(this.href, ipReservation.href) && Objects.equals(this.id, ipReservation.id) && Objects.equals(this.manageable, ipReservation.manageable) && @@ -680,28 +723,30 @@ public boolean equals(Object o) { Objects.equals(this.network, ipReservation.network) && Objects.equals(this._public, ipReservation._public) && Objects.equals(this.state, ipReservation.state) && - Objects.equals(this.tags, ipReservation.tags)&& + Objects.equals(this.tags, ipReservation.tags) && + Objects.equals(this.details, ipReservation.details) && + Objects.equals(this.customdata, ipReservation.customdata) && + Objects.equals(this.project, ipReservation.project) && + Objects.equals(this.projectLite, ipReservation.projectLite) && + Objects.equals(this.address, ipReservation.address) && + Objects.equals(this.gateway, ipReservation.gateway) && + Objects.equals(this.type, ipReservation.type)&& Objects.equals(this.additionalProperties, ipReservation.additionalProperties); } @Override public int hashCode() { - return Objects.hash(addon, addressFamily, assignments, bill, cidr, createdAt, enabled, facility, globalIp, href, id, manageable, management, metalGateway, metro, netmask, network, _public, state, tags, additionalProperties); + return Objects.hash(addressFamily, bill, cidr, createdAt, href, id, manageable, management, metalGateway, metro, netmask, network, _public, state, tags, details, customdata, project, projectLite, address, gateway, type, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class IPReservation {\n"); - sb.append(" addon: ").append(toIndentedString(addon)).append("\n"); sb.append(" addressFamily: ").append(toIndentedString(addressFamily)).append("\n"); - sb.append(" assignments: ").append(toIndentedString(assignments)).append("\n"); sb.append(" bill: ").append(toIndentedString(bill)).append("\n"); sb.append(" cidr: ").append(toIndentedString(cidr)).append("\n"); sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" facility: ").append(toIndentedString(facility)).append("\n"); - sb.append(" globalIp: ").append(toIndentedString(globalIp)).append("\n"); sb.append(" href: ").append(toIndentedString(href)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" manageable: ").append(toIndentedString(manageable)).append("\n"); @@ -713,6 +758,13 @@ public String toString() { sb.append(" _public: ").append(toIndentedString(_public)).append("\n"); sb.append(" state: ").append(toIndentedString(state)).append("\n"); sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" details: ").append(toIndentedString(details)).append("\n"); + sb.append(" customdata: ").append(toIndentedString(customdata)).append("\n"); + sb.append(" project: ").append(toIndentedString(project)).append("\n"); + sb.append(" projectLite: ").append(toIndentedString(projectLite)).append("\n"); + sb.append(" address: ").append(toIndentedString(address)).append("\n"); + sb.append(" gateway: ").append(toIndentedString(gateway)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); @@ -736,15 +788,10 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("addon"); openapiFields.add("address_family"); - openapiFields.add("assignments"); openapiFields.add("bill"); openapiFields.add("cidr"); openapiFields.add("created_at"); - openapiFields.add("enabled"); - openapiFields.add("facility"); - openapiFields.add("global_ip"); openapiFields.add("href"); openapiFields.add("id"); openapiFields.add("manageable"); @@ -756,9 +803,17 @@ private String toIndentedString(Object o) { openapiFields.add("public"); openapiFields.add("state"); openapiFields.add("tags"); + openapiFields.add("details"); + openapiFields.add("customdata"); + openapiFields.add("project"); + openapiFields.add("project_lite"); + openapiFields.add("address"); + openapiFields.add("gateway"); + openapiFields.add("type"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); } /** @@ -775,114 +830,29 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { throw new IllegalArgumentException(String.format("The required field(s) %s in IPReservation is not found in the empty JSON string", IPReservation.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())); - } - // 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()) { - IPReservationFacility.validateJsonObject(jsonObj.getAsJsonObject("facility")); - } - if ((jsonObj.get("href") != null && !jsonObj.get("href").isJsonNull()) && !jsonObj.get("href").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `href` to be a primitive type in the JSON string but got `%s`", jsonObj.get("href").toString())); - } - 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())); - } - // validate the optional field `metal_gateway` - if (jsonObj.get("metal_gateway") != null && !jsonObj.get("metal_gateway").isJsonNull()) { - MetalGatewayLite.validateJsonObject(jsonObj.getAsJsonObject("metal_gateway")); - } - // validate the optional field `metro` - if (jsonObj.get("metro") != null && !jsonObj.get("metro").isJsonNull()) { - IPReservationMetro.validateJsonObject(jsonObj.getAsJsonObject("metro")); - } - if ((jsonObj.get("netmask") != null && !jsonObj.get("netmask").isJsonNull()) && !jsonObj.get("netmask").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `netmask` to be a primitive type in the JSON string but got `%s`", jsonObj.get("netmask").toString())); - } - if ((jsonObj.get("network") != null && !jsonObj.get("network").isJsonNull()) && !jsonObj.get("network").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `network` to be a primitive type in the JSON string but got `%s`", jsonObj.get("network").toString())); - } - 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())); - } - // ensure the json data is an array - if ((jsonObj.get("tags") != null && !jsonObj.get("tags").isJsonNull()) && !jsonObj.get("tags").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `tags` to be an array in the JSON string but got `%s`", jsonObj.get("tags").toString())); + String discriminatorValue = jsonObj.get("type").getAsString(); + switch (discriminatorValue) { + case "global_ipv4": + DefaultIPReservation.validateJsonObject(jsonObj); + break; + case "private_ipv4": + DefaultIPReservation.validateJsonObject(jsonObj); + break; + case "public_ipv4": + DefaultIPReservation.validateJsonObject(jsonObj); + break; + case "public_ipv6": + DefaultIPReservation.validateJsonObject(jsonObj); + break; + case "vrf": + VrfIPReservation.validateJsonObject(jsonObj); + break; + default: + throw new IllegalArgumentException(String.format("The value of the `type` field `%s` does not match any key defined in the discriminator's mapping.", discriminatorValue)); } } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!IPReservation.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'IPReservation' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(IPReservation.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, IPReservation 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 IPReservation read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - IPReservation 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 IPReservation given an JSON string diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/IPReservationFacility.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/IPReservationFacility.java deleted file mode 100644 index 55a4d44e0..000000000 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/IPReservationFacility.java +++ /dev/null @@ -1,549 +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.equinix.openapi.metal.v1.model.Address; -import com.equinix.openapi.metal.v1.model.DeviceMetro; -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; - -/** - * IPReservationFacility - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class IPReservationFacility { - public static final String SERIALIZED_NAME_ADDRESS = "address"; - @SerializedName(SERIALIZED_NAME_ADDRESS) - private Address address; - - public static final String SERIALIZED_NAME_CODE = "code"; - @SerializedName(SERIALIZED_NAME_CODE) - private String code; - - /** - * Gets or Sets features - */ - @JsonAdapter(FeaturesEnum.Adapter.class) - public enum FeaturesEnum { - BAREMETAL("baremetal"), - - BACKEND_TRANSFER("backend_transfer"), - - LAYER_2("layer_2"), - - GLOBAL_IPV4("global_ipv4"), - - IBX("ibx"); - - private String value; - - FeaturesEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static FeaturesEnum fromValue(String value) { - for (FeaturesEnum b : FeaturesEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final FeaturesEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public FeaturesEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return FeaturesEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_FEATURES = "features"; - @SerializedName(SERIALIZED_NAME_FEATURES) - private List features = null; - - public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_ID) - private UUID id; - - 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_METRO = "metro"; - @SerializedName(SERIALIZED_NAME_METRO) - private DeviceMetro metro; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public IPReservationFacility() { - } - - public IPReservationFacility address(Address address) { - - this.address = address; - return this; - } - - /** - * Get address - * @return address - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public Address getAddress() { - return address; - } - - - public void setAddress(Address address) { - this.address = address; - } - - - public IPReservationFacility code(String code) { - - this.code = code; - return this; - } - - /** - * Get code - * @return code - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public String getCode() { - return code; - } - - - public void setCode(String code) { - this.code = code; - } - - - public IPReservationFacility features(List features) { - - this.features = features; - return this; - } - - public IPReservationFacility addFeaturesItem(FeaturesEnum featuresItem) { - if (this.features == null) { - this.features = new ArrayList<>(); - } - this.features.add(featuresItem); - return this; - } - - /** - * Get features - * @return features - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "[\"baremetal\",\"backend_transfer\",\"global_ipv4\"]", value = "") - - public List getFeatures() { - return features; - } - - - public void setFeatures(List features) { - this.features = features; - } - - - public IPReservationFacility id(UUID id) { - - this.id = id; - return this; - } - - /** - * Get id - * @return id - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public UUID getId() { - return id; - } - - - public void setId(UUID id) { - this.id = id; - } - - - public IPReservationFacility ipRanges(List ipRanges) { - - this.ipRanges = ipRanges; - return this; - } - - public IPReservationFacility addIpRangesItem(String ipRangesItem) { - if (this.ipRanges == null) { - this.ipRanges = new ArrayList<>(); - } - this.ipRanges.add(ipRangesItem); - return this; - } - - /** - * IP ranges registered in facility. Can be used for GeoIP location - * @return ipRanges - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "[\"2604:1380::/36\",\"147.75.192.0/21\"]", value = "IP ranges registered in facility. Can be used for GeoIP location") - - public List getIpRanges() { - return ipRanges; - } - - - public void setIpRanges(List ipRanges) { - this.ipRanges = ipRanges; - } - - - public IPReservationFacility metro(DeviceMetro metro) { - - this.metro = metro; - return this; - } - - /** - * Get metro - * @return metro - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public DeviceMetro getMetro() { - return metro; - } - - - public void setMetro(DeviceMetro metro) { - this.metro = metro; - } - - - public IPReservationFacility name(String name) { - - this.name = name; - return this; - } - - /** - * Get name - * @return name - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - /** - * 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 IPReservationFacility 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; - } - IPReservationFacility ipReservationFacility = (IPReservationFacility) o; - return Objects.equals(this.address, ipReservationFacility.address) && - Objects.equals(this.code, ipReservationFacility.code) && - Objects.equals(this.features, ipReservationFacility.features) && - Objects.equals(this.id, ipReservationFacility.id) && - Objects.equals(this.ipRanges, ipReservationFacility.ipRanges) && - Objects.equals(this.metro, ipReservationFacility.metro) && - Objects.equals(this.name, ipReservationFacility.name)&& - Objects.equals(this.additionalProperties, ipReservationFacility.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(address, code, features, id, ipRanges, metro, name, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class IPReservationFacility {\n"); - sb.append(" address: ").append(toIndentedString(address)).append("\n"); - sb.append(" code: ").append(toIndentedString(code)).append("\n"); - sb.append(" features: ").append(toIndentedString(features)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" ipRanges: ").append(toIndentedString(ipRanges)).append("\n"); - sb.append(" metro: ").append(toIndentedString(metro)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).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("address"); - openapiFields.add("code"); - openapiFields.add("features"); - openapiFields.add("id"); - openapiFields.add("ip_ranges"); - openapiFields.add("metro"); - openapiFields.add("name"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * 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 IPReservationFacility - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (IPReservationFacility.openapiRequiredFields.isEmpty()) { - return; - } else { // has required fields - throw new IllegalArgumentException(String.format("The required field(s) %s in IPReservationFacility is not found in the empty JSON string", IPReservationFacility.openapiRequiredFields.toString())); - } - } - // validate the optional field `address` - if (jsonObj.get("address") != null && !jsonObj.get("address").isJsonNull()) { - Address.validateJsonObject(jsonObj.getAsJsonObject("address")); - } - if ((jsonObj.get("code") != null && !jsonObj.get("code").isJsonNull()) && !jsonObj.get("code").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("code").toString())); - } - // ensure the json data is an array - if ((jsonObj.get("features") != null && !jsonObj.get("features").isJsonNull()) && !jsonObj.get("features").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `features` to be an array in the JSON string but got `%s`", jsonObj.get("features").toString())); - } - 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())); - } - // 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())); - } - // validate the optional field `metro` - if (jsonObj.get("metro") != null && !jsonObj.get("metro").isJsonNull()) { - DeviceMetro.validateJsonObject(jsonObj.getAsJsonObject("metro")); - } - 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())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!IPReservationFacility.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'IPReservationFacility' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(IPReservationFacility.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, IPReservationFacility 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 IPReservationFacility read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - IPReservationFacility 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 IPReservationFacility given an JSON string - * - * @param jsonString JSON string - * @return An instance of IPReservationFacility - * @throws IOException if the JSON string is invalid with respect to IPReservationFacility - */ - public static IPReservationFacility fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, IPReservationFacility.class); - } - - /** - * Convert an instance of IPReservationFacility 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/IPReservationList.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/IPReservationList.java index 988ec0579..afbc9dd67 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 @@ -15,7 +15,7 @@ import java.util.Objects; import java.util.Arrays; -import com.equinix.openapi.metal.v1.model.IPReservationListIpAddressesInner; +import com.equinix.openapi.metal.v1.model.IPReservation; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -54,18 +54,18 @@ public class IPReservationList { public static final String SERIALIZED_NAME_IP_ADDRESSES = "ip_addresses"; @SerializedName(SERIALIZED_NAME_IP_ADDRESSES) - private List ipAddresses = null; + private List ipAddresses = null; public IPReservationList() { } - public IPReservationList ipAddresses(List ipAddresses) { + public IPReservationList ipAddresses(List ipAddresses) { this.ipAddresses = ipAddresses; return this; } - public IPReservationList addIpAddressesItem(IPReservationListIpAddressesInner ipAddressesItem) { + public IPReservationList addIpAddressesItem(IPReservation ipAddressesItem) { if (this.ipAddresses == null) { this.ipAddresses = new ArrayList<>(); } @@ -80,12 +80,12 @@ public IPReservationList addIpAddressesItem(IPReservationListIpAddressesInner ip @javax.annotation.Nullable @ApiModelProperty(value = "") - public List getIpAddresses() { + public List getIpAddresses() { return ipAddresses; } - public void setIpAddresses(List ipAddresses) { + public void setIpAddresses(List ipAddresses) { this.ipAddresses = ipAddresses; } @@ -201,7 +201,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `ip_addresses` (array) for (int i = 0; i < jsonArrayipAddresses.size(); i++) { - IPReservationListIpAddressesInner.validateJsonObject(jsonArrayipAddresses.get(i).getAsJsonObject()); + IPReservation.validateJsonObject(jsonArrayipAddresses.get(i).getAsJsonObject()); }; } } diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/IPReservationListIpAddressesInner.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/IPReservationListIpAddressesInner.java deleted file mode 100644 index 18ffad18f..000000000 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/IPReservationListIpAddressesInner.java +++ /dev/null @@ -1,287 +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.equinix.openapi.metal.v1.model.Href; -import com.equinix.openapi.metal.v1.model.IPAssignment; -import com.equinix.openapi.metal.v1.model.IPReservation; -import com.equinix.openapi.metal.v1.model.IPReservationFacility; -import com.equinix.openapi.metal.v1.model.IPReservationMetro; -import com.equinix.openapi.metal.v1.model.MetalGatewayLite; -import com.equinix.openapi.metal.v1.model.Project; -import com.equinix.openapi.metal.v1.model.Vrf; -import com.equinix.openapi.metal.v1.model.VrfIpReservation; -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.time.OffsetDateTime; -import java.util.ArrayList; -import java.util.List; -import java.util.UUID; - -import javax.ws.rs.core.GenericType; - -import java.io.IOException; -import java.lang.reflect.Type; -import java.util.logging.Level; -import java.util.logging.Logger; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashSet; -import java.util.HashMap; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.JsonPrimitive; -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 com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonSerializationContext; -import com.google.gson.JsonSerializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; - -import com.equinix.openapi.JSON; - -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class IPReservationListIpAddressesInner extends AbstractOpenApiSchema { - private static final Logger log = Logger.getLogger(IPReservationListIpAddressesInner.class.getName()); - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!IPReservationListIpAddressesInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'IPReservationListIpAddressesInner' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter adapterIPReservation = gson.getDelegateAdapter(this, TypeToken.get(IPReservation.class)); - final TypeAdapter adapterVrfIpReservation = gson.getDelegateAdapter(this, TypeToken.get(VrfIpReservation.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, IPReservationListIpAddressesInner value) throws IOException { - if (value == null || value.getActualInstance() == null) { - elementAdapter.write(out, null); - return; - } - - // check if the actual instance is of the type `IPReservation` - if (value.getActualInstance() instanceof IPReservation) { - JsonObject obj = adapterIPReservation.toJsonTree((IPReservation)value.getActualInstance()).getAsJsonObject(); - elementAdapter.write(out, obj); - return; - } - - // check if the actual instance is of the type `VrfIpReservation` - if (value.getActualInstance() instanceof VrfIpReservation) { - JsonObject obj = adapterVrfIpReservation.toJsonTree((VrfIpReservation)value.getActualInstance()).getAsJsonObject(); - elementAdapter.write(out, obj); - return; - } - - throw new IOException("Failed to serialize as the type doesn't match anyOf schemas: IPReservation, VrfIpReservation"); - } - - @Override - public IPReservationListIpAddressesInner read(JsonReader in) throws IOException { - Object deserialized = null; - JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); - - // deserialize IPReservation - try { - // validate the JSON object to see if any exception is thrown - IPReservation.validateJsonObject(jsonObject); - log.log(Level.FINER, "Input data matches schema 'IPReservation'"); - IPReservationListIpAddressesInner ret = new IPReservationListIpAddressesInner(); - ret.setActualInstance(adapterIPReservation.fromJsonTree(jsonObject)); - return ret; - } catch (Exception e) { - // deserialization failed, continue - log.log(Level.FINER, "Input data does not match schema 'IPReservation'", e); - } - - // deserialize VrfIpReservation - try { - // validate the JSON object to see if any exception is thrown - VrfIpReservation.validateJsonObject(jsonObject); - log.log(Level.FINER, "Input data matches schema 'VrfIpReservation'"); - IPReservationListIpAddressesInner ret = new IPReservationListIpAddressesInner(); - ret.setActualInstance(adapterVrfIpReservation.fromJsonTree(jsonObject)); - return ret; - } catch (Exception e) { - // deserialization failed, continue - log.log(Level.FINER, "Input data does not match schema 'VrfIpReservation'", e); - } - - - throw new IOException(String.format("Failed deserialization for IPReservationListIpAddressesInner: no class matched. JSON: %s", jsonObject.toString())); - } - }.nullSafe(); - } - } - - // store a list of schema names defined in anyOf - public static final Map schemas = new HashMap(); - - public IPReservationListIpAddressesInner() { - super("anyOf", Boolean.FALSE); - } - - public IPReservationListIpAddressesInner(IPReservation o) { - super("anyOf", Boolean.FALSE); - setActualInstance(o); - } - - public IPReservationListIpAddressesInner(VrfIpReservation o) { - super("anyOf", Boolean.FALSE); - setActualInstance(o); - } - - static { - schemas.put("IPReservation", new GenericType() { - }); - schemas.put("VrfIpReservation", new GenericType() { - }); - } - - @Override - public Map getSchemas() { - return IPReservationListIpAddressesInner.schemas; - } - - /** - * Set the instance that matches the anyOf child schema, check - * the instance parameter is valid against the anyOf child schemas: - * IPReservation, VrfIpReservation - * - * It could be an instance of the 'anyOf' schemas. - * The anyOf child schemas may themselves be a composed schema (allOf, anyOf, anyOf). - */ - @Override - public void setActualInstance(Object instance) { - if (instance instanceof IPReservation) { - super.setActualInstance(instance); - return; - } - - if (instance instanceof VrfIpReservation) { - super.setActualInstance(instance); - return; - } - - throw new RuntimeException("Invalid instance type. Must be IPReservation, VrfIpReservation"); - } - - /** - * Get the actual instance, which can be the following: - * IPReservation, VrfIpReservation - * - * @return The actual instance (IPReservation, VrfIpReservation) - */ - @Override - public Object getActualInstance() { - return super.getActualInstance(); - } - - /** - * Get the actual instance of `IPReservation`. If the actual instance is not `IPReservation`, - * the ClassCastException will be thrown. - * - * @return The actual instance of `IPReservation` - * @throws ClassCastException if the instance is not `IPReservation` - */ - public IPReservation getIPReservation() throws ClassCastException { - return (IPReservation)super.getActualInstance(); - } - - /** - * Get the actual instance of `VrfIpReservation`. If the actual instance is not `VrfIpReservation`, - * the ClassCastException will be thrown. - * - * @return The actual instance of `VrfIpReservation` - * @throws ClassCastException if the instance is not `VrfIpReservation` - */ - public VrfIpReservation getVrfIpReservation() throws ClassCastException { - return (VrfIpReservation)super.getActualInstance(); - } - - - /** - * 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 IPReservationListIpAddressesInner - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - // validate anyOf schemas one by one - int validCount = 0; - // validate the json string with IPReservation - try { - IPReservation.validateJsonObject(jsonObj); - return; // return earlier as at least one schema is valid with respect to the Json object - //validCount++; - } catch (Exception e) { - // continue to the next one - } - // validate the json string with VrfIpReservation - try { - VrfIpReservation.validateJsonObject(jsonObj); - return; // return earlier as at least one schema is valid with respect to the Json object - //validCount++; - } catch (Exception e) { - // continue to the next one - } - if (validCount == 0) { - throw new IOException(String.format("The JSON string is invalid for IPReservationListIpAddressesInner with anyOf schemas: IPReservation, VrfIpReservation. JSON: %s", jsonObj.toString())); - } - } - - /** - * Create an instance of IPReservationListIpAddressesInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of IPReservationListIpAddressesInner - * @throws IOException if the JSON string is invalid with respect to IPReservationListIpAddressesInner - */ - public static IPReservationListIpAddressesInner fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, IPReservationListIpAddressesInner.class); - } - - /** - * Convert an instance of IPReservationListIpAddressesInner 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/MetalGateway.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/MetalGateway.java index 38c3bba07..d9c3c3cca 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/MetalGateway.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/MetalGateway.java @@ -16,9 +16,10 @@ import java.util.Objects; import java.util.Arrays; import com.equinix.openapi.metal.v1.model.Href; -import com.equinix.openapi.metal.v1.model.IPReservation; +import com.equinix.openapi.metal.v1.model.MetalGatewayIpReservation; import com.equinix.openapi.metal.v1.model.Project; import com.equinix.openapi.metal.v1.model.VirtualNetwork; +import com.equinix.openapi.metal.v1.model.Vrf; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -73,7 +74,7 @@ public class MetalGateway { public static final String SERIALIZED_NAME_IP_RESERVATION = "ip_reservation"; @SerializedName(SERIALIZED_NAME_IP_RESERVATION) - private IPReservation ipReservation; + private MetalGatewayIpReservation ipReservation; public static final String SERIALIZED_NAME_PROJECT = "project"; @SerializedName(SERIALIZED_NAME_PROJECT) @@ -140,6 +141,10 @@ public StateEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_VIRTUAL_NETWORK) private VirtualNetwork virtualNetwork; + public static final String SERIALIZED_NAME_VRF = "vrf"; + @SerializedName(SERIALIZED_NAME_VRF) + private Vrf vrf; + public MetalGateway() { } @@ -235,7 +240,7 @@ public void setId(UUID id) { } - public MetalGateway ipReservation(IPReservation ipReservation) { + public MetalGateway ipReservation(MetalGatewayIpReservation ipReservation) { this.ipReservation = ipReservation; return this; @@ -248,12 +253,12 @@ public MetalGateway ipReservation(IPReservation ipReservation) { @javax.annotation.Nullable @ApiModelProperty(value = "") - public IPReservation getIpReservation() { + public MetalGatewayIpReservation getIpReservation() { return ipReservation; } - public void setIpReservation(IPReservation ipReservation) { + public void setIpReservation(MetalGatewayIpReservation ipReservation) { this.ipReservation = ipReservation; } @@ -349,6 +354,29 @@ public void setVirtualNetwork(VirtualNetwork virtualNetwork) { this.virtualNetwork = virtualNetwork; } + + public MetalGateway vrf(Vrf vrf) { + + this.vrf = vrf; + return this; + } + + /** + * Get vrf + * @return vrf + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Vrf getVrf() { + return vrf; + } + + + public void setVrf(Vrf vrf) { + this.vrf = vrf; + } + /** * A container for additional, undeclared properties. * This is a holder for any undeclared properties as specified with @@ -403,13 +431,14 @@ public boolean equals(Object o) { Objects.equals(this.project, metalGateway.project) && Objects.equals(this.state, metalGateway.state) && Objects.equals(this.updatedAt, metalGateway.updatedAt) && - Objects.equals(this.virtualNetwork, metalGateway.virtualNetwork)&& + Objects.equals(this.virtualNetwork, metalGateway.virtualNetwork) && + Objects.equals(this.vrf, metalGateway.vrf)&& Objects.equals(this.additionalProperties, metalGateway.additionalProperties); } @Override public int hashCode() { - return Objects.hash(createdAt, createdBy, href, id, ipReservation, project, state, updatedAt, virtualNetwork, additionalProperties); + return Objects.hash(createdAt, createdBy, href, id, ipReservation, project, state, updatedAt, virtualNetwork, vrf, additionalProperties); } @Override @@ -425,6 +454,7 @@ public String toString() { sb.append(" state: ").append(toIndentedString(state)).append("\n"); sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); sb.append(" virtualNetwork: ").append(toIndentedString(virtualNetwork)).append("\n"); + sb.append(" vrf: ").append(toIndentedString(vrf)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); @@ -457,6 +487,7 @@ private String toIndentedString(Object o) { openapiFields.add("state"); openapiFields.add("updated_at"); openapiFields.add("virtual_network"); + openapiFields.add("vrf"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -488,7 +519,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field `ip_reservation` if (jsonObj.get("ip_reservation") != null && !jsonObj.get("ip_reservation").isJsonNull()) { - IPReservation.validateJsonObject(jsonObj.getAsJsonObject("ip_reservation")); + MetalGatewayIpReservation.validateJsonObject(jsonObj.getAsJsonObject("ip_reservation")); } // validate the optional field `project` if (jsonObj.get("project") != null && !jsonObj.get("project").isJsonNull()) { @@ -501,6 +532,10 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if (jsonObj.get("virtual_network") != null && !jsonObj.get("virtual_network").isJsonNull()) { VirtualNetwork.validateJsonObject(jsonObj.getAsJsonObject("virtual_network")); } + // validate the optional field `vrf` + if (jsonObj.get("vrf") != null && !jsonObj.get("vrf").isJsonNull()) { + Vrf.validateJsonObject(jsonObj.getAsJsonObject("vrf")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/RequestIPReservation201Response.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/MetalGatewayIpReservation.java similarity index 69% rename from equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/RequestIPReservation201Response.java rename to equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/MetalGatewayIpReservation.java index 4f80d2774..53e34252c 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/RequestIPReservation201Response.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/MetalGatewayIpReservation.java @@ -16,14 +16,11 @@ import java.util.Objects; import java.util.Arrays; import com.equinix.openapi.metal.v1.model.Href; -import com.equinix.openapi.metal.v1.model.IPAssignment; +import com.equinix.openapi.metal.v1.model.HrefOnly; import com.equinix.openapi.metal.v1.model.IPReservation; -import com.equinix.openapi.metal.v1.model.IPReservationFacility; import com.equinix.openapi.metal.v1.model.IPReservationMetro; import com.equinix.openapi.metal.v1.model.MetalGatewayLite; import com.equinix.openapi.metal.v1.model.Project; -import com.equinix.openapi.metal.v1.model.Vrf; -import com.equinix.openapi.metal.v1.model.VrfIpReservation; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -71,47 +68,47 @@ import com.equinix.openapi.JSON; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class RequestIPReservation201Response extends AbstractOpenApiSchema { - private static final Logger log = Logger.getLogger(RequestIPReservation201Response.class.getName()); +public class MetalGatewayIpReservation extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(MetalGatewayIpReservation.class.getName()); public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!RequestIPReservation201Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'RequestIPReservation201Response' and its subtypes + if (!MetalGatewayIpReservation.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MetalGatewayIpReservation' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterHrefOnly = gson.getDelegateAdapter(this, TypeToken.get(HrefOnly.class)); final TypeAdapter adapterIPReservation = gson.getDelegateAdapter(this, TypeToken.get(IPReservation.class)); - final TypeAdapter adapterVrfIpReservation = gson.getDelegateAdapter(this, TypeToken.get(VrfIpReservation.class)); - return (TypeAdapter) new TypeAdapter() { + return (TypeAdapter) new TypeAdapter() { @Override - public void write(JsonWriter out, RequestIPReservation201Response value) throws IOException { + public void write(JsonWriter out, MetalGatewayIpReservation value) throws IOException { if (value == null || value.getActualInstance() == null) { elementAdapter.write(out, null); return; } - // check if the actual instance is of the type `IPReservation` - if (value.getActualInstance() instanceof IPReservation) { - JsonObject obj = adapterIPReservation.toJsonTree((IPReservation)value.getActualInstance()).getAsJsonObject(); + // check if the actual instance is of the type `HrefOnly` + if (value.getActualInstance() instanceof HrefOnly) { + JsonObject obj = adapterHrefOnly.toJsonTree((HrefOnly)value.getActualInstance()).getAsJsonObject(); elementAdapter.write(out, obj); return; } - // check if the actual instance is of the type `VrfIpReservation` - if (value.getActualInstance() instanceof VrfIpReservation) { - JsonObject obj = adapterVrfIpReservation.toJsonTree((VrfIpReservation)value.getActualInstance()).getAsJsonObject(); + // check if the actual instance is of the type `IPReservation` + if (value.getActualInstance() instanceof IPReservation) { + JsonObject obj = adapterIPReservation.toJsonTree((IPReservation)value.getActualInstance()).getAsJsonObject(); elementAdapter.write(out, obj); return; } - throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: IPReservation, VrfIpReservation"); + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: HrefOnly, IPReservation"); } @Override - public RequestIPReservation201Response read(JsonReader in) throws IOException { + public MetalGatewayIpReservation read(JsonReader in) throws IOException { Object deserialized = null; JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); @@ -119,39 +116,39 @@ public RequestIPReservation201Response read(JsonReader in) throws IOException { ArrayList errorMessages = new ArrayList<>(); TypeAdapter actualAdapter = elementAdapter; - // deserialize IPReservation + // deserialize HrefOnly try { // validate the JSON object to see if any exception is thrown - IPReservation.validateJsonObject(jsonObject); - actualAdapter = adapterIPReservation; + HrefOnly.validateJsonObject(jsonObject); + actualAdapter = adapterHrefOnly; match++; - log.log(Level.FINER, "Input data matches schema 'IPReservation'"); + log.log(Level.FINER, "Input data matches schema 'HrefOnly'"); } catch (Exception e) { // deserialization failed, continue - errorMessages.add(String.format("Deserialization for IPReservation failed with `%s`.", e.getMessage())); - log.log(Level.FINER, "Input data does not match schema 'IPReservation'", e); + errorMessages.add(String.format("Deserialization for HrefOnly failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'HrefOnly'", e); } - // deserialize VrfIpReservation + // deserialize IPReservation try { // validate the JSON object to see if any exception is thrown - VrfIpReservation.validateJsonObject(jsonObject); - actualAdapter = adapterVrfIpReservation; + IPReservation.validateJsonObject(jsonObject); + actualAdapter = adapterIPReservation; match++; - log.log(Level.FINER, "Input data matches schema 'VrfIpReservation'"); + log.log(Level.FINER, "Input data matches schema 'IPReservation'"); } catch (Exception e) { // deserialization failed, continue - errorMessages.add(String.format("Deserialization for VrfIpReservation failed with `%s`.", e.getMessage())); - log.log(Level.FINER, "Input data does not match schema 'VrfIpReservation'", e); + errorMessages.add(String.format("Deserialization for IPReservation failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'IPReservation'", e); } if (match == 1) { - RequestIPReservation201Response ret = new RequestIPReservation201Response(); + MetalGatewayIpReservation ret = new MetalGatewayIpReservation(); ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); return ret; } - throw new IOException(String.format("Failed deserialization for RequestIPReservation201Response: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); + throw new IOException(String.format("Failed deserialization for MetalGatewayIpReservation: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); } }.nullSafe(); } @@ -160,60 +157,60 @@ public RequestIPReservation201Response read(JsonReader in) throws IOException { // store a list of schema names defined in oneOf public static final Map schemas = new HashMap(); - public RequestIPReservation201Response() { + public MetalGatewayIpReservation() { super("oneOf", Boolean.FALSE); } - public RequestIPReservation201Response(IPReservation o) { + public MetalGatewayIpReservation(HrefOnly o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } - public RequestIPReservation201Response(VrfIpReservation o) { + public MetalGatewayIpReservation(IPReservation o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } static { - schemas.put("IPReservation", new GenericType() { + schemas.put("HrefOnly", new GenericType() { }); - schemas.put("VrfIpReservation", new GenericType() { + schemas.put("IPReservation", new GenericType() { }); } @Override public Map getSchemas() { - return RequestIPReservation201Response.schemas; + return MetalGatewayIpReservation.schemas; } /** * Set the instance that matches the oneOf child schema, check * the instance parameter is valid against the oneOf child schemas: - * IPReservation, VrfIpReservation + * HrefOnly, IPReservation * * 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 IPReservation) { + if (instance instanceof HrefOnly) { super.setActualInstance(instance); return; } - if (instance instanceof VrfIpReservation) { + if (instance instanceof IPReservation) { super.setActualInstance(instance); return; } - throw new RuntimeException("Invalid instance type. Must be IPReservation, VrfIpReservation"); + throw new RuntimeException("Invalid instance type. Must be HrefOnly, IPReservation"); } /** * Get the actual instance, which can be the following: - * IPReservation, VrfIpReservation + * HrefOnly, IPReservation * - * @return The actual instance (IPReservation, VrfIpReservation) + * @return The actual instance (HrefOnly, IPReservation) */ @Override public Object getActualInstance() { @@ -221,25 +218,25 @@ public Object getActualInstance() { } /** - * Get the actual instance of `IPReservation`. If the actual instance is not `IPReservation`, + * Get the actual instance of `HrefOnly`. If the actual instance is not `HrefOnly`, * the ClassCastException will be thrown. * - * @return The actual instance of `IPReservation` - * @throws ClassCastException if the instance is not `IPReservation` + * @return The actual instance of `HrefOnly` + * @throws ClassCastException if the instance is not `HrefOnly` */ - public IPReservation getIPReservation() throws ClassCastException { - return (IPReservation)super.getActualInstance(); + public HrefOnly getHrefOnly() throws ClassCastException { + return (HrefOnly)super.getActualInstance(); } /** - * Get the actual instance of `VrfIpReservation`. If the actual instance is not `VrfIpReservation`, + * Get the actual instance of `IPReservation`. If the actual instance is not `IPReservation`, * the ClassCastException will be thrown. * - * @return The actual instance of `VrfIpReservation` - * @throws ClassCastException if the instance is not `VrfIpReservation` + * @return The actual instance of `IPReservation` + * @throws ClassCastException if the instance is not `IPReservation` */ - public VrfIpReservation getVrfIpReservation() throws ClassCastException { - return (VrfIpReservation)super.getActualInstance(); + public IPReservation getIPReservation() throws ClassCastException { + return (IPReservation)super.getActualInstance(); } @@ -247,46 +244,46 @@ public VrfIpReservation getVrfIpReservation() throws ClassCastException { * 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 RequestIPReservation201Response + * @throws IOException if the JSON Object is invalid with respect to MetalGatewayIpReservation */ 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 IPReservation + // validate the json string with HrefOnly try { - IPReservation.validateJsonObject(jsonObj); + HrefOnly.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { - errorMessages.add(String.format("Deserialization for IPReservation failed with `%s`.", e.getMessage())); + errorMessages.add(String.format("Deserialization for HrefOnly failed with `%s`.", e.getMessage())); // continue to the next one } - // validate the json string with VrfIpReservation + // validate the json string with IPReservation try { - VrfIpReservation.validateJsonObject(jsonObj); + IPReservation.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { - errorMessages.add(String.format("Deserialization for VrfIpReservation failed with `%s`.", e.getMessage())); + errorMessages.add(String.format("Deserialization for IPReservation failed with `%s`.", e.getMessage())); // continue to the next one } if (validCount != 1) { - throw new IOException(String.format("The JSON string is invalid for RequestIPReservation201Response with oneOf schemas: IPReservation, VrfIpReservation. %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 MetalGatewayIpReservation with oneOf schemas: HrefOnly, IPReservation. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); } } /** - * Create an instance of RequestIPReservation201Response given an JSON string + * Create an instance of MetalGatewayIpReservation given an JSON string * * @param jsonString JSON string - * @return An instance of RequestIPReservation201Response - * @throws IOException if the JSON string is invalid with respect to RequestIPReservation201Response + * @return An instance of MetalGatewayIpReservation + * @throws IOException if the JSON string is invalid with respect to MetalGatewayIpReservation */ - public static RequestIPReservation201Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, RequestIPReservation201Response.class); + public static MetalGatewayIpReservation fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MetalGatewayIpReservation.class); } /** - * Convert an instance of RequestIPReservation201Response to an JSON string + * Convert an instance of MetalGatewayIpReservation 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 8a59e667d..d3e451aae 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 @@ -15,7 +15,7 @@ import java.util.Objects; import java.util.Arrays; -import com.equinix.openapi.metal.v1.model.MetalGatewayListMetalGatewaysInner; +import com.equinix.openapi.metal.v1.model.MetalGateway; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -52,20 +52,20 @@ */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class MetalGatewayList { - public static final String SERIALIZED_NAME_METAL_GATEWAYS = "MetalGateways"; + public static final String SERIALIZED_NAME_METAL_GATEWAYS = "metal_gateways"; @SerializedName(SERIALIZED_NAME_METAL_GATEWAYS) - private List metalGateways = null; + private List metalGateways = null; public MetalGatewayList() { } - public MetalGatewayList metalGateways(List metalGateways) { + public MetalGatewayList metalGateways(List metalGateways) { this.metalGateways = metalGateways; return this; } - public MetalGatewayList addMetalGatewaysItem(MetalGatewayListMetalGatewaysInner metalGatewaysItem) { + public MetalGatewayList addMetalGatewaysItem(MetalGateway metalGatewaysItem) { if (this.metalGateways == null) { this.metalGateways = new ArrayList<>(); } @@ -80,12 +80,12 @@ public MetalGatewayList addMetalGatewaysItem(MetalGatewayListMetalGatewaysInner @javax.annotation.Nullable @ApiModelProperty(value = "") - public List getMetalGateways() { + public List getMetalGateways() { return metalGateways; } - public void setMetalGateways(List metalGateways) { + public void setMetalGateways(List metalGateways) { this.metalGateways = metalGateways; } @@ -172,7 +172,7 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("MetalGateways"); + openapiFields.add("metal_gateways"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -192,16 +192,16 @@ 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("MetalGateways"); + JsonArray jsonArraymetalGateways = jsonObj.getAsJsonArray("metal_gateways"); if (jsonArraymetalGateways != null) { // ensure the json data is an array - if (!jsonObj.get("MetalGateways").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `MetalGateways` to be an array in the JSON string but got `%s`", jsonObj.get("MetalGateways").toString())); + 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 `MetalGateways` (array) + // validate the optional field `metal_gateways` (array) for (int i = 0; i < jsonArraymetalGateways.size(); i++) { - MetalGatewayListMetalGatewaysInner.validateJsonObject(jsonArraymetalGateways.get(i).getAsJsonObject()); + MetalGateway.validateJsonObject(jsonArraymetalGateways.get(i).getAsJsonObject()); }; } } diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/MetalGatewayListMetalGatewaysInner.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/MetalGatewayListMetalGatewaysInner.java deleted file mode 100644 index b0ca334f9..000000000 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/MetalGatewayListMetalGatewaysInner.java +++ /dev/null @@ -1,283 +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.equinix.openapi.metal.v1.model.Href; -import com.equinix.openapi.metal.v1.model.MetalGateway; -import com.equinix.openapi.metal.v1.model.Project; -import com.equinix.openapi.metal.v1.model.VirtualNetwork; -import com.equinix.openapi.metal.v1.model.Vrf; -import com.equinix.openapi.metal.v1.model.VrfIpReservation; -import com.equinix.openapi.metal.v1.model.VrfMetalGateway; -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.time.OffsetDateTime; -import java.util.UUID; - -import javax.ws.rs.core.GenericType; - -import java.io.IOException; -import java.lang.reflect.Type; -import java.util.logging.Level; -import java.util.logging.Logger; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashSet; -import java.util.HashMap; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.JsonPrimitive; -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 com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonSerializationContext; -import com.google.gson.JsonSerializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; - -import com.equinix.openapi.JSON; - -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class MetalGatewayListMetalGatewaysInner extends AbstractOpenApiSchema { - private static final Logger log = Logger.getLogger(MetalGatewayListMetalGatewaysInner.class.getName()); - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!MetalGatewayListMetalGatewaysInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'MetalGatewayListMetalGatewaysInner' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter adapterMetalGateway = gson.getDelegateAdapter(this, TypeToken.get(MetalGateway.class)); - final TypeAdapter adapterVrfMetalGateway = gson.getDelegateAdapter(this, TypeToken.get(VrfMetalGateway.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, MetalGatewayListMetalGatewaysInner value) throws IOException { - if (value == null || value.getActualInstance() == null) { - elementAdapter.write(out, null); - return; - } - - // check if the actual instance is of the type `MetalGateway` - if (value.getActualInstance() instanceof MetalGateway) { - JsonObject obj = adapterMetalGateway.toJsonTree((MetalGateway)value.getActualInstance()).getAsJsonObject(); - elementAdapter.write(out, obj); - return; - } - - // check if the actual instance is of the type `VrfMetalGateway` - if (value.getActualInstance() instanceof VrfMetalGateway) { - JsonObject obj = adapterVrfMetalGateway.toJsonTree((VrfMetalGateway)value.getActualInstance()).getAsJsonObject(); - elementAdapter.write(out, obj); - return; - } - - throw new IOException("Failed to serialize as the type doesn't match anyOf schemas: MetalGateway, VrfMetalGateway"); - } - - @Override - public MetalGatewayListMetalGatewaysInner read(JsonReader in) throws IOException { - Object deserialized = null; - JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); - - // deserialize MetalGateway - try { - // validate the JSON object to see if any exception is thrown - MetalGateway.validateJsonObject(jsonObject); - log.log(Level.FINER, "Input data matches schema 'MetalGateway'"); - MetalGatewayListMetalGatewaysInner ret = new MetalGatewayListMetalGatewaysInner(); - ret.setActualInstance(adapterMetalGateway.fromJsonTree(jsonObject)); - return ret; - } catch (Exception e) { - // deserialization failed, continue - log.log(Level.FINER, "Input data does not match schema 'MetalGateway'", e); - } - - // deserialize VrfMetalGateway - try { - // validate the JSON object to see if any exception is thrown - VrfMetalGateway.validateJsonObject(jsonObject); - log.log(Level.FINER, "Input data matches schema 'VrfMetalGateway'"); - MetalGatewayListMetalGatewaysInner ret = new MetalGatewayListMetalGatewaysInner(); - ret.setActualInstance(adapterVrfMetalGateway.fromJsonTree(jsonObject)); - return ret; - } catch (Exception e) { - // deserialization failed, continue - log.log(Level.FINER, "Input data does not match schema 'VrfMetalGateway'", e); - } - - - throw new IOException(String.format("Failed deserialization for MetalGatewayListMetalGatewaysInner: no class matched. JSON: %s", jsonObject.toString())); - } - }.nullSafe(); - } - } - - // store a list of schema names defined in anyOf - public static final Map schemas = new HashMap(); - - public MetalGatewayListMetalGatewaysInner() { - super("anyOf", Boolean.FALSE); - } - - public MetalGatewayListMetalGatewaysInner(MetalGateway o) { - super("anyOf", Boolean.FALSE); - setActualInstance(o); - } - - public MetalGatewayListMetalGatewaysInner(VrfMetalGateway o) { - super("anyOf", Boolean.FALSE); - setActualInstance(o); - } - - static { - schemas.put("MetalGateway", new GenericType() { - }); - schemas.put("VrfMetalGateway", new GenericType() { - }); - } - - @Override - public Map getSchemas() { - return MetalGatewayListMetalGatewaysInner.schemas; - } - - /** - * Set the instance that matches the anyOf child schema, check - * the instance parameter is valid against the anyOf child schemas: - * MetalGateway, VrfMetalGateway - * - * It could be an instance of the 'anyOf' schemas. - * The anyOf child schemas may themselves be a composed schema (allOf, anyOf, anyOf). - */ - @Override - public void setActualInstance(Object instance) { - if (instance instanceof MetalGateway) { - super.setActualInstance(instance); - return; - } - - if (instance instanceof VrfMetalGateway) { - super.setActualInstance(instance); - return; - } - - throw new RuntimeException("Invalid instance type. Must be MetalGateway, VrfMetalGateway"); - } - - /** - * Get the actual instance, which can be the following: - * MetalGateway, VrfMetalGateway - * - * @return The actual instance (MetalGateway, VrfMetalGateway) - */ - @Override - public Object getActualInstance() { - return super.getActualInstance(); - } - - /** - * Get the actual instance of `MetalGateway`. If the actual instance is not `MetalGateway`, - * the ClassCastException will be thrown. - * - * @return The actual instance of `MetalGateway` - * @throws ClassCastException if the instance is not `MetalGateway` - */ - public MetalGateway getMetalGateway() throws ClassCastException { - return (MetalGateway)super.getActualInstance(); - } - - /** - * Get the actual instance of `VrfMetalGateway`. If the actual instance is not `VrfMetalGateway`, - * the ClassCastException will be thrown. - * - * @return The actual instance of `VrfMetalGateway` - * @throws ClassCastException if the instance is not `VrfMetalGateway` - */ - public VrfMetalGateway getVrfMetalGateway() throws ClassCastException { - return (VrfMetalGateway)super.getActualInstance(); - } - - - /** - * 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 MetalGatewayListMetalGatewaysInner - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - // validate anyOf schemas one by one - int validCount = 0; - // validate the json string with MetalGateway - try { - MetalGateway.validateJsonObject(jsonObj); - return; // return earlier as at least one schema is valid with respect to the Json object - //validCount++; - } catch (Exception e) { - // continue to the next one - } - // validate the json string with VrfMetalGateway - try { - VrfMetalGateway.validateJsonObject(jsonObj); - return; // return earlier as at least one schema is valid with respect to the Json object - //validCount++; - } catch (Exception e) { - // continue to the next one - } - if (validCount == 0) { - throw new IOException(String.format("The JSON string is invalid for MetalGatewayListMetalGatewaysInner with anyOf schemas: MetalGateway, VrfMetalGateway. JSON: %s", jsonObj.toString())); - } - } - - /** - * Create an instance of MetalGatewayListMetalGatewaysInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of MetalGatewayListMetalGatewaysInner - * @throws IOException if the JSON string is invalid with respect to MetalGatewayListMetalGatewaysInner - */ - public static MetalGatewayListMetalGatewaysInner fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, MetalGatewayListMetalGatewaysInner.class); - } - - /** - * Convert an instance of MetalGatewayListMetalGatewaysInner 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/RequestIPReservationRequest.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/RequestIPReservationRequest.java index 90b73ff7a..fe42edb6a 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 @@ -16,7 +16,7 @@ import java.util.Objects; import java.util.Arrays; import com.equinix.openapi.metal.v1.model.IPReservationRequestInput; -import com.equinix.openapi.metal.v1.model.VrfIpReservationCreateInput; +import com.equinix.openapi.metal.v1.model.VrfIPReservationCreateInput; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -75,7 +75,7 @@ public TypeAdapter create(Gson gson, TypeToken type) { } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); final TypeAdapter adapterIPReservationRequestInput = gson.getDelegateAdapter(this, TypeToken.get(IPReservationRequestInput.class)); - final TypeAdapter adapterVrfIpReservationCreateInput = gson.getDelegateAdapter(this, TypeToken.get(VrfIpReservationCreateInput.class)); + final TypeAdapter adapterVrfIPReservationCreateInput = gson.getDelegateAdapter(this, TypeToken.get(VrfIPReservationCreateInput.class)); return (TypeAdapter) new TypeAdapter() { @Override @@ -92,14 +92,14 @@ public void write(JsonWriter out, RequestIPReservationRequest value) throws IOEx return; } - // check if the actual instance is of the type `VrfIpReservationCreateInput` - if (value.getActualInstance() instanceof VrfIpReservationCreateInput) { - JsonObject obj = adapterVrfIpReservationCreateInput.toJsonTree((VrfIpReservationCreateInput)value.getActualInstance()).getAsJsonObject(); + // check if the actual instance is of the type `VrfIPReservationCreateInput` + if (value.getActualInstance() instanceof VrfIPReservationCreateInput) { + JsonObject obj = adapterVrfIPReservationCreateInput.toJsonTree((VrfIPReservationCreateInput)value.getActualInstance()).getAsJsonObject(); elementAdapter.write(out, obj); 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: IPReservationRequestInput, VrfIPReservationCreateInput"); } @Override @@ -124,17 +124,17 @@ public RequestIPReservationRequest read(JsonReader in) throws IOException { log.log(Level.FINER, "Input data does not match schema 'IPReservationRequestInput'", e); } - // deserialize VrfIpReservationCreateInput + // deserialize VrfIPReservationCreateInput try { // validate the JSON object to see if any exception is thrown - VrfIpReservationCreateInput.validateJsonObject(jsonObject); - actualAdapter = adapterVrfIpReservationCreateInput; + VrfIPReservationCreateInput.validateJsonObject(jsonObject); + actualAdapter = adapterVrfIPReservationCreateInput; match++; - log.log(Level.FINER, "Input data matches schema 'VrfIpReservationCreateInput'"); + log.log(Level.FINER, "Input data matches schema 'VrfIPReservationCreateInput'"); } catch (Exception e) { // deserialization failed, continue - errorMessages.add(String.format("Deserialization for VrfIpReservationCreateInput failed with `%s`.", e.getMessage())); - log.log(Level.FINER, "Input data does not match schema 'VrfIpReservationCreateInput'", e); + errorMessages.add(String.format("Deserialization for VrfIPReservationCreateInput failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'VrfIPReservationCreateInput'", e); } if (match == 1) { @@ -161,7 +161,7 @@ public RequestIPReservationRequest(IPReservationRequestInput o) { setActualInstance(o); } - public RequestIPReservationRequest(VrfIpReservationCreateInput o) { + public RequestIPReservationRequest(VrfIPReservationCreateInput o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } @@ -169,7 +169,7 @@ public RequestIPReservationRequest(VrfIpReservationCreateInput o) { static { schemas.put("IPReservationRequestInput", new GenericType() { }); - schemas.put("VrfIpReservationCreateInput", new GenericType() { + schemas.put("VrfIPReservationCreateInput", new GenericType() { }); } @@ -181,7 +181,7 @@ 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 + * IPReservationRequestInput, VrfIPReservationCreateInput * * It could be an instance of the 'oneOf' schemas. * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). @@ -193,19 +193,19 @@ public void setActualInstance(Object instance) { return; } - if (instance instanceof VrfIpReservationCreateInput) { + if (instance instanceof VrfIPReservationCreateInput) { super.setActualInstance(instance); return; } - throw new RuntimeException("Invalid instance type. Must be IPReservationRequestInput, VrfIpReservationCreateInput"); + throw new RuntimeException("Invalid instance type. Must be IPReservationRequestInput, VrfIPReservationCreateInput"); } /** * Get the actual instance, which can be the following: - * IPReservationRequestInput, VrfIpReservationCreateInput + * IPReservationRequestInput, VrfIPReservationCreateInput * - * @return The actual instance (IPReservationRequestInput, VrfIpReservationCreateInput) + * @return The actual instance (IPReservationRequestInput, VrfIPReservationCreateInput) */ @Override public Object getActualInstance() { @@ -224,14 +224,14 @@ public IPReservationRequestInput getIPReservationRequestInput() throws ClassCast } /** - * Get the actual instance of `VrfIpReservationCreateInput`. If the actual instance is not `VrfIpReservationCreateInput`, + * Get the actual instance of `VrfIPReservationCreateInput`. If the actual instance is not `VrfIPReservationCreateInput`, * the ClassCastException will be thrown. * - * @return The actual instance of `VrfIpReservationCreateInput` - * @throws ClassCastException if the instance is not `VrfIpReservationCreateInput` + * @return The actual instance of `VrfIPReservationCreateInput` + * @throws ClassCastException if the instance is not `VrfIPReservationCreateInput` */ - public VrfIpReservationCreateInput getVrfIpReservationCreateInput() throws ClassCastException { - return (VrfIpReservationCreateInput)super.getActualInstance(); + public VrfIPReservationCreateInput getVrfIPReservationCreateInput() throws ClassCastException { + return (VrfIPReservationCreateInput)super.getActualInstance(); } @@ -253,16 +253,16 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { errorMessages.add(String.format("Deserialization for IPReservationRequestInput failed with `%s`.", e.getMessage())); // continue to the next one } - // validate the json string with VrfIpReservationCreateInput + // validate the json string with VrfIPReservationCreateInput try { - VrfIpReservationCreateInput.validateJsonObject(jsonObj); + VrfIPReservationCreateInput.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { - errorMessages.add(String.format("Deserialization for VrfIpReservationCreateInput failed with `%s`.", e.getMessage())); + errorMessages.add(String.format("Deserialization for VrfIPReservationCreateInput failed with `%s`.", e.getMessage())); // 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: IPReservationRequestInput, 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/User.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/User.java index a815fa09b..22a4e23f3 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 @@ -134,6 +134,10 @@ public class User { @SerializedName(SERIALIZED_NAME_UPDATED_AT) private OffsetDateTime updatedAt; + public static final String SERIALIZED_NAME_FEATURES = "features"; + @SerializedName(SERIALIZED_NAME_FEATURES) + private List features = null; + public User() { } @@ -604,6 +608,37 @@ public void setUpdatedAt(OffsetDateTime updatedAt) { this.updatedAt = updatedAt; } + + public User features(List features) { + + this.features = features; + return this; + } + + public User addFeaturesItem(String featuresItem) { + if (this.features == null) { + this.features = new ArrayList<>(); + } + this.features.add(featuresItem); + return this; + } + + /** + * Get features + * @return features + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public List getFeatures() { + return features; + } + + + public void setFeatures(List features) { + this.features = features; + } + /** * A container for additional, undeclared properties. * This is a holder for any undeclared properties as specified with @@ -669,13 +704,14 @@ public boolean equals(Object o) { Objects.equals(this.shortId, user.shortId) && Objects.equals(this.timezone, user.timezone) && Objects.equals(this.twoFactorAuth, user.twoFactorAuth) && - Objects.equals(this.updatedAt, user.updatedAt)&& + Objects.equals(this.updatedAt, user.updatedAt) && + Objects.equals(this.features, user.features)&& Objects.equals(this.additionalProperties, user.additionalProperties); } @Override public int hashCode() { - return Objects.hash(avatarThumbUrl, avatarUrl, createdAt, customdata, email, emails, firstName, fraudScore, fullName, href, id, lastLoginAt, lastName, maxOrganizations, maxProjects, phoneNumber, shortId, timezone, twoFactorAuth, updatedAt, additionalProperties); + return Objects.hash(avatarThumbUrl, avatarUrl, createdAt, customdata, email, emails, firstName, fraudScore, fullName, href, id, lastLoginAt, lastName, maxOrganizations, maxProjects, phoneNumber, shortId, timezone, twoFactorAuth, updatedAt, features, additionalProperties); } @Override @@ -702,6 +738,7 @@ public String toString() { sb.append(" timezone: ").append(toIndentedString(timezone)).append("\n"); sb.append(" twoFactorAuth: ").append(toIndentedString(twoFactorAuth)).append("\n"); sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" features: ").append(toIndentedString(features)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); @@ -745,6 +782,7 @@ private String toIndentedString(Object o) { openapiFields.add("timezone"); openapiFields.add("two_factor_auth"); openapiFields.add("updated_at"); + openapiFields.add("features"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -815,6 +853,10 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if ((jsonObj.get("two_factor_auth") != null && !jsonObj.get("two_factor_auth").isJsonNull()) && !jsonObj.get("two_factor_auth").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `two_factor_auth` to be a primitive type in the JSON string but got `%s`", jsonObj.get("two_factor_auth").toString())); } + // ensure the json data is an array + if ((jsonObj.get("features") != null && !jsonObj.get("features").isJsonNull()) && !jsonObj.get("features").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `features` to be an array in the JSON string but got `%s`", jsonObj.get("features").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/VrfIPReservation.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/VrfIPReservation.java new file mode 100644 index 000000000..d88a7feda --- /dev/null +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/VrfIPReservation.java @@ -0,0 +1,288 @@ +/* + * 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.equinix.openapi.metal.v1.model.Href; +import com.equinix.openapi.metal.v1.model.IPReservation; +import com.equinix.openapi.metal.v1.model.IPReservationMetro; +import com.equinix.openapi.metal.v1.model.MetalGatewayLite; +import com.equinix.openapi.metal.v1.model.Project; +import com.equinix.openapi.metal.v1.model.User; +import com.equinix.openapi.metal.v1.model.Vrf; +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.time.OffsetDateTime; +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; + +/** + * VrfIPReservation + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class VrfIPReservation extends IPReservation { + public static final String SERIALIZED_NAME_VRF = "vrf"; + @SerializedName(SERIALIZED_NAME_VRF) + private Vrf vrf; + + public static final String SERIALIZED_NAME_CREATED_BY = "created_by"; + @SerializedName(SERIALIZED_NAME_CREATED_BY) + private User createdBy; + + public VrfIPReservation() { + } + + public VrfIPReservation vrf(Vrf vrf) { + + this.vrf = vrf; + return this; + } + + /** + * Get vrf + * @return vrf + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public Vrf getVrf() { + return vrf; + } + + + public void setVrf(Vrf vrf) { + this.vrf = vrf; + } + + + public VrfIPReservation createdBy(User createdBy) { + + this.createdBy = createdBy; + return this; + } + + /** + * Get createdBy + * @return createdBy + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public User getCreatedBy() { + return createdBy; + } + + + public void setCreatedBy(User createdBy) { + this.createdBy = createdBy; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VrfIPReservation vrfIPReservation = (VrfIPReservation) o; + return Objects.equals(this.vrf, vrfIPReservation.vrf) && + Objects.equals(this.createdBy, vrfIPReservation.createdBy) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(vrf, createdBy, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VrfIPReservation {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" vrf: ").append(toIndentedString(vrf)).append("\n"); + sb.append(" createdBy: ").append(toIndentedString(createdBy)).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("address_family"); + openapiFields.add("bill"); + openapiFields.add("cidr"); + openapiFields.add("created_at"); + openapiFields.add("href"); + openapiFields.add("id"); + openapiFields.add("manageable"); + openapiFields.add("management"); + openapiFields.add("metal_gateway"); + openapiFields.add("metro"); + openapiFields.add("netmask"); + openapiFields.add("network"); + openapiFields.add("public"); + openapiFields.add("state"); + openapiFields.add("tags"); + openapiFields.add("details"); + openapiFields.add("customdata"); + openapiFields.add("project"); + openapiFields.add("project_lite"); + openapiFields.add("address"); + openapiFields.add("gateway"); + openapiFields.add("type"); + openapiFields.add("vrf"); + openapiFields.add("created_by"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("vrf"); + openapiRequiredFields.add("type"); + } + + /** + * 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 VrfIPReservation + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (VrfIPReservation.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in VrfIPReservation is not found in the empty JSON string", VrfIPReservation.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!VrfIPReservation.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `VrfIPReservation` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : VrfIPReservation.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())); + } + } + // validate the optional field `vrf` + if (jsonObj.get("vrf") != null && !jsonObj.get("vrf").isJsonNull()) { + Vrf.validateJsonObject(jsonObj.getAsJsonObject("vrf")); + } + // validate the optional field `created_by` + if (jsonObj.get("created_by") != null && !jsonObj.get("created_by").isJsonNull()) { + User.validateJsonObject(jsonObj.getAsJsonObject("created_by")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!VrfIPReservation.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'VrfIPReservation' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(VrfIPReservation.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, VrfIPReservation value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public VrfIPReservation read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of VrfIPReservation given an JSON string + * + * @param jsonString JSON string + * @return An instance of VrfIPReservation + * @throws IOException if the JSON string is invalid with respect to VrfIPReservation + */ + public static VrfIPReservation fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, VrfIPReservation.class); + } + + /** + * Convert an instance of VrfIPReservation 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/VrfIPReservationAllOf.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/VrfIPReservationAllOf.java new file mode 100644 index 000000000..ce944208e --- /dev/null +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/VrfIPReservationAllOf.java @@ -0,0 +1,310 @@ +/* + * 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.equinix.openapi.metal.v1.model.User; +import com.equinix.openapi.metal.v1.model.Vrf; +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 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; + +/** + * VrfIPReservationAllOf + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class VrfIPReservationAllOf { + public static final String SERIALIZED_NAME_VRF = "vrf"; + @SerializedName(SERIALIZED_NAME_VRF) + private Vrf vrf; + + public static final String SERIALIZED_NAME_CREATED_BY = "created_by"; + @SerializedName(SERIALIZED_NAME_CREATED_BY) + private User createdBy; + + public VrfIPReservationAllOf() { + } + + public VrfIPReservationAllOf vrf(Vrf vrf) { + + this.vrf = vrf; + return this; + } + + /** + * Get vrf + * @return vrf + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Vrf getVrf() { + return vrf; + } + + + public void setVrf(Vrf vrf) { + this.vrf = vrf; + } + + + public VrfIPReservationAllOf createdBy(User createdBy) { + + this.createdBy = createdBy; + return this; + } + + /** + * Get createdBy + * @return createdBy + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public User getCreatedBy() { + return createdBy; + } + + + public void setCreatedBy(User createdBy) { + this.createdBy = createdBy; + } + + /** + * 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 VrfIPReservationAllOf 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; + } + VrfIPReservationAllOf vrfIPReservationAllOf = (VrfIPReservationAllOf) o; + return Objects.equals(this.vrf, vrfIPReservationAllOf.vrf) && + Objects.equals(this.createdBy, vrfIPReservationAllOf.createdBy)&& + Objects.equals(this.additionalProperties, vrfIPReservationAllOf.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(vrf, createdBy, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VrfIPReservationAllOf {\n"); + sb.append(" vrf: ").append(toIndentedString(vrf)).append("\n"); + sb.append(" createdBy: ").append(toIndentedString(createdBy)).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("vrf"); + openapiFields.add("created_by"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * 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 VrfIPReservationAllOf + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (VrfIPReservationAllOf.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in VrfIPReservationAllOf is not found in the empty JSON string", VrfIPReservationAllOf.openapiRequiredFields.toString())); + } + } + // validate the optional field `vrf` + if (jsonObj.get("vrf") != null && !jsonObj.get("vrf").isJsonNull()) { + Vrf.validateJsonObject(jsonObj.getAsJsonObject("vrf")); + } + // validate the optional field `created_by` + if (jsonObj.get("created_by") != null && !jsonObj.get("created_by").isJsonNull()) { + User.validateJsonObject(jsonObj.getAsJsonObject("created_by")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!VrfIPReservationAllOf.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'VrfIPReservationAllOf' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(VrfIPReservationAllOf.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, VrfIPReservationAllOf 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 VrfIPReservationAllOf read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + VrfIPReservationAllOf 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 VrfIPReservationAllOf given an JSON string + * + * @param jsonString JSON string + * @return An instance of VrfIPReservationAllOf + * @throws IOException if the JSON string is invalid with respect to VrfIPReservationAllOf + */ + public static VrfIPReservationAllOf fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, VrfIPReservationAllOf.class); + } + + /** + * Convert an instance of VrfIPReservationAllOf 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/VrfIpReservationCreateInput.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/VrfIPReservationCreateInput.java similarity index 85% rename from equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/VrfIpReservationCreateInput.java rename to equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/VrfIPReservationCreateInput.java index 993d88199..9130772cc 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/VrfIpReservationCreateInput.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/VrfIPReservationCreateInput.java @@ -48,10 +48,10 @@ import com.equinix.openapi.JSON; /** - * VrfIpReservationCreateInput + * VrfIPReservationCreateInput */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class VrfIpReservationCreateInput { +public class VrfIPReservationCreateInput { public static final String SERIALIZED_NAME_CIDR = "cidr"; @SerializedName(SERIALIZED_NAME_CIDR) private Integer cidr; @@ -80,10 +80,10 @@ public class VrfIpReservationCreateInput { @SerializedName(SERIALIZED_NAME_VRF_ID) private UUID vrfId; - public VrfIpReservationCreateInput() { + public VrfIPReservationCreateInput() { } - public VrfIpReservationCreateInput cidr(Integer cidr) { + public VrfIPReservationCreateInput cidr(Integer cidr) { this.cidr = cidr; return this; @@ -106,7 +106,7 @@ public void setCidr(Integer cidr) { } - public VrfIpReservationCreateInput customdata(Object customdata) { + public VrfIPReservationCreateInput customdata(Object customdata) { this.customdata = customdata; return this; @@ -129,7 +129,7 @@ public void setCustomdata(Object customdata) { } - public VrfIpReservationCreateInput details(String details) { + public VrfIPReservationCreateInput details(String details) { this.details = details; return this; @@ -152,7 +152,7 @@ public void setDetails(String details) { } - public VrfIpReservationCreateInput network(String network) { + public VrfIPReservationCreateInput network(String network) { this.network = network; return this; @@ -175,13 +175,13 @@ public void setNetwork(String network) { } - public VrfIpReservationCreateInput tags(List tags) { + public VrfIPReservationCreateInput tags(List tags) { this.tags = tags; return this; } - public VrfIpReservationCreateInput addTagsItem(String tagsItem) { + public VrfIPReservationCreateInput addTagsItem(String tagsItem) { if (this.tags == null) { this.tags = new ArrayList<>(); } @@ -206,7 +206,7 @@ public void setTags(List tags) { } - public VrfIpReservationCreateInput type(String type) { + public VrfIPReservationCreateInput type(String type) { this.type = type; return this; @@ -229,7 +229,7 @@ public void setType(String type) { } - public VrfIpReservationCreateInput vrfId(UUID vrfId) { + public VrfIPReservationCreateInput vrfId(UUID vrfId) { this.vrfId = vrfId; return this; @@ -262,7 +262,7 @@ public void setVrfId(UUID vrfId) { * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. */ - public VrfIpReservationCreateInput putAdditionalProperty(String key, Object value) { + public VrfIPReservationCreateInput putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } @@ -296,15 +296,15 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - VrfIpReservationCreateInput vrfIpReservationCreateInput = (VrfIpReservationCreateInput) o; - return Objects.equals(this.cidr, vrfIpReservationCreateInput.cidr) && - Objects.equals(this.customdata, vrfIpReservationCreateInput.customdata) && - Objects.equals(this.details, vrfIpReservationCreateInput.details) && - Objects.equals(this.network, vrfIpReservationCreateInput.network) && - Objects.equals(this.tags, vrfIpReservationCreateInput.tags) && - Objects.equals(this.type, vrfIpReservationCreateInput.type) && - Objects.equals(this.vrfId, vrfIpReservationCreateInput.vrfId)&& - Objects.equals(this.additionalProperties, vrfIpReservationCreateInput.additionalProperties); + VrfIPReservationCreateInput vrfIPReservationCreateInput = (VrfIPReservationCreateInput) o; + return Objects.equals(this.cidr, vrfIPReservationCreateInput.cidr) && + Objects.equals(this.customdata, vrfIPReservationCreateInput.customdata) && + Objects.equals(this.details, vrfIPReservationCreateInput.details) && + Objects.equals(this.network, vrfIPReservationCreateInput.network) && + Objects.equals(this.tags, vrfIPReservationCreateInput.tags) && + Objects.equals(this.type, vrfIPReservationCreateInput.type) && + Objects.equals(this.vrfId, vrfIPReservationCreateInput.vrfId)&& + Objects.equals(this.additionalProperties, vrfIPReservationCreateInput.additionalProperties); } @Override @@ -315,7 +315,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class VrfIpReservationCreateInput {\n"); + sb.append("class VrfIPReservationCreateInput {\n"); sb.append(" cidr: ").append(toIndentedString(cidr)).append("\n"); sb.append(" customdata: ").append(toIndentedString(customdata)).append("\n"); sb.append(" details: ").append(toIndentedString(details)).append("\n"); @@ -366,19 +366,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 VrfIpReservationCreateInput + * @throws IOException if the JSON Object is invalid with respect to VrfIPReservationCreateInput */ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if (jsonObj == null) { - if (VrfIpReservationCreateInput.openapiRequiredFields.isEmpty()) { + if (VrfIPReservationCreateInput.openapiRequiredFields.isEmpty()) { return; } else { // has required fields - throw new IllegalArgumentException(String.format("The required field(s) %s in VrfIpReservationCreateInput is not found in the empty JSON string", VrfIpReservationCreateInput.openapiRequiredFields.toString())); + throw new IllegalArgumentException(String.format("The required field(s) %s in VrfIPReservationCreateInput is not found in the empty JSON string", VrfIPReservationCreateInput.openapiRequiredFields.toString())); } } // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : VrfIpReservationCreateInput.openapiRequiredFields) { + for (String requiredField : VrfIPReservationCreateInput.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())); } @@ -405,16 +405,16 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!VrfIpReservationCreateInput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'VrfIpReservationCreateInput' and its subtypes + if (!VrfIPReservationCreateInput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'VrfIPReservationCreateInput' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(VrfIpReservationCreateInput.class)); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(VrfIPReservationCreateInput.class)); - return (TypeAdapter) new TypeAdapter() { + return (TypeAdapter) new TypeAdapter() { @Override - public void write(JsonWriter out, VrfIpReservationCreateInput value) throws IOException { + public void write(JsonWriter out, VrfIPReservationCreateInput value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); obj.remove("additionalProperties"); // serialize additonal properties @@ -437,11 +437,11 @@ else if (entry.getValue() instanceof Character) } @Override - public VrfIpReservationCreateInput read(JsonReader in) throws IOException { + public VrfIPReservationCreateInput read(JsonReader in) throws IOException { JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); validateJsonObject(jsonObj); // store additional fields in the deserialized instance - VrfIpReservationCreateInput instance = thisAdapter.fromJsonTree(jsonObj); + VrfIPReservationCreateInput instance = thisAdapter.fromJsonTree(jsonObj); for (Map.Entry entry : jsonObj.entrySet()) { if (!openapiFields.contains(entry.getKey())) { if (entry.getValue().isJsonPrimitive()) { // primitive type @@ -466,18 +466,18 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } /** - * Create an instance of VrfIpReservationCreateInput given an JSON string + * Create an instance of VrfIPReservationCreateInput given an JSON string * * @param jsonString JSON string - * @return An instance of VrfIpReservationCreateInput - * @throws IOException if the JSON string is invalid with respect to VrfIpReservationCreateInput + * @return An instance of VrfIPReservationCreateInput + * @throws IOException if the JSON string is invalid with respect to VrfIPReservationCreateInput */ - public static VrfIpReservationCreateInput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, VrfIpReservationCreateInput.class); + public static VrfIPReservationCreateInput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, VrfIPReservationCreateInput.class); } /** - * Convert an instance of VrfIpReservationCreateInput to an JSON string + * Convert an instance of VrfIPReservationCreateInput to an JSON string * * @return JSON string */ 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 similarity index 83% rename from equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/VrfIpReservationList.java rename to equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/VrfIPReservationList.java index fd9eb05a0..c054a476f 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 @@ -15,7 +15,7 @@ import java.util.Objects; import java.util.Arrays; -import com.equinix.openapi.metal.v1.model.VrfIpReservation; +import com.equinix.openapi.metal.v1.model.VrfIPReservation; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -48,24 +48,24 @@ import com.equinix.openapi.JSON; /** - * VrfIpReservationList + * VrfIPReservationList */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class VrfIpReservationList { +public class VrfIPReservationList { public static final String SERIALIZED_NAME_IP_ADDRESSES = "ip_addresses"; @SerializedName(SERIALIZED_NAME_IP_ADDRESSES) - private List ipAddresses = null; + private List ipAddresses = null; - public VrfIpReservationList() { + public VrfIPReservationList() { } - public VrfIpReservationList ipAddresses(List ipAddresses) { + public VrfIPReservationList ipAddresses(List ipAddresses) { this.ipAddresses = ipAddresses; return this; } - public VrfIpReservationList addIpAddressesItem(VrfIpReservation ipAddressesItem) { + public VrfIPReservationList addIpAddressesItem(VrfIPReservation ipAddressesItem) { if (this.ipAddresses == null) { this.ipAddresses = new ArrayList<>(); } @@ -80,12 +80,12 @@ public VrfIpReservationList addIpAddressesItem(VrfIpReservation ipAddressesItem) @javax.annotation.Nullable @ApiModelProperty(value = "") - public List getIpAddresses() { + public List getIpAddresses() { return ipAddresses; } - public void setIpAddresses(List ipAddresses) { + public void setIpAddresses(List ipAddresses) { this.ipAddresses = ipAddresses; } @@ -100,7 +100,7 @@ public void setIpAddresses(List ipAddresses) { * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. */ - public VrfIpReservationList putAdditionalProperty(String key, Object value) { + public VrfIPReservationList putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } @@ -134,9 +134,9 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - VrfIpReservationList vrfIpReservationList = (VrfIpReservationList) o; - return Objects.equals(this.ipAddresses, vrfIpReservationList.ipAddresses)&& - Objects.equals(this.additionalProperties, vrfIpReservationList.additionalProperties); + VrfIPReservationList vrfIPReservationList = (VrfIPReservationList) o; + return Objects.equals(this.ipAddresses, vrfIPReservationList.ipAddresses)&& + Objects.equals(this.additionalProperties, vrfIPReservationList.additionalProperties); } @Override @@ -147,7 +147,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class VrfIpReservationList {\n"); + sb.append("class VrfIPReservationList {\n"); sb.append(" ipAddresses: ").append(toIndentedString(ipAddresses)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); @@ -182,14 +182,14 @@ 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 VrfIpReservationList + * @throws IOException if the JSON Object is invalid with respect to VrfIPReservationList */ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if (jsonObj == null) { - if (VrfIpReservationList.openapiRequiredFields.isEmpty()) { + if (VrfIPReservationList.openapiRequiredFields.isEmpty()) { return; } else { // has required fields - throw new IllegalArgumentException(String.format("The required field(s) %s in VrfIpReservationList is not found in the empty JSON string", VrfIpReservationList.openapiRequiredFields.toString())); + 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"); @@ -201,7 +201,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `ip_addresses` (array) for (int i = 0; i < jsonArrayipAddresses.size(); i++) { - VrfIpReservation.validateJsonObject(jsonArrayipAddresses.get(i).getAsJsonObject()); + VrfIPReservation.validateJsonObject(jsonArrayipAddresses.get(i).getAsJsonObject()); }; } } @@ -210,16 +210,16 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!VrfIpReservationList.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'VrfIpReservationList' and its subtypes + if (!VrfIPReservationList.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'VrfIPReservationList' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(VrfIpReservationList.class)); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(VrfIPReservationList.class)); - return (TypeAdapter) new TypeAdapter() { + return (TypeAdapter) new TypeAdapter() { @Override - public void write(JsonWriter out, VrfIpReservationList value) throws IOException { + public void write(JsonWriter out, VrfIPReservationList value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); obj.remove("additionalProperties"); // serialize additonal properties @@ -242,11 +242,11 @@ else if (entry.getValue() instanceof Character) } @Override - public VrfIpReservationList read(JsonReader in) throws IOException { + public VrfIPReservationList read(JsonReader in) throws IOException { JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); validateJsonObject(jsonObj); // store additional fields in the deserialized instance - VrfIpReservationList instance = thisAdapter.fromJsonTree(jsonObj); + VrfIPReservationList instance = thisAdapter.fromJsonTree(jsonObj); for (Map.Entry entry : jsonObj.entrySet()) { if (!openapiFields.contains(entry.getKey())) { if (entry.getValue().isJsonPrimitive()) { // primitive type @@ -271,18 +271,18 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } /** - * Create an instance of VrfIpReservationList given an JSON string + * Create an instance of VrfIPReservationList given an JSON string * * @param jsonString JSON string - * @return An instance of VrfIpReservationList - * @throws IOException if the JSON string is invalid with respect to VrfIpReservationList + * @return An instance of VrfIPReservationList + * @throws IOException if the JSON string is invalid with respect to VrfIPReservationList */ - public static VrfIpReservationList fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, VrfIpReservationList.class); + public static VrfIPReservationList fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, VrfIPReservationList.class); } /** - * Convert an instance of VrfIpReservationList to an JSON string + * Convert an instance of VrfIPReservationList to an JSON string * * @return JSON string */ diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/VrfIpReservation.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/VrfIpReservation.java deleted file mode 100644 index b7820833c..000000000 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/VrfIpReservation.java +++ /dev/null @@ -1,755 +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.equinix.openapi.metal.v1.model.Href; -import com.equinix.openapi.metal.v1.model.MetalGatewayLite; -import com.equinix.openapi.metal.v1.model.Project; -import com.equinix.openapi.metal.v1.model.Vrf; -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.time.OffsetDateTime; -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; - -/** - * VrfIpReservation - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class VrfIpReservation { - public static final String SERIALIZED_NAME_ADDRESS_FAMILY = "address_family"; - @SerializedName(SERIALIZED_NAME_ADDRESS_FAMILY) - private Integer addressFamily; - - public static final String SERIALIZED_NAME_CIDR = "cidr"; - @SerializedName(SERIALIZED_NAME_CIDR) - private Integer cidr; - - public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; - @SerializedName(SERIALIZED_NAME_CREATED_AT) - private OffsetDateTime createdAt; - - public static final String SERIALIZED_NAME_CREATED_BY = "created_by"; - @SerializedName(SERIALIZED_NAME_CREATED_BY) - private Href createdBy; - - public static final String SERIALIZED_NAME_DETAILS = "details"; - @SerializedName(SERIALIZED_NAME_DETAILS) - private String details; - - public static final String SERIALIZED_NAME_HREF = "href"; - @SerializedName(SERIALIZED_NAME_HREF) - private String href; - - public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_ID) - private UUID id; - - public static final String SERIALIZED_NAME_METAL_GATEWAY = "metal_gateway"; - @SerializedName(SERIALIZED_NAME_METAL_GATEWAY) - private MetalGatewayLite metalGateway; - - public static final String SERIALIZED_NAME_NETMASK = "netmask"; - @SerializedName(SERIALIZED_NAME_NETMASK) - private String netmask; - - public static final String SERIALIZED_NAME_NETWORK = "network"; - @SerializedName(SERIALIZED_NAME_NETWORK) - private String network; - - public static final String SERIALIZED_NAME_PROJECT = "project"; - @SerializedName(SERIALIZED_NAME_PROJECT) - private Project project; - - public static final String SERIALIZED_NAME_STATE = "state"; - @SerializedName(SERIALIZED_NAME_STATE) - private String state; - - public static final String SERIALIZED_NAME_TAGS = "tags"; - @SerializedName(SERIALIZED_NAME_TAGS) - private List tags = null; - - public static final String SERIALIZED_NAME_TYPE = "type"; - @SerializedName(SERIALIZED_NAME_TYPE) - private String type; - - public static final String SERIALIZED_NAME_VRF = "vrf"; - @SerializedName(SERIALIZED_NAME_VRF) - private Vrf vrf; - - public VrfIpReservation() { - } - - public VrfIpReservation addressFamily(Integer addressFamily) { - - this.addressFamily = addressFamily; - return this; - } - - /** - * Get addressFamily - * @return addressFamily - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public Integer getAddressFamily() { - return addressFamily; - } - - - public void setAddressFamily(Integer addressFamily) { - this.addressFamily = addressFamily; - } - - - public VrfIpReservation cidr(Integer cidr) { - - this.cidr = cidr; - return this; - } - - /** - * Get cidr - * @return cidr - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public Integer getCidr() { - return cidr; - } - - - public void setCidr(Integer cidr) { - this.cidr = cidr; - } - - - public VrfIpReservation createdAt(OffsetDateTime createdAt) { - - this.createdAt = createdAt; - return this; - } - - /** - * Get createdAt - * @return createdAt - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public OffsetDateTime getCreatedAt() { - return createdAt; - } - - - public void setCreatedAt(OffsetDateTime createdAt) { - this.createdAt = createdAt; - } - - - public VrfIpReservation createdBy(Href createdBy) { - - this.createdBy = createdBy; - return this; - } - - /** - * Get createdBy - * @return createdBy - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public Href getCreatedBy() { - return createdBy; - } - - - public void setCreatedBy(Href createdBy) { - this.createdBy = createdBy; - } - - - public VrfIpReservation details(String details) { - - this.details = details; - return this; - } - - /** - * Get details - * @return details - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public String getDetails() { - return details; - } - - - public void setDetails(String details) { - this.details = details; - } - - - public VrfIpReservation href(String href) { - - this.href = href; - return this; - } - - /** - * Get href - * @return href - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public String getHref() { - return href; - } - - - public void setHref(String href) { - this.href = href; - } - - - public VrfIpReservation id(UUID id) { - - this.id = id; - return this; - } - - /** - * Get id - * @return id - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public UUID getId() { - return id; - } - - - public void setId(UUID id) { - this.id = id; - } - - - public VrfIpReservation metalGateway(MetalGatewayLite metalGateway) { - - this.metalGateway = metalGateway; - return this; - } - - /** - * Get metalGateway - * @return metalGateway - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public MetalGatewayLite getMetalGateway() { - return metalGateway; - } - - - public void setMetalGateway(MetalGatewayLite metalGateway) { - this.metalGateway = metalGateway; - } - - - public VrfIpReservation netmask(String netmask) { - - this.netmask = netmask; - return this; - } - - /** - * Get netmask - * @return netmask - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public String getNetmask() { - return netmask; - } - - - public void setNetmask(String netmask) { - this.netmask = netmask; - } - - - public VrfIpReservation network(String network) { - - this.network = network; - return this; - } - - /** - * Get network - * @return network - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public String getNetwork() { - return network; - } - - - public void setNetwork(String network) { - this.network = network; - } - - - public VrfIpReservation project(Project project) { - - this.project = project; - return this; - } - - /** - * Get project - * @return project - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public Project getProject() { - return project; - } - - - public void setProject(Project project) { - this.project = project; - } - - - public VrfIpReservation state(String state) { - - this.state = state; - return this; - } - - /** - * Get state - * @return state - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public String getState() { - return state; - } - - - public void setState(String state) { - this.state = state; - } - - - public VrfIpReservation tags(List tags) { - - this.tags = tags; - return this; - } - - public VrfIpReservation addTagsItem(String tagsItem) { - if (this.tags == null) { - this.tags = new ArrayList<>(); - } - this.tags.add(tagsItem); - return this; - } - - /** - * Get tags - * @return tags - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public List getTags() { - return tags; - } - - - public void setTags(List tags) { - this.tags = tags; - } - - - public VrfIpReservation type(String type) { - - this.type = type; - return this; - } - - /** - * Get type - * @return type - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "vrf", value = "") - - public String getType() { - return type; - } - - - public void setType(String type) { - this.type = type; - } - - - public VrfIpReservation vrf(Vrf vrf) { - - this.vrf = vrf; - return this; - } - - /** - * Get vrf - * @return vrf - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - - public Vrf getVrf() { - return vrf; - } - - - public void setVrf(Vrf vrf) { - this.vrf = vrf; - } - - /** - * 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 VrfIpReservation 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; - } - VrfIpReservation vrfIpReservation = (VrfIpReservation) o; - return Objects.equals(this.addressFamily, vrfIpReservation.addressFamily) && - Objects.equals(this.cidr, vrfIpReservation.cidr) && - Objects.equals(this.createdAt, vrfIpReservation.createdAt) && - Objects.equals(this.createdBy, vrfIpReservation.createdBy) && - Objects.equals(this.details, vrfIpReservation.details) && - Objects.equals(this.href, vrfIpReservation.href) && - Objects.equals(this.id, vrfIpReservation.id) && - Objects.equals(this.metalGateway, vrfIpReservation.metalGateway) && - Objects.equals(this.netmask, vrfIpReservation.netmask) && - Objects.equals(this.network, vrfIpReservation.network) && - Objects.equals(this.project, vrfIpReservation.project) && - Objects.equals(this.state, vrfIpReservation.state) && - Objects.equals(this.tags, vrfIpReservation.tags) && - Objects.equals(this.type, vrfIpReservation.type) && - Objects.equals(this.vrf, vrfIpReservation.vrf)&& - Objects.equals(this.additionalProperties, vrfIpReservation.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(addressFamily, cidr, createdAt, createdBy, details, href, id, metalGateway, netmask, network, project, state, tags, type, vrf, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class VrfIpReservation {\n"); - sb.append(" addressFamily: ").append(toIndentedString(addressFamily)).append("\n"); - sb.append(" cidr: ").append(toIndentedString(cidr)).append("\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); - sb.append(" details: ").append(toIndentedString(details)).append("\n"); - sb.append(" href: ").append(toIndentedString(href)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" metalGateway: ").append(toIndentedString(metalGateway)).append("\n"); - sb.append(" netmask: ").append(toIndentedString(netmask)).append("\n"); - sb.append(" network: ").append(toIndentedString(network)).append("\n"); - sb.append(" project: ").append(toIndentedString(project)).append("\n"); - sb.append(" state: ").append(toIndentedString(state)).append("\n"); - sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" vrf: ").append(toIndentedString(vrf)).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("address_family"); - openapiFields.add("cidr"); - openapiFields.add("created_at"); - openapiFields.add("created_by"); - openapiFields.add("details"); - openapiFields.add("href"); - openapiFields.add("id"); - openapiFields.add("metal_gateway"); - openapiFields.add("netmask"); - openapiFields.add("network"); - openapiFields.add("project"); - openapiFields.add("state"); - openapiFields.add("tags"); - openapiFields.add("type"); - openapiFields.add("vrf"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("vrf"); - } - - /** - * 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 VrfIpReservation - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (VrfIpReservation.openapiRequiredFields.isEmpty()) { - return; - } else { // has required fields - throw new IllegalArgumentException(String.format("The required field(s) %s in VrfIpReservation is not found in the empty JSON string", VrfIpReservation.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : VrfIpReservation.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())); - } - } - // validate the optional field `created_by` - if (jsonObj.get("created_by") != null && !jsonObj.get("created_by").isJsonNull()) { - Href.validateJsonObject(jsonObj.getAsJsonObject("created_by")); - } - if ((jsonObj.get("details") != null && !jsonObj.get("details").isJsonNull()) && !jsonObj.get("details").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `details` to be a primitive type in the JSON string but got `%s`", jsonObj.get("details").toString())); - } - if ((jsonObj.get("href") != null && !jsonObj.get("href").isJsonNull()) && !jsonObj.get("href").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `href` to be a primitive type in the JSON string but got `%s`", jsonObj.get("href").toString())); - } - 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())); - } - // validate the optional field `metal_gateway` - if (jsonObj.get("metal_gateway") != null && !jsonObj.get("metal_gateway").isJsonNull()) { - MetalGatewayLite.validateJsonObject(jsonObj.getAsJsonObject("metal_gateway")); - } - if ((jsonObj.get("netmask") != null && !jsonObj.get("netmask").isJsonNull()) && !jsonObj.get("netmask").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `netmask` to be a primitive type in the JSON string but got `%s`", jsonObj.get("netmask").toString())); - } - if ((jsonObj.get("network") != null && !jsonObj.get("network").isJsonNull()) && !jsonObj.get("network").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `network` to be a primitive type in the JSON string but got `%s`", jsonObj.get("network").toString())); - } - // validate the optional field `project` - if (jsonObj.get("project") != null && !jsonObj.get("project").isJsonNull()) { - Project.validateJsonObject(jsonObj.getAsJsonObject("project")); - } - 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())); - } - // ensure the json data is an array - if ((jsonObj.get("tags") != null && !jsonObj.get("tags").isJsonNull()) && !jsonObj.get("tags").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `tags` to be an array in the JSON string but got `%s`", jsonObj.get("tags").toString())); - } - 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())); - } - // validate the optional field `vrf` - if (jsonObj.get("vrf") != null && !jsonObj.get("vrf").isJsonNull()) { - Vrf.validateJsonObject(jsonObj.getAsJsonObject("vrf")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!VrfIpReservation.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'VrfIpReservation' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(VrfIpReservation.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, VrfIpReservation 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 VrfIpReservation read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - VrfIpReservation 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 VrfIpReservation given an JSON string - * - * @param jsonString JSON string - * @return An instance of VrfIpReservation - * @throws IOException if the JSON string is invalid with respect to VrfIpReservation - */ - public static VrfIpReservation fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, VrfIpReservation.class); - } - - /** - * Convert an instance of VrfIpReservation 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/VrfMetalGateway.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/VrfMetalGateway.java deleted file mode 100644 index fbc562370..000000000 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/VrfMetalGateway.java +++ /dev/null @@ -1,625 +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.equinix.openapi.metal.v1.model.Href; -import com.equinix.openapi.metal.v1.model.Project; -import com.equinix.openapi.metal.v1.model.VirtualNetwork; -import com.equinix.openapi.metal.v1.model.Vrf; -import com.equinix.openapi.metal.v1.model.VrfIpReservation; -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.time.OffsetDateTime; -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; - -/** - * VrfMetalGateway - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class VrfMetalGateway { - public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; - @SerializedName(SERIALIZED_NAME_CREATED_AT) - private OffsetDateTime createdAt; - - public static final String SERIALIZED_NAME_CREATED_BY = "created_by"; - @SerializedName(SERIALIZED_NAME_CREATED_BY) - private Href createdBy; - - public static final String SERIALIZED_NAME_HREF = "href"; - @SerializedName(SERIALIZED_NAME_HREF) - private String href; - - public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_ID) - private UUID id; - - public static final String SERIALIZED_NAME_IP_RESERVATION = "ip_reservation"; - @SerializedName(SERIALIZED_NAME_IP_RESERVATION) - private VrfIpReservation ipReservation; - - public static final String SERIALIZED_NAME_PROJECT = "project"; - @SerializedName(SERIALIZED_NAME_PROJECT) - private Project project; - - /** - * The current state of the Metal Gateway. 'Ready' indicates the gateway record has been configured, but is currently not active on the network. 'Active' indicates the gateway has been configured on the network. 'Deleting' is a temporary state used to indicate that the gateway is in the process of being un-configured from the network, after which the gateway record will be deleted. - */ - @JsonAdapter(StateEnum.Adapter.class) - public enum StateEnum { - READY("ready"), - - ACTIVE("active"), - - DELETING("deleting"); - - private String value; - - StateEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static StateEnum fromValue(String value) { - for (StateEnum b : StateEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final StateEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public StateEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StateEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_STATE = "state"; - @SerializedName(SERIALIZED_NAME_STATE) - private StateEnum state; - - public static final String SERIALIZED_NAME_UPDATED_AT = "updated_at"; - @SerializedName(SERIALIZED_NAME_UPDATED_AT) - private OffsetDateTime updatedAt; - - public static final String SERIALIZED_NAME_VIRTUAL_NETWORK = "virtual_network"; - @SerializedName(SERIALIZED_NAME_VIRTUAL_NETWORK) - private VirtualNetwork virtualNetwork; - - public static final String SERIALIZED_NAME_VRF = "vrf"; - @SerializedName(SERIALIZED_NAME_VRF) - private Vrf vrf; - - public VrfMetalGateway() { - } - - public VrfMetalGateway createdAt(OffsetDateTime createdAt) { - - this.createdAt = createdAt; - return this; - } - - /** - * Get createdAt - * @return createdAt - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public OffsetDateTime getCreatedAt() { - return createdAt; - } - - - public void setCreatedAt(OffsetDateTime createdAt) { - this.createdAt = createdAt; - } - - - public VrfMetalGateway createdBy(Href createdBy) { - - this.createdBy = createdBy; - return this; - } - - /** - * Get createdBy - * @return createdBy - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public Href getCreatedBy() { - return createdBy; - } - - - public void setCreatedBy(Href createdBy) { - this.createdBy = createdBy; - } - - - public VrfMetalGateway href(String href) { - - this.href = href; - return this; - } - - /** - * Get href - * @return href - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public String getHref() { - return href; - } - - - public void setHref(String href) { - this.href = href; - } - - - public VrfMetalGateway id(UUID id) { - - this.id = id; - return this; - } - - /** - * Get id - * @return id - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public UUID getId() { - return id; - } - - - public void setId(UUID id) { - this.id = id; - } - - - public VrfMetalGateway ipReservation(VrfIpReservation ipReservation) { - - this.ipReservation = ipReservation; - return this; - } - - /** - * Get ipReservation - * @return ipReservation - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public VrfIpReservation getIpReservation() { - return ipReservation; - } - - - public void setIpReservation(VrfIpReservation ipReservation) { - this.ipReservation = ipReservation; - } - - - public VrfMetalGateway project(Project project) { - - this.project = project; - return this; - } - - /** - * Get project - * @return project - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public Project getProject() { - return project; - } - - - public void setProject(Project project) { - this.project = project; - } - - - public VrfMetalGateway state(StateEnum state) { - - this.state = state; - return this; - } - - /** - * The current state of the Metal Gateway. 'Ready' indicates the gateway record has been configured, but is currently not active on the network. 'Active' indicates the gateway has been configured on the network. 'Deleting' is a temporary state used to indicate that the gateway is in the process of being un-configured from the network, after which the gateway record will be deleted. - * @return state - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The current state of the Metal Gateway. 'Ready' indicates the gateway record has been configured, but is currently not active on the network. 'Active' indicates the gateway has been configured on the network. 'Deleting' is a temporary state used to indicate that the gateway is in the process of being un-configured from the network, after which the gateway record will be deleted.") - - public StateEnum getState() { - return state; - } - - - public void setState(StateEnum state) { - this.state = state; - } - - - public VrfMetalGateway updatedAt(OffsetDateTime updatedAt) { - - this.updatedAt = updatedAt; - return this; - } - - /** - * Get updatedAt - * @return updatedAt - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public OffsetDateTime getUpdatedAt() { - return updatedAt; - } - - - public void setUpdatedAt(OffsetDateTime updatedAt) { - this.updatedAt = updatedAt; - } - - - public VrfMetalGateway virtualNetwork(VirtualNetwork virtualNetwork) { - - this.virtualNetwork = virtualNetwork; - return this; - } - - /** - * Get virtualNetwork - * @return virtualNetwork - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public VirtualNetwork getVirtualNetwork() { - return virtualNetwork; - } - - - public void setVirtualNetwork(VirtualNetwork virtualNetwork) { - this.virtualNetwork = virtualNetwork; - } - - - public VrfMetalGateway vrf(Vrf vrf) { - - this.vrf = vrf; - return this; - } - - /** - * Get vrf - * @return vrf - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public Vrf getVrf() { - return vrf; - } - - - public void setVrf(Vrf vrf) { - this.vrf = vrf; - } - - /** - * 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 VrfMetalGateway 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; - } - VrfMetalGateway vrfMetalGateway = (VrfMetalGateway) o; - return Objects.equals(this.createdAt, vrfMetalGateway.createdAt) && - Objects.equals(this.createdBy, vrfMetalGateway.createdBy) && - Objects.equals(this.href, vrfMetalGateway.href) && - Objects.equals(this.id, vrfMetalGateway.id) && - Objects.equals(this.ipReservation, vrfMetalGateway.ipReservation) && - Objects.equals(this.project, vrfMetalGateway.project) && - Objects.equals(this.state, vrfMetalGateway.state) && - Objects.equals(this.updatedAt, vrfMetalGateway.updatedAt) && - Objects.equals(this.virtualNetwork, vrfMetalGateway.virtualNetwork) && - Objects.equals(this.vrf, vrfMetalGateway.vrf)&& - Objects.equals(this.additionalProperties, vrfMetalGateway.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(createdAt, createdBy, href, id, ipReservation, project, state, updatedAt, virtualNetwork, vrf, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class VrfMetalGateway {\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); - sb.append(" href: ").append(toIndentedString(href)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" ipReservation: ").append(toIndentedString(ipReservation)).append("\n"); - sb.append(" project: ").append(toIndentedString(project)).append("\n"); - sb.append(" state: ").append(toIndentedString(state)).append("\n"); - sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); - sb.append(" virtualNetwork: ").append(toIndentedString(virtualNetwork)).append("\n"); - sb.append(" vrf: ").append(toIndentedString(vrf)).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("created_at"); - openapiFields.add("created_by"); - openapiFields.add("href"); - openapiFields.add("id"); - openapiFields.add("ip_reservation"); - openapiFields.add("project"); - openapiFields.add("state"); - openapiFields.add("updated_at"); - openapiFields.add("virtual_network"); - openapiFields.add("vrf"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * 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 VrfMetalGateway - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (VrfMetalGateway.openapiRequiredFields.isEmpty()) { - return; - } else { // has required fields - throw new IllegalArgumentException(String.format("The required field(s) %s in VrfMetalGateway is not found in the empty JSON string", VrfMetalGateway.openapiRequiredFields.toString())); - } - } - // validate the optional field `created_by` - if (jsonObj.get("created_by") != null && !jsonObj.get("created_by").isJsonNull()) { - Href.validateJsonObject(jsonObj.getAsJsonObject("created_by")); - } - if ((jsonObj.get("href") != null && !jsonObj.get("href").isJsonNull()) && !jsonObj.get("href").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `href` to be a primitive type in the JSON string but got `%s`", jsonObj.get("href").toString())); - } - 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())); - } - // validate the optional field `ip_reservation` - if (jsonObj.get("ip_reservation") != null && !jsonObj.get("ip_reservation").isJsonNull()) { - VrfIpReservation.validateJsonObject(jsonObj.getAsJsonObject("ip_reservation")); - } - // validate the optional field `project` - if (jsonObj.get("project") != null && !jsonObj.get("project").isJsonNull()) { - Project.validateJsonObject(jsonObj.getAsJsonObject("project")); - } - 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())); - } - // validate the optional field `virtual_network` - if (jsonObj.get("virtual_network") != null && !jsonObj.get("virtual_network").isJsonNull()) { - VirtualNetwork.validateJsonObject(jsonObj.getAsJsonObject("virtual_network")); - } - // validate the optional field `vrf` - if (jsonObj.get("vrf") != null && !jsonObj.get("vrf").isJsonNull()) { - Vrf.validateJsonObject(jsonObj.getAsJsonObject("vrf")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!VrfMetalGateway.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'VrfMetalGateway' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(VrfMetalGateway.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, VrfMetalGateway 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 VrfMetalGateway read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - VrfMetalGateway 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 VrfMetalGateway given an JSON string - * - * @param jsonString JSON string - * @return An instance of VrfMetalGateway - * @throws IOException if the JSON string is invalid with respect to VrfMetalGateway - */ - public static VrfMetalGateway fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, VrfMetalGateway.class); - } - - /** - * Convert an instance of VrfMetalGateway 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/workflow/MetalGatewayOperator.java b/equinix-openapi-metal/src/main/java/com/equinix/workflow/MetalGatewayOperator.java index 8a19c376f..59e6dcf90 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 @@ -10,7 +10,6 @@ import com.equinix.openapi.ApiException; import com.equinix.openapi.metal.v1.api.MetalGatewaysApi; import com.equinix.openapi.metal.v1.model.CreateMetalGatewayRequest; -import com.equinix.openapi.metal.v1.model.FindMetalGatewayById200Response; 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; @@ -29,8 +28,7 @@ public MetalGatewayOperator(ApiClient apiClient) { // Returns the metal gateway queried by its id public MetalGateway getMetalGateway(UUID metalGatewayId, List include, List exclude) throws ApiException { - FindMetalGatewayById200Response response = metalGatewaysApi.findMetalGatewayById(metalGatewayId, include, exclude); - return response.getMetalGateway(); + return metalGatewaysApi.findMetalGatewayById(metalGatewayId, include, exclude); } // Returns the vlan associated with the metal gateway queried by its id @@ -52,8 +50,7 @@ public MetalGateway createMetalGatewayWithPrivateIpBlockAndPoll(UUID projectId, .virtualNetworkId(vlan.getId()); CreateMetalGatewayRequest createMetalGatewayRequest = new CreateMetalGatewayRequest(metalGatewayInput); - FindMetalGatewayById200Response response = metalGatewaysApi.createMetalGateway(projectId, createMetalGatewayRequest,1, 10); - MetalGateway metalGateway = response.getMetalGateway(); + MetalGateway metalGateway = metalGatewaysApi.createMetalGateway(projectId, createMetalGatewayRequest,1, 10); return metalGatewayCreatedAndPoll(metalGateway, retries, wait); } diff --git a/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/api/IpAddressesApiTest.java b/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/api/IpAddressesApiTest.java index 2f6daa3dd..4bbf88eab 100644 --- a/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/api/IpAddressesApiTest.java +++ b/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/api/IpAddressesApiTest.java @@ -17,8 +17,8 @@ import com.equinix.openapi.metal.v1.model.Error; import com.equinix.openapi.metal.v1.model.FindIPAddressById200Response; import com.equinix.openapi.metal.v1.model.IPAvailabilitiesList; +import com.equinix.openapi.metal.v1.model.IPReservation; import com.equinix.openapi.metal.v1.model.IPReservationList; -import com.equinix.openapi.metal.v1.model.RequestIPReservation201Response; import com.equinix.openapi.metal.v1.model.RequestIPReservationRequest; import java.util.UUID; import org.junit.jupiter.api.Disabled; @@ -124,7 +124,7 @@ public void findIPReservationsTest() throws ApiException { public void requestIPReservationTest() throws ApiException { UUID id = null; RequestIPReservationRequest requestIPReservationRequest = null; - RequestIPReservation201Response response = api.requestIPReservation(id, requestIPReservationRequest); + IPReservation response = api.requestIPReservation(id, requestIPReservationRequest); // TODO: test validations } diff --git a/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/api/MetalGatewaysApiTest.java b/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/api/MetalGatewaysApiTest.java index c6207a7b2..9bb6044b7 100644 --- a/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/api/MetalGatewaysApiTest.java +++ b/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/api/MetalGatewaysApiTest.java @@ -16,7 +16,7 @@ import com.equinix.openapi.ApiException; import com.equinix.openapi.metal.v1.model.CreateMetalGatewayRequest; import com.equinix.openapi.metal.v1.model.Error; -import com.equinix.openapi.metal.v1.model.FindMetalGatewayById200Response; +import com.equinix.openapi.metal.v1.model.MetalGateway; import com.equinix.openapi.metal.v1.model.MetalGatewayList; import java.util.UUID; import org.junit.jupiter.api.Disabled; @@ -48,7 +48,7 @@ public void createMetalGatewayTest() throws ApiException { CreateMetalGatewayRequest createMetalGatewayRequest = null; Integer page = null; Integer perPage = null; - FindMetalGatewayById200Response response = api.createMetalGateway(projectId, createMetalGatewayRequest, page, perPage); + MetalGateway response = api.createMetalGateway(projectId, createMetalGatewayRequest, page, perPage); // TODO: test validations } @@ -78,7 +78,7 @@ public void findMetalGatewayByIdTest() throws ApiException { UUID id = null; List include = null; List exclude = null; - FindMetalGatewayById200Response response = api.findMetalGatewayById(id, include, exclude); + MetalGateway response = api.findMetalGatewayById(id, include, exclude); // TODO: test validations } diff --git a/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/api/VrfsApiTest.java b/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/api/VrfsApiTest.java index d1981cc10..290853cbd 100644 --- a/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/api/VrfsApiTest.java +++ b/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/api/VrfsApiTest.java @@ -18,7 +18,7 @@ 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.VrfIpReservationList; +import com.equinix.openapi.metal.v1.model.VrfIPReservationList; import com.equinix.openapi.metal.v1.model.VrfList; import com.equinix.openapi.metal.v1.model.VrfUpdateInput; import org.junit.jupiter.api.Disabled; @@ -90,11 +90,11 @@ public void findVrfByIdTest() throws ApiException { * @throws ApiException if the Api call fails */ @Test - public void findVrfIpReservationsTest() throws ApiException { + public void findVrfIPReservationsTest() throws ApiException { UUID id = null; List include = null; List exclude = null; - VrfIpReservationList response = api.findVrfIpReservations(id, include, exclude); + VrfIPReservationList response = api.findVrfIPReservations(id, include, exclude); // TODO: test validations } diff --git a/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/AuthTokenUserTest.java b/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/AuthTokenUserTest.java index ed98fc13c..15fed5f29 100644 --- a/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/AuthTokenUserTest.java +++ b/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/AuthTokenUserTest.java @@ -204,4 +204,12 @@ public void updatedAtTest() { // TODO: test updatedAt } + /** + * Test the property 'features' + */ + @Test + public void featuresTest() { + // TODO: test features + } + } diff --git a/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/IPReservationFacilityTest.java b/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/DefaultIPReservationAllOfTest.java similarity index 53% rename from equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/IPReservationFacilityTest.java rename to equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/DefaultIPReservationAllOfTest.java index 9efa15699..71318a358 100644 --- a/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/IPReservationFacilityTest.java +++ b/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/DefaultIPReservationAllOfTest.java @@ -13,8 +13,9 @@ package com.equinix.openapi.metal.v1.model; -import com.equinix.openapi.metal.v1.model.Address; -import com.equinix.openapi.metal.v1.model.DeviceMetro; +import com.equinix.openapi.metal.v1.model.Facility; +import com.equinix.openapi.metal.v1.model.IPAssignment; +import com.equinix.openapi.metal.v1.model.User; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -25,79 +26,78 @@ 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 IPReservationFacility + * Model tests for DefaultIPReservationAllOf */ -public class IPReservationFacilityTest { - private final IPReservationFacility model = new IPReservationFacility(); +public class DefaultIPReservationAllOfTest { + private final DefaultIPReservationAllOf model = new DefaultIPReservationAllOf(); /** - * Model tests for IPReservationFacility + * Model tests for DefaultIPReservationAllOf */ @Test - public void testIPReservationFacility() { - // TODO: test IPReservationFacility + public void testDefaultIPReservationAllOf() { + // TODO: test DefaultIPReservationAllOf } /** - * Test the property 'address' + * Test the property 'addon' */ @Test - public void addressTest() { - // TODO: test address + public void addonTest() { + // TODO: test addon } /** - * Test the property 'code' + * Test the property 'assignments' */ @Test - public void codeTest() { - // TODO: test code + public void assignmentsTest() { + // TODO: test assignments } /** - * Test the property 'features' + * Test the property 'enabled' */ @Test - public void featuresTest() { - // TODO: test features + public void enabledTest() { + // TODO: test enabled } /** - * Test the property 'id' + * Test the property 'facility' */ @Test - public void idTest() { - // TODO: test id + public void facilityTest() { + // TODO: test facility } /** - * Test the property 'ipRanges' + * Test the property 'globalIp' */ @Test - public void ipRangesTest() { - // TODO: test ipRanges + public void globalIpTest() { + // TODO: test globalIp } /** - * Test the property 'metro' + * Test the property 'requestedBy' */ @Test - public void metroTest() { - // TODO: test metro + public void requestedByTest() { + // TODO: test requestedBy } /** - * Test the property 'name' + * Test the property 'available' */ @Test - public void nameTest() { - // TODO: test name + public void availableTest() { + // TODO: test available } } diff --git a/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/RequestIPReservation201ResponseTest.java b/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/DefaultIPReservationTest.java similarity index 80% rename from equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/RequestIPReservation201ResponseTest.java rename to equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/DefaultIPReservationTest.java index 92e985c2f..9291ba819 100644 --- a/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/RequestIPReservation201ResponseTest.java +++ b/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/DefaultIPReservationTest.java @@ -13,15 +13,14 @@ package com.equinix.openapi.metal.v1.model; +import com.equinix.openapi.metal.v1.model.Facility; import com.equinix.openapi.metal.v1.model.Href; import com.equinix.openapi.metal.v1.model.IPAssignment; import com.equinix.openapi.metal.v1.model.IPReservation; -import com.equinix.openapi.metal.v1.model.IPReservationFacility; import com.equinix.openapi.metal.v1.model.IPReservationMetro; import com.equinix.openapi.metal.v1.model.MetalGatewayLite; import com.equinix.openapi.metal.v1.model.Project; -import com.equinix.openapi.metal.v1.model.Vrf; -import com.equinix.openapi.metal.v1.model.VrfIpReservation; +import com.equinix.openapi.metal.v1.model.User; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -39,25 +38,17 @@ /** - * Model tests for RequestIPReservation201Response + * Model tests for DefaultIPReservation */ -public class RequestIPReservation201ResponseTest { - private final RequestIPReservation201Response model = new RequestIPReservation201Response(); +public class DefaultIPReservationTest { + private final DefaultIPReservation model = new DefaultIPReservation(); /** - * Model tests for RequestIPReservation201Response + * Model tests for DefaultIPReservation */ @Test - public void testRequestIPReservation201Response() { - // TODO: test RequestIPReservation201Response - } - - /** - * Test the property 'addon' - */ - @Test - public void addonTest() { - // TODO: test addon + public void testDefaultIPReservation() { + // TODO: test DefaultIPReservation } /** @@ -68,14 +59,6 @@ public void addressFamilyTest() { // TODO: test addressFamily } - /** - * Test the property 'assignments' - */ - @Test - public void assignmentsTest() { - // TODO: test assignments - } - /** * Test the property 'bill' */ @@ -100,30 +83,6 @@ public void createdAtTest() { // TODO: test createdAt } - /** - * Test the property 'enabled' - */ - @Test - public void enabledTest() { - // TODO: test enabled - } - - /** - * Test the property 'facility' - */ - @Test - public void facilityTest() { - // TODO: test facility - } - - /** - * Test the property 'globalIp' - */ - @Test - public void globalIpTest() { - // TODO: test globalIp - } - /** * Test the property 'href' */ @@ -213,19 +172,19 @@ public void tagsTest() { } /** - * Test the property 'createdBy' + * Test the property 'details' */ @Test - public void createdByTest() { - // TODO: test createdBy + public void detailsTest() { + // TODO: test details } /** - * Test the property 'details' + * Test the property 'customdata' */ @Test - public void detailsTest() { - // TODO: test details + public void customdataTest() { + // TODO: test customdata } /** @@ -236,6 +195,30 @@ public void projectTest() { // TODO: test project } + /** + * Test the property 'projectLite' + */ + @Test + public void projectLiteTest() { + // TODO: test projectLite + } + + /** + * Test the property 'address' + */ + @Test + public void addressTest() { + // TODO: test address + } + + /** + * Test the property 'gateway' + */ + @Test + public void gatewayTest() { + // TODO: test gateway + } + /** * Test the property 'type' */ @@ -245,11 +228,59 @@ public void typeTest() { } /** - * Test the property 'vrf' + * Test the property 'addon' + */ + @Test + public void addonTest() { + // TODO: test addon + } + + /** + * Test the property 'assignments' + */ + @Test + public void assignmentsTest() { + // TODO: test assignments + } + + /** + * Test the property 'enabled' + */ + @Test + public void enabledTest() { + // TODO: test enabled + } + + /** + * Test the property 'facility' + */ + @Test + public void facilityTest() { + // TODO: test facility + } + + /** + * Test the property 'globalIp' + */ + @Test + public void globalIpTest() { + // TODO: test globalIp + } + + /** + * Test the property 'requestedBy' + */ + @Test + public void requestedByTest() { + // TODO: test requestedBy + } + + /** + * Test the property 'available' */ @Test - public void vrfTest() { - // TODO: test vrf + public void availableTest() { + // TODO: test available } } diff --git a/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/FindIPAddressById200ResponseTest.java b/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/FindIPAddressById200ResponseTest.java index b8c6e922b..fb7cc3e5e 100644 --- a/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/FindIPAddressById200ResponseTest.java +++ b/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/FindIPAddressById200ResponseTest.java @@ -15,14 +15,11 @@ import com.equinix.openapi.metal.v1.model.Href; import com.equinix.openapi.metal.v1.model.IPAssignment; +import com.equinix.openapi.metal.v1.model.IPAssignmentMetro; import com.equinix.openapi.metal.v1.model.IPReservation; -import com.equinix.openapi.metal.v1.model.IPReservationFacility; -import com.equinix.openapi.metal.v1.model.IPReservationMetro; import com.equinix.openapi.metal.v1.model.MetalGatewayLite; import com.equinix.openapi.metal.v1.model.ParentBlock; import com.equinix.openapi.metal.v1.model.Project; -import com.equinix.openapi.metal.v1.model.Vrf; -import com.equinix.openapi.metal.v1.model.VrfIpReservation; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -189,22 +186,6 @@ public void _publicTest() { // TODO: test _public } - /** - * Test the property 'addon' - */ - @Test - public void addonTest() { - // TODO: test addon - } - - /** - * Test the property 'assignments' - */ - @Test - public void assignmentsTest() { - // TODO: test assignments - } - /** * Test the property 'bill' */ @@ -213,14 +194,6 @@ public void billTest() { // TODO: test bill } - /** - * Test the property 'facility' - */ - @Test - public void facilityTest() { - // TODO: test facility - } - /** * Test the property 'metalGateway' */ @@ -246,19 +219,19 @@ public void tagsTest() { } /** - * Test the property 'createdBy' + * Test the property 'details' */ @Test - public void createdByTest() { - // TODO: test createdBy + public void detailsTest() { + // TODO: test details } /** - * Test the property 'details' + * Test the property 'customdata' */ @Test - public void detailsTest() { - // TODO: test details + public void customdataTest() { + // TODO: test customdata } /** @@ -270,19 +243,19 @@ public void projectTest() { } /** - * Test the property 'type' + * Test the property 'projectLite' */ @Test - public void typeTest() { - // TODO: test type + public void projectLiteTest() { + // TODO: test projectLite } /** - * Test the property 'vrf' + * Test the property 'type' */ @Test - public void vrfTest() { - // TODO: test vrf + public void typeTest() { + // TODO: test type } } diff --git a/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/FindMetalGatewayById200ResponseTest.java b/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/FindMetalGatewayById200ResponseTest.java deleted file mode 100644 index a53c43d85..000000000 --- a/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/FindMetalGatewayById200ResponseTest.java +++ /dev/null @@ -1,131 +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 com.equinix.openapi.metal.v1.model.Href; -import com.equinix.openapi.metal.v1.model.MetalGateway; -import com.equinix.openapi.metal.v1.model.Project; -import com.equinix.openapi.metal.v1.model.VirtualNetwork; -import com.equinix.openapi.metal.v1.model.Vrf; -import com.equinix.openapi.metal.v1.model.VrfIpReservation; -import com.equinix.openapi.metal.v1.model.VrfMetalGateway; -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.time.OffsetDateTime; -import java.util.UUID; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - - -/** - * Model tests for FindMetalGatewayById200Response - */ -public class FindMetalGatewayById200ResponseTest { - private final FindMetalGatewayById200Response model = new FindMetalGatewayById200Response(); - - /** - * Model tests for FindMetalGatewayById200Response - */ - @Test - public void testFindMetalGatewayById200Response() { - // TODO: test FindMetalGatewayById200Response - } - - /** - * Test the property 'createdAt' - */ - @Test - public void createdAtTest() { - // TODO: test createdAt - } - - /** - * Test the property 'createdBy' - */ - @Test - public void createdByTest() { - // TODO: test createdBy - } - - /** - * Test the property 'href' - */ - @Test - public void hrefTest() { - // TODO: test href - } - - /** - * Test the property 'id' - */ - @Test - public void idTest() { - // TODO: test id - } - - /** - * Test the property 'ipReservation' - */ - @Test - public void ipReservationTest() { - // TODO: test ipReservation - } - - /** - * Test the property 'project' - */ - @Test - public void projectTest() { - // TODO: test project - } - - /** - * Test the property 'state' - */ - @Test - public void stateTest() { - // TODO: test state - } - - /** - * Test the property 'updatedAt' - */ - @Test - public void updatedAtTest() { - // TODO: test updatedAt - } - - /** - * Test the property 'virtualNetwork' - */ - @Test - public void virtualNetworkTest() { - // TODO: test virtualNetwork - } - - /** - * Test the property 'vrf' - */ - @Test - public void vrfTest() { - // TODO: test vrf - } - -} diff --git a/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/HrefOnlyTest.java b/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/HrefOnlyTest.java new file mode 100644 index 000000000..83abe9b1a --- /dev/null +++ b/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/HrefOnlyTest.java @@ -0,0 +1,50 @@ +/* + * 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 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for HrefOnly + */ +public class HrefOnlyTest { + private final HrefOnly model = new HrefOnly(); + + /** + * Model tests for HrefOnly + */ + @Test + public void testHrefOnly() { + // TODO: test HrefOnly + } + + /** + * Test the property 'href' + */ + @Test + public void hrefTest() { + // TODO: test href + } + +} diff --git a/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/IPReservationListTest.java b/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/IPReservationListTest.java index 720073163..58cc9eb62 100644 --- a/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/IPReservationListTest.java +++ b/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/IPReservationListTest.java @@ -13,7 +13,7 @@ package com.equinix.openapi.metal.v1.model; -import com.equinix.openapi.metal.v1.model.IPReservationListIpAddressesInner; +import com.equinix.openapi.metal.v1.model.IPReservation; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/IPReservationTest.java b/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/IPReservationTest.java index 2555bc7ab..ee8e20f43 100644 --- a/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/IPReservationTest.java +++ b/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/IPReservationTest.java @@ -13,10 +13,10 @@ package com.equinix.openapi.metal.v1.model; -import com.equinix.openapi.metal.v1.model.IPAssignment; -import com.equinix.openapi.metal.v1.model.IPReservationFacility; +import com.equinix.openapi.metal.v1.model.Href; import com.equinix.openapi.metal.v1.model.IPReservationMetro; import com.equinix.openapi.metal.v1.model.MetalGatewayLite; +import com.equinix.openapi.metal.v1.model.Project; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -47,14 +47,6 @@ public void testIPReservation() { // TODO: test IPReservation } - /** - * Test the property 'addon' - */ - @Test - public void addonTest() { - // TODO: test addon - } - /** * Test the property 'addressFamily' */ @@ -63,14 +55,6 @@ public void addressFamilyTest() { // TODO: test addressFamily } - /** - * Test the property 'assignments' - */ - @Test - public void assignmentsTest() { - // TODO: test assignments - } - /** * Test the property 'bill' */ @@ -95,30 +79,6 @@ public void createdAtTest() { // TODO: test createdAt } - /** - * Test the property 'enabled' - */ - @Test - public void enabledTest() { - // TODO: test enabled - } - - /** - * Test the property 'facility' - */ - @Test - public void facilityTest() { - // TODO: test facility - } - - /** - * Test the property 'globalIp' - */ - @Test - public void globalIpTest() { - // TODO: test globalIp - } - /** * Test the property 'href' */ @@ -207,4 +167,60 @@ public void tagsTest() { // TODO: test tags } + /** + * Test the property 'details' + */ + @Test + public void detailsTest() { + // TODO: test details + } + + /** + * Test the property 'customdata' + */ + @Test + public void customdataTest() { + // TODO: test customdata + } + + /** + * Test the property 'project' + */ + @Test + public void projectTest() { + // TODO: test project + } + + /** + * Test the property 'projectLite' + */ + @Test + public void projectLiteTest() { + // TODO: test projectLite + } + + /** + * Test the property 'address' + */ + @Test + public void addressTest() { + // TODO: test address + } + + /** + * Test the property 'gateway' + */ + @Test + public void gatewayTest() { + // TODO: test gateway + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + } diff --git a/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/VrfIpReservationTest.java b/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/MetalGatewayIpReservationTest.java similarity index 65% rename from equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/VrfIpReservationTest.java rename to equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/MetalGatewayIpReservationTest.java index 695d1884a..81c4d337c 100644 --- a/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/VrfIpReservationTest.java +++ b/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/MetalGatewayIpReservationTest.java @@ -14,9 +14,11 @@ package com.equinix.openapi.metal.v1.model; import com.equinix.openapi.metal.v1.model.Href; +import com.equinix.openapi.metal.v1.model.HrefOnly; +import com.equinix.openapi.metal.v1.model.IPReservation; +import com.equinix.openapi.metal.v1.model.IPReservationMetro; import com.equinix.openapi.metal.v1.model.MetalGatewayLite; import com.equinix.openapi.metal.v1.model.Project; -import com.equinix.openapi.metal.v1.model.Vrf; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -34,17 +36,17 @@ /** - * Model tests for VrfIpReservation + * Model tests for MetalGatewayIpReservation */ -public class VrfIpReservationTest { - private final VrfIpReservation model = new VrfIpReservation(); +public class MetalGatewayIpReservationTest { + private final MetalGatewayIpReservation model = new MetalGatewayIpReservation(); /** - * Model tests for VrfIpReservation + * Model tests for MetalGatewayIpReservation */ @Test - public void testVrfIpReservation() { - // TODO: test VrfIpReservation + public void testMetalGatewayIpReservation() { + // TODO: test MetalGatewayIpReservation } /** @@ -55,6 +57,14 @@ public void addressFamilyTest() { // TODO: test addressFamily } + /** + * Test the property 'bill' + */ + @Test + public void billTest() { + // TODO: test bill + } + /** * Test the property 'cidr' */ @@ -72,35 +82,35 @@ public void createdAtTest() { } /** - * Test the property 'createdBy' + * Test the property 'href' */ @Test - public void createdByTest() { - // TODO: test createdBy + public void hrefTest() { + // TODO: test href } /** - * Test the property 'details' + * Test the property 'id' */ @Test - public void detailsTest() { - // TODO: test details + public void idTest() { + // TODO: test id } /** - * Test the property 'href' + * Test the property 'manageable' */ @Test - public void hrefTest() { - // TODO: test href + public void manageableTest() { + // TODO: test manageable } /** - * Test the property 'id' + * Test the property 'management' */ @Test - public void idTest() { - // TODO: test id + public void managementTest() { + // TODO: test management } /** @@ -111,6 +121,14 @@ public void metalGatewayTest() { // TODO: test metalGateway } + /** + * Test the property 'metro' + */ + @Test + public void metroTest() { + // TODO: test metro + } + /** * Test the property 'netmask' */ @@ -128,11 +146,11 @@ public void networkTest() { } /** - * Test the property 'project' + * Test the property '_public' */ @Test - public void projectTest() { - // TODO: test project + public void _publicTest() { + // TODO: test _public } /** @@ -152,19 +170,59 @@ public void tagsTest() { } /** - * Test the property 'type' + * Test the property 'details' */ @Test - public void typeTest() { - // TODO: test type + public void detailsTest() { + // TODO: test details + } + + /** + * Test the property 'customdata' + */ + @Test + public void customdataTest() { + // TODO: test customdata + } + + /** + * Test the property 'project' + */ + @Test + public void projectTest() { + // TODO: test project + } + + /** + * Test the property 'projectLite' + */ + @Test + public void projectLiteTest() { + // TODO: test projectLite + } + + /** + * Test the property 'address' + */ + @Test + public void addressTest() { + // TODO: test address } /** - * Test the property 'vrf' + * Test the property 'gateway' */ @Test - public void vrfTest() { - // TODO: test vrf + public void gatewayTest() { + // TODO: test gateway + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type } } diff --git a/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/MetalGatewayListMetalGatewaysInnerTest.java b/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/MetalGatewayListMetalGatewaysInnerTest.java deleted file mode 100644 index a2cc75a6e..000000000 --- a/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/MetalGatewayListMetalGatewaysInnerTest.java +++ /dev/null @@ -1,131 +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 com.equinix.openapi.metal.v1.model.Href; -import com.equinix.openapi.metal.v1.model.MetalGateway; -import com.equinix.openapi.metal.v1.model.Project; -import com.equinix.openapi.metal.v1.model.VirtualNetwork; -import com.equinix.openapi.metal.v1.model.Vrf; -import com.equinix.openapi.metal.v1.model.VrfIpReservation; -import com.equinix.openapi.metal.v1.model.VrfMetalGateway; -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.time.OffsetDateTime; -import java.util.UUID; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - - -/** - * Model tests for MetalGatewayListMetalGatewaysInner - */ -public class MetalGatewayListMetalGatewaysInnerTest { - private final MetalGatewayListMetalGatewaysInner model = new MetalGatewayListMetalGatewaysInner(); - - /** - * Model tests for MetalGatewayListMetalGatewaysInner - */ - @Test - public void testMetalGatewayListMetalGatewaysInner() { - // TODO: test MetalGatewayListMetalGatewaysInner - } - - /** - * Test the property 'createdAt' - */ - @Test - public void createdAtTest() { - // TODO: test createdAt - } - - /** - * Test the property 'createdBy' - */ - @Test - public void createdByTest() { - // TODO: test createdBy - } - - /** - * Test the property 'href' - */ - @Test - public void hrefTest() { - // TODO: test href - } - - /** - * Test the property 'id' - */ - @Test - public void idTest() { - // TODO: test id - } - - /** - * Test the property 'ipReservation' - */ - @Test - public void ipReservationTest() { - // TODO: test ipReservation - } - - /** - * Test the property 'project' - */ - @Test - public void projectTest() { - // TODO: test project - } - - /** - * Test the property 'state' - */ - @Test - public void stateTest() { - // TODO: test state - } - - /** - * Test the property 'updatedAt' - */ - @Test - public void updatedAtTest() { - // TODO: test updatedAt - } - - /** - * Test the property 'virtualNetwork' - */ - @Test - public void virtualNetworkTest() { - // TODO: test virtualNetwork - } - - /** - * Test the property 'vrf' - */ - @Test - public void vrfTest() { - // TODO: test vrf - } - -} diff --git a/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/MetalGatewayListTest.java b/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/MetalGatewayListTest.java index 5ead858ba..56b218330 100644 --- a/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/MetalGatewayListTest.java +++ b/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/MetalGatewayListTest.java @@ -13,7 +13,7 @@ package com.equinix.openapi.metal.v1.model; -import com.equinix.openapi.metal.v1.model.MetalGatewayListMetalGatewaysInner; +import com.equinix.openapi.metal.v1.model.MetalGateway; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/MetalGatewayTest.java b/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/MetalGatewayTest.java index 024bf7286..c2b071e39 100644 --- a/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/MetalGatewayTest.java +++ b/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/MetalGatewayTest.java @@ -14,9 +14,10 @@ package com.equinix.openapi.metal.v1.model; import com.equinix.openapi.metal.v1.model.Href; -import com.equinix.openapi.metal.v1.model.IPReservation; +import com.equinix.openapi.metal.v1.model.MetalGatewayIpReservation; import com.equinix.openapi.metal.v1.model.Project; import com.equinix.openapi.metal.v1.model.VirtualNetwork; +import com.equinix.openapi.metal.v1.model.Vrf; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -117,4 +118,12 @@ public void virtualNetworkTest() { // TODO: test virtualNetwork } + /** + * Test the property 'vrf' + */ + @Test + public void vrfTest() { + // TODO: test vrf + } + } 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 ba33f5334..3b461e862 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 @@ -14,7 +14,7 @@ package com.equinix.openapi.metal.v1.model; import com.equinix.openapi.metal.v1.model.IPReservationRequestInput; -import com.equinix.openapi.metal.v1.model.VrfIpReservationCreateInput; +import com.equinix.openapi.metal.v1.model.VrfIPReservationCreateInput; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/UserTest.java b/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/UserTest.java index f30c2a43d..46a37cad1 100644 --- a/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/UserTest.java +++ b/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/UserTest.java @@ -204,4 +204,12 @@ public void updatedAtTest() { // TODO: test updatedAt } + /** + * Test the property 'features' + */ + @Test + public void featuresTest() { + // TODO: test features + } + } diff --git a/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/VrfIPReservationAllOfTest.java b/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/VrfIPReservationAllOfTest.java new file mode 100644 index 000000000..39798e964 --- /dev/null +++ b/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/VrfIPReservationAllOfTest.java @@ -0,0 +1,60 @@ +/* + * 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 com.equinix.openapi.metal.v1.model.User; +import com.equinix.openapi.metal.v1.model.Vrf; +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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for VrfIPReservationAllOf + */ +public class VrfIPReservationAllOfTest { + private final VrfIPReservationAllOf model = new VrfIPReservationAllOf(); + + /** + * Model tests for VrfIPReservationAllOf + */ + @Test + public void testVrfIPReservationAllOf() { + // TODO: test VrfIPReservationAllOf + } + + /** + * Test the property 'vrf' + */ + @Test + public void vrfTest() { + // TODO: test vrf + } + + /** + * Test the property 'createdBy' + */ + @Test + public void createdByTest() { + // TODO: test createdBy + } + +} diff --git a/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/VrfIpReservationCreateInputTest.java b/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/VrfIPReservationCreateInputTest.java similarity index 86% rename from equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/VrfIpReservationCreateInputTest.java rename to equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/VrfIPReservationCreateInputTest.java index 132038a59..40fb5a3a2 100644 --- a/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/VrfIpReservationCreateInputTest.java +++ b/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/VrfIPReservationCreateInputTest.java @@ -29,17 +29,17 @@ /** - * Model tests for VrfIpReservationCreateInput + * Model tests for VrfIPReservationCreateInput */ -public class VrfIpReservationCreateInputTest { - private final VrfIpReservationCreateInput model = new VrfIpReservationCreateInput(); +public class VrfIPReservationCreateInputTest { + private final VrfIPReservationCreateInput model = new VrfIPReservationCreateInput(); /** - * Model tests for VrfIpReservationCreateInput + * Model tests for VrfIPReservationCreateInput */ @Test - public void testVrfIpReservationCreateInput() { - // TODO: test VrfIpReservationCreateInput + public void testVrfIPReservationCreateInput() { + // TODO: test VrfIPReservationCreateInput } /** diff --git a/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/VrfIpReservationListTest.java b/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/VrfIPReservationListTest.java similarity index 79% rename from equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/VrfIpReservationListTest.java rename to equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/VrfIPReservationListTest.java index 6abfae8da..cb771b389 100644 --- a/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/VrfIpReservationListTest.java +++ b/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/VrfIPReservationListTest.java @@ -13,7 +13,7 @@ package com.equinix.openapi.metal.v1.model; -import com.equinix.openapi.metal.v1.model.VrfIpReservation; +import com.equinix.openapi.metal.v1.model.VrfIPReservation; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -29,17 +29,17 @@ /** - * Model tests for VrfIpReservationList + * Model tests for VrfIPReservationList */ -public class VrfIpReservationListTest { - private final VrfIpReservationList model = new VrfIpReservationList(); +public class VrfIPReservationListTest { + private final VrfIPReservationList model = new VrfIPReservationList(); /** - * Model tests for VrfIpReservationList + * Model tests for VrfIPReservationList */ @Test - public void testVrfIpReservationList() { - // TODO: test VrfIpReservationList + public void testVrfIPReservationList() { + // TODO: test VrfIPReservationList } /** diff --git a/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/IPReservationListIpAddressesInnerTest.java b/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/VrfIPReservationTest.java similarity index 79% rename from equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/IPReservationListIpAddressesInnerTest.java rename to equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/VrfIPReservationTest.java index cba30b837..269bc61ed 100644 --- a/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/IPReservationListIpAddressesInnerTest.java +++ b/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/VrfIPReservationTest.java @@ -14,14 +14,12 @@ package com.equinix.openapi.metal.v1.model; import com.equinix.openapi.metal.v1.model.Href; -import com.equinix.openapi.metal.v1.model.IPAssignment; import com.equinix.openapi.metal.v1.model.IPReservation; -import com.equinix.openapi.metal.v1.model.IPReservationFacility; import com.equinix.openapi.metal.v1.model.IPReservationMetro; import com.equinix.openapi.metal.v1.model.MetalGatewayLite; import com.equinix.openapi.metal.v1.model.Project; +import com.equinix.openapi.metal.v1.model.User; import com.equinix.openapi.metal.v1.model.Vrf; -import com.equinix.openapi.metal.v1.model.VrfIpReservation; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -39,25 +37,17 @@ /** - * Model tests for IPReservationListIpAddressesInner + * Model tests for VrfIPReservation */ -public class IPReservationListIpAddressesInnerTest { - private final IPReservationListIpAddressesInner model = new IPReservationListIpAddressesInner(); +public class VrfIPReservationTest { + private final VrfIPReservation model = new VrfIPReservation(); /** - * Model tests for IPReservationListIpAddressesInner + * Model tests for VrfIPReservation */ @Test - public void testIPReservationListIpAddressesInner() { - // TODO: test IPReservationListIpAddressesInner - } - - /** - * Test the property 'addon' - */ - @Test - public void addonTest() { - // TODO: test addon + public void testVrfIPReservation() { + // TODO: test VrfIPReservation } /** @@ -68,14 +58,6 @@ public void addressFamilyTest() { // TODO: test addressFamily } - /** - * Test the property 'assignments' - */ - @Test - public void assignmentsTest() { - // TODO: test assignments - } - /** * Test the property 'bill' */ @@ -100,30 +82,6 @@ public void createdAtTest() { // TODO: test createdAt } - /** - * Test the property 'enabled' - */ - @Test - public void enabledTest() { - // TODO: test enabled - } - - /** - * Test the property 'facility' - */ - @Test - public void facilityTest() { - // TODO: test facility - } - - /** - * Test the property 'globalIp' - */ - @Test - public void globalIpTest() { - // TODO: test globalIp - } - /** * Test the property 'href' */ @@ -213,19 +171,19 @@ public void tagsTest() { } /** - * Test the property 'createdBy' + * Test the property 'details' */ @Test - public void createdByTest() { - // TODO: test createdBy + public void detailsTest() { + // TODO: test details } /** - * Test the property 'details' + * Test the property 'customdata' */ @Test - public void detailsTest() { - // TODO: test details + public void customdataTest() { + // TODO: test customdata } /** @@ -236,6 +194,30 @@ public void projectTest() { // TODO: test project } + /** + * Test the property 'projectLite' + */ + @Test + public void projectLiteTest() { + // TODO: test projectLite + } + + /** + * Test the property 'address' + */ + @Test + public void addressTest() { + // TODO: test address + } + + /** + * Test the property 'gateway' + */ + @Test + public void gatewayTest() { + // TODO: test gateway + } + /** * Test the property 'type' */ @@ -252,4 +234,12 @@ public void vrfTest() { // TODO: test vrf } + /** + * Test the property 'createdBy' + */ + @Test + public void createdByTest() { + // TODO: test createdBy + } + } diff --git a/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/VrfMetalGatewayTest.java b/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/VrfMetalGatewayTest.java deleted file mode 100644 index 0b25dd6a0..000000000 --- a/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/VrfMetalGatewayTest.java +++ /dev/null @@ -1,129 +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 com.equinix.openapi.metal.v1.model.Href; -import com.equinix.openapi.metal.v1.model.Project; -import com.equinix.openapi.metal.v1.model.VirtualNetwork; -import com.equinix.openapi.metal.v1.model.Vrf; -import com.equinix.openapi.metal.v1.model.VrfIpReservation; -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.time.OffsetDateTime; -import java.util.UUID; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - - -/** - * Model tests for VrfMetalGateway - */ -public class VrfMetalGatewayTest { - private final VrfMetalGateway model = new VrfMetalGateway(); - - /** - * Model tests for VrfMetalGateway - */ - @Test - public void testVrfMetalGateway() { - // TODO: test VrfMetalGateway - } - - /** - * Test the property 'createdAt' - */ - @Test - public void createdAtTest() { - // TODO: test createdAt - } - - /** - * Test the property 'createdBy' - */ - @Test - public void createdByTest() { - // TODO: test createdBy - } - - /** - * Test the property 'href' - */ - @Test - public void hrefTest() { - // TODO: test href - } - - /** - * Test the property 'id' - */ - @Test - public void idTest() { - // TODO: test id - } - - /** - * Test the property 'ipReservation' - */ - @Test - public void ipReservationTest() { - // TODO: test ipReservation - } - - /** - * Test the property 'project' - */ - @Test - public void projectTest() { - // TODO: test project - } - - /** - * Test the property 'state' - */ - @Test - public void stateTest() { - // TODO: test state - } - - /** - * Test the property 'updatedAt' - */ - @Test - public void updatedAtTest() { - // TODO: test updatedAt - } - - /** - * Test the property 'virtualNetwork' - */ - @Test - public void virtualNetworkTest() { - // TODO: test virtualNetwork - } - - /** - * Test the property 'vrf' - */ - @Test - public void vrfTest() { - // TODO: test vrf - } - -} diff --git a/internal/workflow/MetalGatewayOperator.java b/internal/workflow/MetalGatewayOperator.java index 8a19c376f..59e6dcf90 100644 --- a/internal/workflow/MetalGatewayOperator.java +++ b/internal/workflow/MetalGatewayOperator.java @@ -10,7 +10,6 @@ import com.equinix.openapi.ApiException; import com.equinix.openapi.metal.v1.api.MetalGatewaysApi; import com.equinix.openapi.metal.v1.model.CreateMetalGatewayRequest; -import com.equinix.openapi.metal.v1.model.FindMetalGatewayById200Response; 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; @@ -29,8 +28,7 @@ public MetalGatewayOperator(ApiClient apiClient) { // Returns the metal gateway queried by its id public MetalGateway getMetalGateway(UUID metalGatewayId, List include, List exclude) throws ApiException { - FindMetalGatewayById200Response response = metalGatewaysApi.findMetalGatewayById(metalGatewayId, include, exclude); - return response.getMetalGateway(); + return metalGatewaysApi.findMetalGatewayById(metalGatewayId, include, exclude); } // Returns the vlan associated with the metal gateway queried by its id @@ -52,8 +50,7 @@ public MetalGateway createMetalGatewayWithPrivateIpBlockAndPoll(UUID projectId, .virtualNetworkId(vlan.getId()); CreateMetalGatewayRequest createMetalGatewayRequest = new CreateMetalGatewayRequest(metalGatewayInput); - FindMetalGatewayById200Response response = metalGatewaysApi.createMetalGateway(projectId, createMetalGatewayRequest,1, 10); - MetalGateway metalGateway = response.getMetalGateway(); + MetalGateway metalGateway = metalGatewaysApi.createMetalGateway(projectId, createMetalGatewayRequest,1, 10); return metalGatewayCreatedAndPoll(metalGateway, retries, wait); } diff --git a/patches/spec.fetched.json/10-add-missing-fields-to-ipReservation-schema.patch b/patches/spec.fetched.json/10-add-missing-fields-to-ipReservation-schema.patch new file mode 100644 index 000000000..3e244e10a --- /dev/null +++ b/patches/spec.fetched.json/10-add-missing-fields-to-ipReservation-schema.patch @@ -0,0 +1,68 @@ +diff --git a/spec/oas3.patched.json b/spec/oas3.patched.json +index 957f762..a0380d2 100644 +--- a/spec/oas3.patched.json ++++ b/spec/oas3.patched.json +@@ -1832,8 +1832,45 @@ + "type": "string" + }, + "type": "array" ++ }, ++ "details": { ++ "type": "string" ++ }, ++ "customdata": { ++ "type": "object" ++ }, ++ "project": { ++ "$ref": "#/components/schemas/Project" ++ }, ++ "project_lite": { ++ "$ref": "#/components/schemas/Href" ++ }, ++ "requested_by": { ++ "$ref": "#/components/schemas/User" ++ }, ++ "address": { ++ "type": "string" ++ }, ++ "gateway": { ++ "type": "string" ++ }, ++ "available": { ++ "type": "string" ++ }, ++ "type": { ++ "type": "string", ++ "enum": [ ++ "global_ipv4", ++ "public_ipv4", ++ "private_ipv4", ++ "public_ipv6" ++ ] + } + }, ++ "required": [ ++ "type" ++ ], ++ "additionalProperties": false, + "type": "object" + }, + "IPReservationList": { +@@ -4743,14 +4780,15 @@ + }, + "type": { + "type": "string", +- "example": "vrf" ++ "enum": ["vrf"] + }, + "vrf": { + "$ref": "#/components/schemas/Vrf" + } + }, + "required": [ +- "vrf" ++ "vrf", ++ "type" + ], + "type": "object" + }, diff --git a/patches/spec.fetched.json/11-rename-VrfIp-to-VrfIP.patch b/patches/spec.fetched.json/11-rename-VrfIp-to-VrfIP.patch new file mode 100644 index 000000000..8682eec60 --- /dev/null +++ b/patches/spec.fetched.json/11-rename-VrfIp-to-VrfIP.patch @@ -0,0 +1,159 @@ +diff --git a/spec/oas3.patched.json b/spec/oas3.patched.json +index a0380d2..c285f8e 100644 +--- a/spec/oas3.patched.json ++++ b/spec/oas3.patched.json +@@ -1882,7 +1882,7 @@ + "$ref": "#/components/schemas/IPReservation" + }, + { +- "$ref": "#/components/schemas/VrfIpReservation" ++ "$ref": "#/components/schemas/VrfIPReservation" + } + ] + }, +@@ -4664,7 +4664,7 @@ + "format": "int32" + }, + "ip_ranges": { +- "$ref": "#/components/schemas/VrfIpRangeList" ++ "$ref": "#/components/schemas/VrfIPRangeList" + }, + "project": { + "$ref": "#/components/schemas/Project" +@@ -4687,7 +4687,7 @@ + "type": "string" + }, + "ip_ranges": { +- "$ref": "#/components/schemas/VrfIpRangeCreateInput" ++ "$ref": "#/components/schemas/VrfIPRangeCreateInput" + }, + "local_asn": { + "type": "integer", +@@ -4711,28 +4711,28 @@ + "project_id" + ] + }, +- "VrfIpRangeCreateInput": { ++ "VrfIPRangeCreateInput": { + "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." + }, +- "VrfIpRangeList": { ++ "VrfIPRangeList": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of CIDR network addresses. Like [\"10.0.0.0/16\", \"2001:d78::/56\"]." + }, +- "VrfIpRangeUpdateInput": { ++ "VrfIPRangeUpdateInput": { + "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. Adding a new CIDR address to the list will result in the creation of a new IP Range for this VRF. Removal of an existing CIDR address from the list will result in the deletion of an existing IP Range for this VRF. Deleting an IP Range will result in the deletion of any VRF IP Reservations contained within the IP Range, as well as the VRF IP Reservation\\'s associated Metal Gateways or Virtual Circuits. If you do not wish to add or remove IP Ranges, either include the full existing list of IP Ranges in the update request, or do not specify the `ip_ranges` field in the update request. Specifying a value of `[]` will remove all existing IP Ranges from the VRF." + }, +- "VrfIpReservation": { ++ "VrfIPReservation": { + "properties": { + "address_family": { + "type": "integer" +@@ -4792,7 +4792,7 @@ + ], + "type": "object" + }, +- "VrfIpReservationCreateInput": { ++ "VrfIPReservationCreateInput": { + "properties": { + "cidr": { + "type": "integer", +@@ -4834,11 +4834,11 @@ + "vrf_id" + ] + }, +- "VrfIpReservationList": { ++ "VrfIPReservationList": { + "properties": { + "ip_addresses": { + "items": { +- "$ref": "#/components/schemas/VrfIpReservation" ++ "$ref": "#/components/schemas/VrfIPReservation" + }, + "type": "array" + } +@@ -4873,7 +4873,7 @@ + "type": "string" + }, + "ip_reservation": { +- "$ref": "#/components/schemas/VrfIpReservation" ++ "$ref": "#/components/schemas/VrfIPReservation" + }, + "project": { + "$ref": "#/components/schemas/Project" +@@ -4924,7 +4924,7 @@ + "type": "string" + }, + "ip_ranges": { +- "$ref": "#/components/schemas/VrfIpRangeUpdateInput" ++ "$ref": "#/components/schemas/VrfIPRangeUpdateInput" + }, + "local_asn": { + "type": "integer", +@@ -8323,7 +8323,7 @@ + "$ref": "#/components/schemas/IPReservation" + }, + { +- "$ref": "#/components/schemas/VrfIpReservation" ++ "$ref": "#/components/schemas/VrfIPReservation" + } + ] + } +@@ -8413,7 +8413,7 @@ + "$ref": "#/components/schemas/IPReservation" + }, + { +- "$ref": "#/components/schemas/VrfIpReservation" ++ "$ref": "#/components/schemas/VrfIPReservation" + } + ] + } +@@ -13855,7 +13855,7 @@ + "$ref": "#/components/schemas/IPReservationRequestInput" + }, + { +- "$ref": "#/components/schemas/VrfIpReservationCreateInput" ++ "$ref": "#/components/schemas/VrfIPReservationCreateInput" + } + ] + } +@@ -13874,7 +13874,7 @@ + "$ref": "#/components/schemas/IPReservation" + }, + { +- "$ref": "#/components/schemas/VrfIpReservation" ++ "$ref": "#/components/schemas/VrfIPReservation" + } + ] + } +@@ -17991,7 +17991,7 @@ + "/vrfs/{id}/ips": { + "get": { + "description": "Returns the list of VRF IP Reservations for the VRF.", +- "operationId": "findVrfIpReservations", ++ "operationId": "findVrfIPReservations", + "parameters": [ + { + "description": "VRF UUID", +@@ -18033,7 +18033,7 @@ + "content": { + "application/json": { + "schema": { +- "$ref": "#/components/schemas/VrfIpReservationList" ++ "$ref": "#/components/schemas/VrfIPReservationList" + } + } + }, diff --git a/patches/spec.fetched.json/12-add-model-composition-for-IPReservation-remove-VrfMetalGateway.patch b/patches/spec.fetched.json/12-add-model-composition-for-IPReservation-remove-VrfMetalGateway.patch new file mode 100644 index 000000000..266bea1d8 --- /dev/null +++ b/patches/spec.fetched.json/12-add-model-composition-for-IPReservation-remove-VrfMetalGateway.patch @@ -0,0 +1,398 @@ +diff --git a/spec/oas3.patched.json b/spec/oas3.patched.json +index c285f8e..ac06152 100644 +--- a/spec/oas3.patched.json ++++ b/spec/oas3.patched.json +@@ -1645,6 +1645,10 @@ + ], + "type": "object" + }, ++ "HrefOnly": { ++ "allOf": [{"$ref": "#/components/schemas/Href"}], ++ "additionalProperties": false ++ }, + "IPAssignment": { + "properties": { + "address": { +@@ -1750,19 +1754,11 @@ + "type": "object" + }, + "IPReservation": { ++ "description": "Base class for all IP Reservations", + "properties": { +- "addon": { +- "type": "boolean" +- }, + "address_family": { + "type": "integer" + }, +- "assignments": { +- "items": { +- "$ref": "#/components/schemas/IPAssignment" +- }, +- "type": "array" +- }, + "bill": { + "type": "boolean" + }, +@@ -1773,22 +1769,6 @@ + "format": "date-time", + "type": "string" + }, +- "enabled": { +- "type": "boolean" +- }, +- "facility": { +- "allOf": [ +- { +- "$ref": "#/components/schemas/Facility" +- }, +- { +- "description": "The facility the IP reservation is in. If the facility the IP reservation was requested in is in a metro, a metro value will also be set, and the subsequent IP reservation can be used on a metro level. Can be null if requesting an IP reservation in a metro." +- } +- ] +- }, +- "global_ip": { +- "type": "boolean" +- }, + "href": { + "type": "string" + }, +@@ -1845,30 +1825,64 @@ + "project_lite": { + "$ref": "#/components/schemas/Href" + }, +- "requested_by": { +- "$ref": "#/components/schemas/User" +- }, + "address": { + "type": "string" + }, + "gateway": { + "type": "string" + }, +- "available": { +- "type": "string" +- }, + "type": { +- "type": "string", +- "enum": [ +- "global_ipv4", +- "public_ipv4", +- "private_ipv4", +- "public_ipv6" +- ] ++ "type": "string" + } + }, +- "required": [ +- "type" ++ "required": ["type"], ++ "discriminator": { ++ "propertyName": "type", ++ "mapping": { ++ "vrf": "#/components/schemas/VrfIPReservation", ++ "global_ipv4": "#/components/schemas/DefaultIPReservation", ++ "public_ipv4": "#/components/schemas/DefaultIPReservation", ++ "private_ipv4": "#/components/schemas/DefaultIPReservation", ++ "public_ipv6": "#/components/schemas/DefaultIPReservation" ++ } ++ } ++ }, ++ "DefaultIPReservation": { ++ "allOf": [{"$ref": "#/components/schemas/IPReservation"}, { ++ "properties": { ++ "addon": { ++ "type": "boolean" ++ }, ++ "assignments": { ++ "items": { ++ "$ref": "#/components/schemas/IPAssignment" ++ }, ++ "type": "array" ++ }, ++ "enabled": { ++ "type": "boolean" ++ }, ++ "facility": { ++ "allOf": [ ++ { ++ "$ref": "#/components/schemas/Facility" ++ }, ++ { ++ "description": "The facility the IP reservation is in. If the facility the IP reservation was requested in is in a metro, a metro value will also be set, and the subsequent IP reservation can be used on a metro level. Can be null if requesting an IP reservation in a metro." ++ } ++ ] ++ }, ++ "global_ip": { ++ "type": "boolean" ++ }, ++ "requested_by": { ++ "$ref": "#/components/schemas/User" ++ }, ++ "available": { ++ "type": "string" ++ } ++ } ++ } + ], + "additionalProperties": false, + "type": "object" +@@ -1877,14 +1891,7 @@ + "properties": { + "ip_addresses": { + "items": { +- "anyOf": [ +- { +- "$ref": "#/components/schemas/IPReservation" +- }, +- { +- "$ref": "#/components/schemas/VrfIPReservation" +- } +- ] ++ "$ref": "#/components/schemas/IPReservation" + }, + "type": "array" + } +@@ -2523,7 +2530,10 @@ + "type": "string" + }, + "ip_reservation": { +- "$ref": "#/components/schemas/IPReservation" ++ "oneOf": [ ++ {"$ref": "#/components/schemas/IPReservation"}, ++ {"$ref": "#/components/schemas/HrefOnly"} ++ ] + }, + "project": { + "$ref": "#/components/schemas/Project" +@@ -2543,6 +2553,9 @@ + }, + "virtual_network": { + "$ref": "#/components/schemas/VirtualNetwork" ++ }, ++ "vrf": { ++ "$ref": "#/components/schemas/Vrf" + } + }, + "type": "object" +@@ -2571,16 +2584,9 @@ + }, + "MetalGatewayList": { + "properties": { +- "MetalGateways": { ++ "metal_gateways": { + "items": { +- "anyOf": [ +- { + "$ref": "#/components/schemas/MetalGateway" +- }, +- { +- "$ref": "#/components/schemas/VrfMetalGateway" +- } +- ] + }, + "type": "array" + } +@@ -4262,6 +4268,12 @@ + "updated_at": { + "format": "date-time", + "type": "string" ++ }, ++ "features": { ++ "items": { ++ "type": "string" ++ }, ++ "type": "array" + } + }, + "type": "object" +@@ -4733,62 +4745,19 @@ + "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. Adding a new CIDR address to the list will result in the creation of a new IP Range for this VRF. Removal of an existing CIDR address from the list will result in the deletion of an existing IP Range for this VRF. Deleting an IP Range will result in the deletion of any VRF IP Reservations contained within the IP Range, as well as the VRF IP Reservation\\'s associated Metal Gateways or Virtual Circuits. If you do not wish to add or remove IP Ranges, either include the full existing list of IP Ranges in the update request, or do not specify the `ip_ranges` field in the update request. Specifying a value of `[]` will remove all existing IP Ranges from the VRF." + }, + "VrfIPReservation": { +- "properties": { +- "address_family": { +- "type": "integer" +- }, +- "cidr": { +- "type": "integer" +- }, +- "created_at": { +- "format": "date-time", +- "type": "string" +- }, +- "created_by": { +- "$ref": "#/components/schemas/Href" +- }, +- "details": { +- "type": "string" +- }, +- "href": { +- "type": "string" +- }, +- "id": { +- "format": "uuid", +- "type": "string" +- }, +- "metal_gateway": { +- "$ref": "#/components/schemas/MetalGatewayLite" +- }, +- "netmask": { +- "type": "string" +- }, +- "network": { +- "type": "string" +- }, +- "project": { +- "$ref": "#/components/schemas/Project" +- }, +- "state": { +- "type": "string" +- }, +- "tags": { +- "items": { +- "type": "string" ++ "allOf": [{"$ref": "#/components/schemas/IPReservation"}, { ++ "properties": { ++ "vrf": { ++ "$ref": "#/components/schemas/Vrf" + }, +- "type": "array" +- }, +- "type": { +- "type": "string", +- "enum": ["vrf"] +- }, +- "vrf": { +- "$ref": "#/components/schemas/Vrf" ++ "created_by": { ++ "$ref": "#/components/schemas/User" ++ } + } +- }, ++ }], ++ "additionalProperties": false, + "required": [ +- "vrf", +- "type" ++ "vrf" + ], + "type": "object" + }, +@@ -4856,50 +4825,6 @@ + }, + "type": "object" + }, +- "VrfMetalGateway": { +- "properties": { +- "created_at": { +- "format": "date-time", +- "type": "string" +- }, +- "created_by": { +- "$ref": "#/components/schemas/Href" +- }, +- "href": { +- "type": "string" +- }, +- "id": { +- "format": "uuid", +- "type": "string" +- }, +- "ip_reservation": { +- "$ref": "#/components/schemas/VrfIPReservation" +- }, +- "project": { +- "$ref": "#/components/schemas/Project" +- }, +- "state": { +- "description": "The current state of the Metal Gateway. 'Ready' indicates the gateway record has been configured, but is currently not active on the network. 'Active' indicates the gateway has been configured on the network. 'Deleting' is a temporary state used to indicate that the gateway is in the process of being un-configured from the network, after which the gateway record will be deleted.", +- "enum": [ +- "ready", +- "active", +- "deleting" +- ], +- "type": "string" +- }, +- "updated_at": { +- "format": "date-time", +- "type": "string" +- }, +- "virtual_network": { +- "$ref": "#/components/schemas/VirtualNetwork" +- }, +- "vrf": { +- "$ref": "#/components/schemas/Vrf" +- } +- }, +- "type": "object" +- }, + "VrfMetalGatewayCreateInput": { + "properties": { + "ip_reservation_id": { +@@ -8321,9 +8246,6 @@ + }, + { + "$ref": "#/components/schemas/IPReservation" +- }, +- { +- "$ref": "#/components/schemas/VrfIPReservation" + } + ] + } +@@ -8411,9 +8333,6 @@ + }, + { + "$ref": "#/components/schemas/IPReservation" +- }, +- { +- "$ref": "#/components/schemas/VrfIPReservation" + } + ] + } +@@ -9471,14 +9390,7 @@ + "content": { + "application/json": { + "schema": { +- "oneOf": [ +- { + "$ref": "#/components/schemas/MetalGateway" +- }, +- { +- "$ref": "#/components/schemas/VrfMetalGateway" +- } +- ] + } + } + }, +@@ -13869,14 +13781,7 @@ + "content": { + "application/json": { + "schema": { +- "oneOf": [ +- { +- "$ref": "#/components/schemas/IPReservation" +- }, +- { +- "$ref": "#/components/schemas/VrfIPReservation" +- } +- ] ++ "$ref": "#/components/schemas/IPReservation" + } + } + }, +@@ -15426,14 +15331,7 @@ + "content": { + "application/json": { + "schema": { +- "oneOf": [ +- { + "$ref": "#/components/schemas/MetalGateway" +- }, +- { +- "$ref": "#/components/schemas/VrfMetalGateway" +- } +- ] + } + } + }, diff --git a/spec/oas3.config.json b/spec/oas3.config.json index 93a5b295c..4a424b5dc 100644 --- a/spec/oas3.config.json +++ b/spec/oas3.config.json @@ -7,5 +7,6 @@ "modelPackage": "com.equinix.openapi.metal.v1.model", "apiPackage": "com.equinix.openapi.metal.v1.api", "hideGenerationTimestamp": true, - "disallowAdditionalPropertiesIfNotPresent": false + "disallowAdditionalPropertiesIfNotPresent": false, + "legacyDiscriminatorBehavior": true } diff --git a/spec/oas3.patched.json b/spec/oas3.patched.json index 957f762e4..ac06152d9 100644 --- a/spec/oas3.patched.json +++ b/spec/oas3.patched.json @@ -1645,6 +1645,10 @@ ], "type": "object" }, + "HrefOnly": { + "allOf": [{"$ref": "#/components/schemas/Href"}], + "additionalProperties": false + }, "IPAssignment": { "properties": { "address": { @@ -1750,19 +1754,11 @@ "type": "object" }, "IPReservation": { + "description": "Base class for all IP Reservations", "properties": { - "addon": { - "type": "boolean" - }, "address_family": { "type": "integer" }, - "assignments": { - "items": { - "$ref": "#/components/schemas/IPAssignment" - }, - "type": "array" - }, "bill": { "type": "boolean" }, @@ -1773,22 +1769,6 @@ "format": "date-time", "type": "string" }, - "enabled": { - "type": "boolean" - }, - "facility": { - "allOf": [ - { - "$ref": "#/components/schemas/Facility" - }, - { - "description": "The facility the IP reservation is in. If the facility the IP reservation was requested in is in a metro, a metro value will also be set, and the subsequent IP reservation can be used on a metro level. Can be null if requesting an IP reservation in a metro." - } - ] - }, - "global_ip": { - "type": "boolean" - }, "href": { "type": "string" }, @@ -1832,23 +1812,87 @@ "type": "string" }, "type": "array" + }, + "details": { + "type": "string" + }, + "customdata": { + "type": "object" + }, + "project": { + "$ref": "#/components/schemas/Project" + }, + "project_lite": { + "$ref": "#/components/schemas/Href" + }, + "address": { + "type": "string" + }, + "gateway": { + "type": "string" + }, + "type": { + "type": "string" } }, - "type": "object" + "required": ["type"], + "discriminator": { + "propertyName": "type", + "mapping": { + "vrf": "#/components/schemas/VrfIPReservation", + "global_ipv4": "#/components/schemas/DefaultIPReservation", + "public_ipv4": "#/components/schemas/DefaultIPReservation", + "private_ipv4": "#/components/schemas/DefaultIPReservation", + "public_ipv6": "#/components/schemas/DefaultIPReservation" + } + } }, - "IPReservationList": { - "properties": { - "ip_addresses": { - "items": { - "anyOf": [ + "DefaultIPReservation": { + "allOf": [{"$ref": "#/components/schemas/IPReservation"}, { + "properties": { + "addon": { + "type": "boolean" + }, + "assignments": { + "items": { + "$ref": "#/components/schemas/IPAssignment" + }, + "type": "array" + }, + "enabled": { + "type": "boolean" + }, + "facility": { + "allOf": [ { - "$ref": "#/components/schemas/IPReservation" + "$ref": "#/components/schemas/Facility" }, { - "$ref": "#/components/schemas/VrfIpReservation" + "description": "The facility the IP reservation is in. If the facility the IP reservation was requested in is in a metro, a metro value will also be set, and the subsequent IP reservation can be used on a metro level. Can be null if requesting an IP reservation in a metro." } ] }, + "global_ip": { + "type": "boolean" + }, + "requested_by": { + "$ref": "#/components/schemas/User" + }, + "available": { + "type": "string" + } + } + } + ], + "additionalProperties": false, + "type": "object" + }, + "IPReservationList": { + "properties": { + "ip_addresses": { + "items": { + "$ref": "#/components/schemas/IPReservation" + }, "type": "array" } }, @@ -2486,7 +2530,10 @@ "type": "string" }, "ip_reservation": { - "$ref": "#/components/schemas/IPReservation" + "oneOf": [ + {"$ref": "#/components/schemas/IPReservation"}, + {"$ref": "#/components/schemas/HrefOnly"} + ] }, "project": { "$ref": "#/components/schemas/Project" @@ -2506,6 +2553,9 @@ }, "virtual_network": { "$ref": "#/components/schemas/VirtualNetwork" + }, + "vrf": { + "$ref": "#/components/schemas/Vrf" } }, "type": "object" @@ -2534,16 +2584,9 @@ }, "MetalGatewayList": { "properties": { - "MetalGateways": { + "metal_gateways": { "items": { - "anyOf": [ - { "$ref": "#/components/schemas/MetalGateway" - }, - { - "$ref": "#/components/schemas/VrfMetalGateway" - } - ] }, "type": "array" } @@ -4225,6 +4268,12 @@ "updated_at": { "format": "date-time", "type": "string" + }, + "features": { + "items": { + "type": "string" + }, + "type": "array" } }, "type": "object" @@ -4627,7 +4676,7 @@ "format": "int32" }, "ip_ranges": { - "$ref": "#/components/schemas/VrfIpRangeList" + "$ref": "#/components/schemas/VrfIPRangeList" }, "project": { "$ref": "#/components/schemas/Project" @@ -4650,7 +4699,7 @@ "type": "string" }, "ip_ranges": { - "$ref": "#/components/schemas/VrfIpRangeCreateInput" + "$ref": "#/components/schemas/VrfIPRangeCreateInput" }, "local_asn": { "type": "integer", @@ -4674,87 +4723,45 @@ "project_id" ] }, - "VrfIpRangeCreateInput": { + "VrfIPRangeCreateInput": { "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." }, - "VrfIpRangeList": { + "VrfIPRangeList": { "type": "array", "items": { "type": "string" }, "description": "A list of CIDR network addresses. Like [\"10.0.0.0/16\", \"2001:d78::/56\"]." }, - "VrfIpRangeUpdateInput": { + "VrfIPRangeUpdateInput": { "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. Adding a new CIDR address to the list will result in the creation of a new IP Range for this VRF. Removal of an existing CIDR address from the list will result in the deletion of an existing IP Range for this VRF. Deleting an IP Range will result in the deletion of any VRF IP Reservations contained within the IP Range, as well as the VRF IP Reservation\\'s associated Metal Gateways or Virtual Circuits. If you do not wish to add or remove IP Ranges, either include the full existing list of IP Ranges in the update request, or do not specify the `ip_ranges` field in the update request. Specifying a value of `[]` will remove all existing IP Ranges from the VRF." }, - "VrfIpReservation": { - "properties": { - "address_family": { - "type": "integer" - }, - "cidr": { - "type": "integer" - }, - "created_at": { - "format": "date-time", - "type": "string" - }, - "created_by": { - "$ref": "#/components/schemas/Href" - }, - "details": { - "type": "string" - }, - "href": { - "type": "string" - }, - "id": { - "format": "uuid", - "type": "string" - }, - "metal_gateway": { - "$ref": "#/components/schemas/MetalGatewayLite" - }, - "netmask": { - "type": "string" - }, - "network": { - "type": "string" - }, - "project": { - "$ref": "#/components/schemas/Project" - }, - "state": { - "type": "string" - }, - "tags": { - "items": { - "type": "string" + "VrfIPReservation": { + "allOf": [{"$ref": "#/components/schemas/IPReservation"}, { + "properties": { + "vrf": { + "$ref": "#/components/schemas/Vrf" }, - "type": "array" - }, - "type": { - "type": "string", - "example": "vrf" - }, - "vrf": { - "$ref": "#/components/schemas/Vrf" + "created_by": { + "$ref": "#/components/schemas/User" + } } - }, + }], + "additionalProperties": false, "required": [ - "vrf" + "vrf" ], "type": "object" }, - "VrfIpReservationCreateInput": { + "VrfIPReservationCreateInput": { "properties": { "cidr": { "type": "integer", @@ -4796,11 +4803,11 @@ "vrf_id" ] }, - "VrfIpReservationList": { + "VrfIPReservationList": { "properties": { "ip_addresses": { "items": { - "$ref": "#/components/schemas/VrfIpReservation" + "$ref": "#/components/schemas/VrfIPReservation" }, "type": "array" } @@ -4818,50 +4825,6 @@ }, "type": "object" }, - "VrfMetalGateway": { - "properties": { - "created_at": { - "format": "date-time", - "type": "string" - }, - "created_by": { - "$ref": "#/components/schemas/Href" - }, - "href": { - "type": "string" - }, - "id": { - "format": "uuid", - "type": "string" - }, - "ip_reservation": { - "$ref": "#/components/schemas/VrfIpReservation" - }, - "project": { - "$ref": "#/components/schemas/Project" - }, - "state": { - "description": "The current state of the Metal Gateway. 'Ready' indicates the gateway record has been configured, but is currently not active on the network. 'Active' indicates the gateway has been configured on the network. 'Deleting' is a temporary state used to indicate that the gateway is in the process of being un-configured from the network, after which the gateway record will be deleted.", - "enum": [ - "ready", - "active", - "deleting" - ], - "type": "string" - }, - "updated_at": { - "format": "date-time", - "type": "string" - }, - "virtual_network": { - "$ref": "#/components/schemas/VirtualNetwork" - }, - "vrf": { - "$ref": "#/components/schemas/Vrf" - } - }, - "type": "object" - }, "VrfMetalGatewayCreateInput": { "properties": { "ip_reservation_id": { @@ -4886,7 +4849,7 @@ "type": "string" }, "ip_ranges": { - "$ref": "#/components/schemas/VrfIpRangeUpdateInput" + "$ref": "#/components/schemas/VrfIPRangeUpdateInput" }, "local_asn": { "type": "integer", @@ -8283,9 +8246,6 @@ }, { "$ref": "#/components/schemas/IPReservation" - }, - { - "$ref": "#/components/schemas/VrfIpReservation" } ] } @@ -8373,9 +8333,6 @@ }, { "$ref": "#/components/schemas/IPReservation" - }, - { - "$ref": "#/components/schemas/VrfIpReservation" } ] } @@ -9433,14 +9390,7 @@ "content": { "application/json": { "schema": { - "oneOf": [ - { "$ref": "#/components/schemas/MetalGateway" - }, - { - "$ref": "#/components/schemas/VrfMetalGateway" - } - ] } } }, @@ -13817,7 +13767,7 @@ "$ref": "#/components/schemas/IPReservationRequestInput" }, { - "$ref": "#/components/schemas/VrfIpReservationCreateInput" + "$ref": "#/components/schemas/VrfIPReservationCreateInput" } ] } @@ -13831,14 +13781,7 @@ "content": { "application/json": { "schema": { - "oneOf": [ - { - "$ref": "#/components/schemas/IPReservation" - }, - { - "$ref": "#/components/schemas/VrfIpReservation" - } - ] + "$ref": "#/components/schemas/IPReservation" } } }, @@ -15388,14 +15331,7 @@ "content": { "application/json": { "schema": { - "oneOf": [ - { "$ref": "#/components/schemas/MetalGateway" - }, - { - "$ref": "#/components/schemas/VrfMetalGateway" - } - ] } } }, @@ -17953,7 +17889,7 @@ "/vrfs/{id}/ips": { "get": { "description": "Returns the list of VRF IP Reservations for the VRF.", - "operationId": "findVrfIpReservations", + "operationId": "findVrfIPReservations", "parameters": [ { "description": "VRF UUID", @@ -17995,7 +17931,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/VrfIpReservationList" + "$ref": "#/components/schemas/VrfIPReservationList" } } },