Skip to content
This repository has been archived by the owner on Dec 23, 2024. It is now read-only.

07 vlan metalgateways spec field patch #37

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 22 additions & 33 deletions equinix-openapi-metal/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15460,7 +15460,7 @@ components:
example:
gateway_address: gateway_address
updated_at: 2000-01-23T04:56:07.000+00:00
vlan: 0.8008281904610115
vlan: 1.4658129805029452
created_at: 2000-01-23T04:56:07.000+00:00
href: href
id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91
Expand Down Expand Up @@ -19070,15 +19070,10 @@ components:
type: object
VirtualNetwork:
example:
vxlan: 6
metal_gateway:
gateway_address: gateway_address
updated_at: 2000-01-23T04:56:07.000+00:00
vlan: 0.8008281904610115
created_at: 2000-01-23T04:56:07.000+00:00
href: href
id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91
state: ready
vxlan: 0
metal_gateways:
- href: href
- href: href
metro_code: metro_code
instances:
- href: href
Expand Down Expand Up @@ -19115,8 +19110,12 @@ components:
items:
$ref: '#/components/schemas/Href'
type: array
metal_gateway:
$ref: '#/components/schemas/MetalGatewayLite'
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:
Expand Down Expand Up @@ -19160,15 +19159,10 @@ components:
VirtualNetworkList:
example:
virtual_networks:
- vxlan: 6
metal_gateway:
gateway_address: gateway_address
updated_at: 2000-01-23T04:56:07.000+00:00
vlan: 0.8008281904610115
created_at: 2000-01-23T04:56:07.000+00:00
href: href
id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91
state: ready
- vxlan: 0
metal_gateways:
- href: href
- href: href
metro_code: metro_code
instances:
- href: href
Expand All @@ -19183,15 +19177,10 @@ components:
assigned_to_virtual_circuit: true
assigned_to:
href: href
- vxlan: 6
metal_gateway:
gateway_address: gateway_address
updated_at: 2000-01-23T04:56:07.000+00:00
vlan: 0.8008281904610115
created_at: 2000-01-23T04:56:07.000+00:00
href: href
id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91
state: ready
- vxlan: 0
metal_gateways:
- href: href
- href: href
metro_code: metro_code
instances:
- href: href
Expand Down Expand Up @@ -19478,7 +19467,7 @@ components:
metal_gateway:
gateway_address: gateway_address
updated_at: 2000-01-23T04:56:07.000+00:00
vlan: 0.8008281904610115
vlan: 1.4658129805029452
created_at: 2000-01-23T04:56:07.000+00:00
href: href
id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91
Expand Down Expand Up @@ -19673,7 +19662,7 @@ components:
metal_gateway:
gateway_address: gateway_address
updated_at: 2000-01-23T04:56:07.000+00:00
vlan: 0.8008281904610115
vlan: 1.4658129805029452
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be the wrong kind of numeric type.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

created_at: 2000-01-23T04:56:07.000+00:00
href: href
id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91
Expand Down Expand Up @@ -19793,7 +19782,7 @@ components:
metal_gateway:
gateway_address: gateway_address
updated_at: 2000-01-23T04:56:07.000+00:00
vlan: 0.8008281904610115
vlan: 1.4658129805029452
created_at: 2000-01-23T04:56:07.000+00:00
href: href
id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91
Expand Down
2 changes: 1 addition & 1 deletion equinix-openapi-metal/docs/VirtualNetwork.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
|**href** | **String** | | [optional] |
|**id** | **UUID** | | [optional] |
|**instances** | [**List<Href>**](Href.md) | A list of instances with ports currently associated to this Virtual Network. | [optional] |
|**metalGateway** | [**MetalGatewayLite**](MetalGatewayLite.md) | | [optional] |
|**metalGateways** | [**List<Href>**](Href.md) | A list of metal gateways currently associated to this Virtual Network. | [optional] |
|**metro** | [**Href**](Href.md) | | [optional] |
|**metroCode** | **String** | The Metro code of the metro in which this Virtual Network is defined. | [optional] |
|**vxlan** | **Integer** | | [optional] |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
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.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
Expand Down Expand Up @@ -82,9 +81,9 @@ public class VirtualNetwork {
@SerializedName(SERIALIZED_NAME_INSTANCES)
private List<Href> instances = null;

public static final String SERIALIZED_NAME_METAL_GATEWAY = "metal_gateway";
@SerializedName(SERIALIZED_NAME_METAL_GATEWAY)
private MetalGatewayLite metalGateway;
public static final String SERIALIZED_NAME_METAL_GATEWAYS = "metal_gateways";
@SerializedName(SERIALIZED_NAME_METAL_GATEWAYS)
private List<Href> metalGateways = null;

public static final String SERIALIZED_NAME_METRO = "metro";
@SerializedName(SERIALIZED_NAME_METRO)
Expand Down Expand Up @@ -270,26 +269,34 @@ public void setInstances(List<Href> instances) {
}


public VirtualNetwork metalGateway(MetalGatewayLite metalGateway) {
public VirtualNetwork metalGateways(List<Href> metalGateways) {

this.metalGateway = metalGateway;
this.metalGateways = metalGateways;
return this;
}

public VirtualNetwork addMetalGatewaysItem(Href metalGatewaysItem) {
if (this.metalGateways == null) {
this.metalGateways = new ArrayList<>();
}
this.metalGateways.add(metalGatewaysItem);
return this;
}

/**
* Get metalGateway
* @return metalGateway
* A list of metal gateways currently associated to this Virtual Network.
* @return metalGateways
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
@ApiModelProperty(value = "A list of metal gateways currently associated to this Virtual Network.")

public MetalGatewayLite getMetalGateway() {
return metalGateway;
public List<Href> getMetalGateways() {
return metalGateways;
}


public void setMetalGateway(MetalGatewayLite metalGateway) {
this.metalGateway = metalGateway;
public void setMetalGateways(List<Href> metalGateways) {
this.metalGateways = metalGateways;
}


Expand Down Expand Up @@ -414,7 +421,7 @@ public boolean equals(Object o) {
Objects.equals(this.href, virtualNetwork.href) &&
Objects.equals(this.id, virtualNetwork.id) &&
Objects.equals(this.instances, virtualNetwork.instances) &&
Objects.equals(this.metalGateway, virtualNetwork.metalGateway) &&
Objects.equals(this.metalGateways, virtualNetwork.metalGateways) &&
Objects.equals(this.metro, virtualNetwork.metro) &&
Objects.equals(this.metroCode, virtualNetwork.metroCode) &&
Objects.equals(this.vxlan, virtualNetwork.vxlan)&&
Expand All @@ -423,7 +430,7 @@ public boolean equals(Object o) {

@Override
public int hashCode() {
return Objects.hash(assignedTo, assignedToVirtualCircuit, description, facility, href, id, instances, metalGateway, metro, metroCode, vxlan, additionalProperties);
return Objects.hash(assignedTo, assignedToVirtualCircuit, description, facility, href, id, instances, metalGateways, metro, metroCode, vxlan, additionalProperties);
}

@Override
Expand All @@ -437,7 +444,7 @@ public String toString() {
sb.append(" href: ").append(toIndentedString(href)).append("\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" instances: ").append(toIndentedString(instances)).append("\n");
sb.append(" metalGateway: ").append(toIndentedString(metalGateway)).append("\n");
sb.append(" metalGateways: ").append(toIndentedString(metalGateways)).append("\n");
sb.append(" metro: ").append(toIndentedString(metro)).append("\n");
sb.append(" metroCode: ").append(toIndentedString(metroCode)).append("\n");
sb.append(" vxlan: ").append(toIndentedString(vxlan)).append("\n");
Expand Down Expand Up @@ -471,7 +478,7 @@ private String toIndentedString(Object o) {
openapiFields.add("href");
openapiFields.add("id");
openapiFields.add("instances");
openapiFields.add("metal_gateway");
openapiFields.add("metal_gateways");
openapiFields.add("metro");
openapiFields.add("metro_code");
openapiFields.add("vxlan");
Expand Down Expand Up @@ -523,9 +530,17 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException {
Href.validateJsonObject(jsonArrayinstances.get(i).getAsJsonObject());
};
}
// validate the optional field `metal_gateway`
if (jsonObj.get("metal_gateway") != null && !jsonObj.get("metal_gateway").isJsonNull()) {
MetalGatewayLite.validateJsonObject(jsonObj.getAsJsonObject("metal_gateway"));
JsonArray jsonArraymetalGateways = jsonObj.getAsJsonArray("metal_gateways");
if (jsonArraymetalGateways != null) {
// ensure the json data is an array
if (!jsonObj.get("metal_gateways").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `metal_gateways` to be an array in the JSON string but got `%s`", jsonObj.get("metal_gateways").toString()));
}

// validate the optional field `metal_gateways` (array)
for (int i = 0; i < jsonArraymetalGateways.size(); i++) {
Href.validateJsonObject(jsonArraymetalGateways.get(i).getAsJsonObject());
};
}
// validate the optional field `metro`
if (jsonObj.get("metro") != null && !jsonObj.get("metro").isJsonNull()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
package com.equinix.openapi.metal.v1.model;

import com.equinix.openapi.metal.v1.model.Href;
import com.equinix.openapi.metal.v1.model.MetalGatewayLite;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
Expand Down Expand Up @@ -101,11 +100,11 @@ public void instancesTest() {
}

/**
* Test the property 'metalGateway'
* Test the property 'metalGateways'
*/
@Test
public void metalGatewayTest() {
// TODO: test metalGateway
public void metalGatewaysTest() {
// TODO: test metalGateways
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
diff --git a/spec/oas3.patched.json b/spec/oas3.patched.json
index 0816bf5..fb8fdf0 100644
--- a/spec/oas3.patched.json
+++ b/spec/oas3.patched.json
@@ -4549,8 +4549,12 @@
},
"type": "array"
},
- "metal_gateway": {
- "$ref": "#/components/schemas/MetalGatewayLite"
+ "metal_gateways": {
+ "description": "A list of metal gateways currently associated to this Virtual Network.",
+ "items": {
+ "$ref": "#/components/schemas/Href"
Copy link
Member

@displague displague Aug 10, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reporting this as Href seems fair to me. When metal_gateways is included ?include=, this will be a MetalGatewayLite. I don't believe we have simple ways to express that today other than with the description.

+ },
+ "type": "array"
},
"metro": {
"$ref": "#/components/schemas/Href"