diff --git a/services/iaas/oas_commit b/services/iaas/oas_commit index c0a0c9b8..af4b6dcb 100644 --- a/services/iaas/oas_commit +++ b/services/iaas/oas_commit @@ -1 +1 @@ -43a874547d9e5b23655d0f351c47b32b46d4a19e +1bf87ffe9514b4e11c6f3a8c2d3fb3e32702ae90 diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Backup.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Backup.java index 41619f84..f9fe2ad5 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Backup.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Backup.java @@ -179,11 +179,21 @@ public Backup labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateBackupPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateBackupPayload.java index 6d3e541b..ee9450e9 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateBackupPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateBackupPayload.java @@ -80,11 +80,21 @@ public CreateBackupPayload labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateImagePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateImagePayload.java index 94a5ec4f..da0d19b2 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateImagePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateImagePayload.java @@ -246,11 +246,21 @@ public CreateImagePayload labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateKeyPairPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateKeyPairPayload.java index 8060519a..8d41aa27 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateKeyPairPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateKeyPairPayload.java @@ -99,11 +99,21 @@ public CreateKeyPairPayload labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateNetworkAreaPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateNetworkAreaPayload.java index 12242de7..03d5de50 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateNetworkAreaPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateNetworkAreaPayload.java @@ -78,11 +78,21 @@ public CreateNetworkAreaPayload labels(@javax.annotation.Nullable Object labels) } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateNetworkPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateNetworkPayload.java index 7db3e4a5..fadd5b24 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateNetworkPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateNetworkPayload.java @@ -38,6 +38,11 @@ public class CreateNetworkPayload { @SerializedName(SERIALIZED_NAME_ADDRESS_FAMILY) @javax.annotation.Nullable private CreateNetworkAddressFamily addressFamily; + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable private String description; + public static final String SERIALIZED_NAME_DHCP = "dhcp"; @SerializedName(SERIALIZED_NAME_DHCP) @@ -81,6 +86,24 @@ public void setAddressFamily( this.addressFamily = addressFamily; } + public CreateNetworkPayload description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * Description Object. Allows string up to 255 Characters. + * + * @return description + */ + @javax.annotation.Nullable public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + public CreateNetworkPayload dhcp(@javax.annotation.Nullable Boolean dhcp) { this.dhcp = dhcp; return this; @@ -105,11 +128,21 @@ public CreateNetworkPayload labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ @@ -212,6 +245,7 @@ public boolean equals(Object o) { } CreateNetworkPayload createNetworkPayload = (CreateNetworkPayload) o; return Objects.equals(this.addressFamily, createNetworkPayload.addressFamily) + && Objects.equals(this.description, createNetworkPayload.description) && Objects.equals(this.dhcp, createNetworkPayload.dhcp) && Objects.equals(this.labels, createNetworkPayload.labels) && Objects.equals(this.name, createNetworkPayload.name) @@ -222,7 +256,8 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(addressFamily, dhcp, labels, name, routed, additionalProperties); + return Objects.hash( + addressFamily, description, dhcp, labels, name, routed, additionalProperties); } @Override @@ -230,6 +265,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class CreateNetworkPayload {\n"); sb.append(" addressFamily: ").append(toIndentedString(addressFamily)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" dhcp: ").append(toIndentedString(dhcp)).append("\n"); sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); @@ -259,7 +295,13 @@ private String toIndentedString(Object o) { // a set of all properties/fields (JSON key names) openapiFields = new HashSet( - Arrays.asList("addressFamily", "dhcp", "labels", "name", "routed")); + Arrays.asList( + "addressFamily", + "description", + "dhcp", + "labels", + "name", + "routed")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(Arrays.asList("name")); @@ -299,6 +341,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("addressFamily") != null && !jsonObj.get("addressFamily").isJsonNull()) { CreateNetworkAddressFamily.validateJsonElement(jsonObj.get("addressFamily")); } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) + && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `description` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("description").toString())); + } if (!jsonObj.get("name").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateNicPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateNicPayload.java index abfde85f..6c4ff1ff 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateNicPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateNicPayload.java @@ -24,6 +24,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; @@ -41,6 +42,11 @@ public class CreateNicPayload { @SerializedName(SERIALIZED_NAME_ALLOWED_ADDRESSES) @javax.annotation.Nullable private List allowedAddresses = new ArrayList<>(); + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + + @SerializedName(SERIALIZED_NAME_CREATED_AT) + @javax.annotation.Nullable private OffsetDateTime createdAt; + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; @SerializedName(SERIALIZED_NAME_DESCRIPTION) @@ -106,17 +112,31 @@ public class CreateNicPayload { @SerializedName(SERIALIZED_NAME_TYPE) @javax.annotation.Nullable private String type; + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable private OffsetDateTime updatedAt; + public CreateNicPayload() {} public CreateNicPayload( - UUID device, UUID id, String mac, UUID networkId, String status, String type) { + OffsetDateTime createdAt, + UUID device, + UUID id, + String mac, + UUID networkId, + String status, + String type, + OffsetDateTime updatedAt) { this(); + this.createdAt = createdAt; this.device = device; this.id = id; this.mac = mac; this.networkId = networkId; this.status = status; this.type = type; + this.updatedAt = updatedAt; } public CreateNicPayload allowedAddresses( @@ -147,6 +167,15 @@ public void setAllowedAddresses( this.allowedAddresses = allowedAddresses; } + /** + * Date-time when resource was created. + * + * @return createdAt + */ + @javax.annotation.Nullable public OffsetDateTime getCreatedAt() { + return createdAt; + } + public CreateNicPayload description(@javax.annotation.Nullable String description) { this.description = description; return this; @@ -225,11 +254,21 @@ public CreateNicPayload labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ @@ -340,6 +379,15 @@ public void setSecurityGroups(@javax.annotation.Nullable List securityGrou return type; } + /** + * Date-time when resource was last updated. + * + * @return updatedAt + */ + @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + /** * A container for additional, undeclared properties. This is a holder for any undeclared * properties as specified with the 'additionalProperties' keyword in the OAS document. @@ -394,6 +442,7 @@ public boolean equals(Object o) { } CreateNicPayload createNicPayload = (CreateNicPayload) o; return Objects.equals(this.allowedAddresses, createNicPayload.allowedAddresses) + && Objects.equals(this.createdAt, createNicPayload.createdAt) && Objects.equals(this.description, createNicPayload.description) && Objects.equals(this.device, createNicPayload.device) && Objects.equals(this.id, createNicPayload.id) @@ -407,6 +456,7 @@ public boolean equals(Object o) { && Objects.equals(this.securityGroups, createNicPayload.securityGroups) && Objects.equals(this.status, createNicPayload.status) && Objects.equals(this.type, createNicPayload.type) + && Objects.equals(this.updatedAt, createNicPayload.updatedAt) && Objects.equals(this.additionalProperties, createNicPayload.additionalProperties); } @@ -414,6 +464,7 @@ public boolean equals(Object o) { public int hashCode() { return Objects.hash( allowedAddresses, + createdAt, description, device, id, @@ -427,6 +478,7 @@ public int hashCode() { securityGroups, status, type, + updatedAt, additionalProperties); } @@ -435,6 +487,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class CreateNicPayload {\n"); sb.append(" allowedAddresses: ").append(toIndentedString(allowedAddresses)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" device: ").append(toIndentedString(device)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); @@ -448,6 +501,7 @@ public String toString() { sb.append(" securityGroups: ").append(toIndentedString(securityGroups)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); @@ -475,6 +529,7 @@ private String toIndentedString(Object o) { new HashSet( Arrays.asList( "allowedAddresses", + "createdAt", "description", "device", "id", @@ -487,7 +542,8 @@ private String toIndentedString(Object o) { "nicSecurity", "securityGroups", "status", - "type")); + "type", + "updatedAt")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(0); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreatePublicIPPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreatePublicIPPayload.java index 697fa223..aec63b55 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreatePublicIPPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreatePublicIPPayload.java @@ -23,6 +23,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; @@ -35,6 +36,11 @@ /** Object that represents a public IP. */ @javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") public class CreatePublicIPPayload { + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + + @SerializedName(SERIALIZED_NAME_CREATED_AT) + @javax.annotation.Nullable private OffsetDateTime createdAt; + public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @@ -55,12 +61,29 @@ public class CreatePublicIPPayload { @SerializedName(SERIALIZED_NAME_NETWORK_INTERFACE) @javax.annotation.Nullable private UUID networkInterface; + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable private OffsetDateTime updatedAt; + public CreatePublicIPPayload() {} - public CreatePublicIPPayload(UUID id, String ip) { + public CreatePublicIPPayload( + OffsetDateTime createdAt, UUID id, String ip, OffsetDateTime updatedAt) { this(); + this.createdAt = createdAt; this.id = id; this.ip = ip; + this.updatedAt = updatedAt; + } + + /** + * Date-time when resource was created. + * + * @return createdAt + */ + @javax.annotation.Nullable public OffsetDateTime getCreatedAt() { + return createdAt; } /** @@ -87,11 +110,21 @@ public CreatePublicIPPayload labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ @@ -122,6 +155,15 @@ public void setNetworkInterface(@javax.annotation.Nullable UUID networkInterface this.networkInterface = networkInterface; } + /** + * Date-time when resource was last updated. + * + * @return updatedAt + */ + @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + /** * A container for additional, undeclared properties. This is a holder for any undeclared * properties as specified with the 'additionalProperties' keyword in the OAS document. @@ -175,10 +217,12 @@ public boolean equals(Object o) { return false; } CreatePublicIPPayload createPublicIPPayload = (CreatePublicIPPayload) o; - return Objects.equals(this.id, createPublicIPPayload.id) + return Objects.equals(this.createdAt, createPublicIPPayload.createdAt) + && Objects.equals(this.id, createPublicIPPayload.id) && Objects.equals(this.ip, createPublicIPPayload.ip) && Objects.equals(this.labels, createPublicIPPayload.labels) && Objects.equals(this.networkInterface, createPublicIPPayload.networkInterface) + && Objects.equals(this.updatedAt, createPublicIPPayload.updatedAt) && Objects.equals( this.additionalProperties, createPublicIPPayload.additionalProperties); } @@ -194,7 +238,8 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(id, ip, labels, networkInterface, additionalProperties); + return Objects.hash( + createdAt, id, ip, labels, networkInterface, updatedAt, additionalProperties); } private static int hashCodeNullable(JsonNullable a) { @@ -208,10 +253,12 @@ private static int hashCodeNullable(JsonNullable a) { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class CreatePublicIPPayload {\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" ip: ").append(toIndentedString(ip)).append("\n"); sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); sb.append(" networkInterface: ").append(toIndentedString(networkInterface)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); @@ -236,7 +283,14 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = - new HashSet(Arrays.asList("id", "ip", "labels", "networkInterface")); + new HashSet( + Arrays.asList( + "createdAt", + "id", + "ip", + "labels", + "networkInterface", + "updatedAt")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(0); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateSecurityGroupPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateSecurityGroupPayload.java index 662c4778..82b40274 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateSecurityGroupPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateSecurityGroupPayload.java @@ -133,11 +133,21 @@ public CreateSecurityGroupPayload labels(@javax.annotation.Nullable Object label } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateServerPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateServerPayload.java index f1248325..b10b7f4f 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateServerPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateServerPayload.java @@ -351,11 +351,21 @@ public CreateServerPayload labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateSnapshotPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateSnapshotPayload.java index ab75445a..03c68bf5 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateSnapshotPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateSnapshotPayload.java @@ -155,11 +155,21 @@ public CreateSnapshotPayload labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateVolumePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateVolumePayload.java index 6fac28e5..7ad4e64f 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateVolumePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateVolumePayload.java @@ -255,11 +255,21 @@ public CreateVolumePayload labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Image.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Image.java index 604ac770..8ed4d718 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Image.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Image.java @@ -246,11 +246,21 @@ public Image labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Keypair.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Keypair.java index 045f6eba..14eeb5f2 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Keypair.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Keypair.java @@ -98,11 +98,21 @@ public Keypair labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/NIC.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/NIC.java index 23833cc8..6e71cc43 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/NIC.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/NIC.java @@ -24,6 +24,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; @@ -41,6 +42,11 @@ public class NIC { @SerializedName(SERIALIZED_NAME_ALLOWED_ADDRESSES) @javax.annotation.Nullable private List allowedAddresses = new ArrayList<>(); + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + + @SerializedName(SERIALIZED_NAME_CREATED_AT) + @javax.annotation.Nullable private OffsetDateTime createdAt; + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; @SerializedName(SERIALIZED_NAME_DESCRIPTION) @@ -106,16 +112,31 @@ public class NIC { @SerializedName(SERIALIZED_NAME_TYPE) @javax.annotation.Nullable private String type; + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable private OffsetDateTime updatedAt; + public NIC() {} - public NIC(UUID device, UUID id, String mac, UUID networkId, String status, String type) { + public NIC( + OffsetDateTime createdAt, + UUID device, + UUID id, + String mac, + UUID networkId, + String status, + String type, + OffsetDateTime updatedAt) { this(); + this.createdAt = createdAt; this.device = device; this.id = id; this.mac = mac; this.networkId = networkId; this.status = status; this.type = type; + this.updatedAt = updatedAt; } public NIC allowedAddresses( @@ -146,6 +167,15 @@ public void setAllowedAddresses( this.allowedAddresses = allowedAddresses; } + /** + * Date-time when resource was created. + * + * @return createdAt + */ + @javax.annotation.Nullable public OffsetDateTime getCreatedAt() { + return createdAt; + } + public NIC description(@javax.annotation.Nullable String description) { this.description = description; return this; @@ -224,11 +254,21 @@ public NIC labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ @@ -339,6 +379,15 @@ public void setSecurityGroups(@javax.annotation.Nullable List securityGrou return type; } + /** + * Date-time when resource was last updated. + * + * @return updatedAt + */ + @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + /** * A container for additional, undeclared properties. This is a holder for any undeclared * properties as specified with the 'additionalProperties' keyword in the OAS document. @@ -393,6 +442,7 @@ public boolean equals(Object o) { } NIC NIC = (NIC) o; return Objects.equals(this.allowedAddresses, NIC.allowedAddresses) + && Objects.equals(this.createdAt, NIC.createdAt) && Objects.equals(this.description, NIC.description) && Objects.equals(this.device, NIC.device) && Objects.equals(this.id, NIC.id) @@ -406,6 +456,7 @@ public boolean equals(Object o) { && Objects.equals(this.securityGroups, NIC.securityGroups) && Objects.equals(this.status, NIC.status) && Objects.equals(this.type, NIC.type) + && Objects.equals(this.updatedAt, NIC.updatedAt) && Objects.equals(this.additionalProperties, NIC.additionalProperties); } @@ -413,6 +464,7 @@ public boolean equals(Object o) { public int hashCode() { return Objects.hash( allowedAddresses, + createdAt, description, device, id, @@ -426,6 +478,7 @@ public int hashCode() { securityGroups, status, type, + updatedAt, additionalProperties); } @@ -434,6 +487,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class NIC {\n"); sb.append(" allowedAddresses: ").append(toIndentedString(allowedAddresses)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" device: ").append(toIndentedString(device)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); @@ -447,6 +501,7 @@ public String toString() { sb.append(" securityGroups: ").append(toIndentedString(securityGroups)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); @@ -474,6 +529,7 @@ private String toIndentedString(Object o) { new HashSet( Arrays.asList( "allowedAddresses", + "createdAt", "description", "device", "id", @@ -486,7 +542,8 @@ private String toIndentedString(Object o) { "nicSecurity", "securityGroups", "status", - "type")); + "type", + "updatedAt")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(0); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Network.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Network.java index 6c3a3192..8a9bb5a7 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Network.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Network.java @@ -42,6 +42,11 @@ public class Network { @SerializedName(SERIALIZED_NAME_CREATED_AT) @javax.annotation.Nullable private OffsetDateTime createdAt; + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable private String description; + public static final String SERIALIZED_NAME_DHCP = "dhcp"; @SerializedName(SERIALIZED_NAME_DHCP) @@ -132,6 +137,24 @@ public Network(OffsetDateTime createdAt, OffsetDateTime updatedAt) { return createdAt; } + public Network description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * Description Object. Allows string up to 255 Characters. + * + * @return description + */ + @javax.annotation.Nullable public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + public Network dhcp(@javax.annotation.Nullable Boolean dhcp) { this.dhcp = dhcp; return this; @@ -194,11 +217,21 @@ public Network labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ @@ -472,6 +505,7 @@ public boolean equals(Object o) { } Network network = (Network) o; return Objects.equals(this.createdAt, network.createdAt) + && Objects.equals(this.description, network.description) && Objects.equals(this.dhcp, network.dhcp) && Objects.equals(this.gateway, network.gateway) && Objects.equals(this.gatewayv6, network.gatewayv6) @@ -502,6 +536,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) public int hashCode() { return Objects.hash( createdAt, + description, dhcp, gateway, gatewayv6, @@ -531,6 +566,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Network {\n"); sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" dhcp: ").append(toIndentedString(dhcp)).append("\n"); sb.append(" gateway: ").append(toIndentedString(gateway)).append("\n"); sb.append(" gatewayv6: ").append(toIndentedString(gatewayv6)).append("\n"); @@ -572,6 +608,7 @@ private String toIndentedString(Object o) { new HashSet( Arrays.asList( "createdAt", + "description", "dhcp", "gateway", "gatewayv6", @@ -621,6 +658,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) + && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `description` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("description").toString())); + } if ((jsonObj.get("gateway") != null && !jsonObj.get("gateway").isJsonNull()) && !jsonObj.get("gateway").isJsonPrimitive()) { throw new IllegalArgumentException( diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/NetworkArea.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/NetworkArea.java index 694ffc38..73c8ac44 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/NetworkArea.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/NetworkArea.java @@ -139,11 +139,21 @@ public NetworkArea labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/PartialUpdateNetworkAreaPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/PartialUpdateNetworkAreaPayload.java index 36c1f9f0..7b7e114f 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/PartialUpdateNetworkAreaPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/PartialUpdateNetworkAreaPayload.java @@ -75,11 +75,21 @@ public PartialUpdateNetworkAreaPayload labels(@javax.annotation.Nullable Object } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/PartialUpdateNetworkPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/PartialUpdateNetworkPayload.java index b72e0dd7..e66af204 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/PartialUpdateNetworkPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/PartialUpdateNetworkPayload.java @@ -38,6 +38,11 @@ public class PartialUpdateNetworkPayload { @SerializedName(SERIALIZED_NAME_ADDRESS_FAMILY) @javax.annotation.Nullable private UpdateNetworkAddressFamily addressFamily; + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable private String description; + public static final String SERIALIZED_NAME_DHCP = "dhcp"; @SerializedName(SERIALIZED_NAME_DHCP) @@ -80,6 +85,24 @@ public void setAddressFamily( this.addressFamily = addressFamily; } + public PartialUpdateNetworkPayload description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * Description Object. Allows string up to 255 Characters. + * + * @return description + */ + @javax.annotation.Nullable public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + public PartialUpdateNetworkPayload dhcp(@javax.annotation.Nullable Boolean dhcp) { this.dhcp = dhcp; return this; @@ -104,11 +127,21 @@ public PartialUpdateNetworkPayload labels(@javax.annotation.Nullable Object labe } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ @@ -210,6 +243,7 @@ public boolean equals(Object o) { } PartialUpdateNetworkPayload partialUpdateNetworkPayload = (PartialUpdateNetworkPayload) o; return Objects.equals(this.addressFamily, partialUpdateNetworkPayload.addressFamily) + && Objects.equals(this.description, partialUpdateNetworkPayload.description) && Objects.equals(this.dhcp, partialUpdateNetworkPayload.dhcp) && Objects.equals(this.labels, partialUpdateNetworkPayload.labels) && Objects.equals(this.name, partialUpdateNetworkPayload.name) @@ -221,7 +255,8 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(addressFamily, dhcp, labels, name, routed, additionalProperties); + return Objects.hash( + addressFamily, description, dhcp, labels, name, routed, additionalProperties); } @Override @@ -229,6 +264,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class PartialUpdateNetworkPayload {\n"); sb.append(" addressFamily: ").append(toIndentedString(addressFamily)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" dhcp: ").append(toIndentedString(dhcp)).append("\n"); sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); @@ -258,7 +294,13 @@ private String toIndentedString(Object o) { // a set of all properties/fields (JSON key names) openapiFields = new HashSet( - Arrays.asList("addressFamily", "dhcp", "labels", "name", "routed")); + Arrays.asList( + "addressFamily", + "description", + "dhcp", + "labels", + "name", + "routed")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(0); @@ -287,6 +329,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("addressFamily") != null && !jsonObj.get("addressFamily").isJsonNull()) { UpdateNetworkAddressFamily.validateJsonElement(jsonObj.get("addressFamily")); } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) + && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `description` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("description").toString())); + } if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { throw new IllegalArgumentException( diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/PublicIp.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/PublicIp.java index c73d44fa..f51bb2ec 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/PublicIp.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/PublicIp.java @@ -23,6 +23,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; @@ -35,6 +36,11 @@ /** Object that represents a public IP. */ @javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") public class PublicIp { + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + + @SerializedName(SERIALIZED_NAME_CREATED_AT) + @javax.annotation.Nullable private OffsetDateTime createdAt; + public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @@ -55,12 +61,28 @@ public class PublicIp { @SerializedName(SERIALIZED_NAME_NETWORK_INTERFACE) @javax.annotation.Nullable private UUID networkInterface; + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable private OffsetDateTime updatedAt; + public PublicIp() {} - public PublicIp(UUID id, String ip) { + public PublicIp(OffsetDateTime createdAt, UUID id, String ip, OffsetDateTime updatedAt) { this(); + this.createdAt = createdAt; this.id = id; this.ip = ip; + this.updatedAt = updatedAt; + } + + /** + * Date-time when resource was created. + * + * @return createdAt + */ + @javax.annotation.Nullable public OffsetDateTime getCreatedAt() { + return createdAt; } /** @@ -87,11 +109,21 @@ public PublicIp labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ @@ -121,6 +153,15 @@ public void setNetworkInterface(@javax.annotation.Nullable UUID networkInterface this.networkInterface = networkInterface; } + /** + * Date-time when resource was last updated. + * + * @return updatedAt + */ + @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + /** * A container for additional, undeclared properties. This is a holder for any undeclared * properties as specified with the 'additionalProperties' keyword in the OAS document. @@ -174,10 +215,12 @@ public boolean equals(Object o) { return false; } PublicIp publicIp = (PublicIp) o; - return Objects.equals(this.id, publicIp.id) + return Objects.equals(this.createdAt, publicIp.createdAt) + && Objects.equals(this.id, publicIp.id) && Objects.equals(this.ip, publicIp.ip) && Objects.equals(this.labels, publicIp.labels) && Objects.equals(this.networkInterface, publicIp.networkInterface) + && Objects.equals(this.updatedAt, publicIp.updatedAt) && Objects.equals(this.additionalProperties, publicIp.additionalProperties); } @@ -192,7 +235,8 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(id, ip, labels, networkInterface, additionalProperties); + return Objects.hash( + createdAt, id, ip, labels, networkInterface, updatedAt, additionalProperties); } private static int hashCodeNullable(JsonNullable a) { @@ -206,10 +250,12 @@ private static int hashCodeNullable(JsonNullable a) { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class PublicIp {\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" ip: ").append(toIndentedString(ip)).append("\n"); sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); sb.append(" networkInterface: ").append(toIndentedString(networkInterface)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); @@ -234,7 +280,14 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = - new HashSet(Arrays.asList("id", "ip", "labels", "networkInterface")); + new HashSet( + Arrays.asList( + "createdAt", + "id", + "ip", + "labels", + "networkInterface", + "updatedAt")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(0); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Route.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Route.java index e7f89d3b..60c59807 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Route.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Route.java @@ -91,11 +91,21 @@ public Route labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/SecurityGroup.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/SecurityGroup.java index 939310be..67a8014f 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/SecurityGroup.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/SecurityGroup.java @@ -133,11 +133,21 @@ public SecurityGroup labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Server.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Server.java index 925d8eb0..4b999f2f 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Server.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Server.java @@ -350,11 +350,21 @@ public Server labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ServerNetwork.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ServerNetwork.java index a64db7d9..c60b85cd 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ServerNetwork.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ServerNetwork.java @@ -24,6 +24,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; @@ -41,6 +42,11 @@ public class ServerNetwork { @SerializedName(SERIALIZED_NAME_ALLOWED_ADDRESSES) @javax.annotation.Nullable private List allowedAddresses = new ArrayList<>(); + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + + @SerializedName(SERIALIZED_NAME_CREATED_AT) + @javax.annotation.Nullable private OffsetDateTime createdAt; + public static final String SERIALIZED_NAME_IPV4 = "ipv4"; @SerializedName(SERIALIZED_NAME_IPV4) @@ -91,8 +97,19 @@ public class ServerNetwork { @SerializedName(SERIALIZED_NAME_SECURITY_GROUPS) @javax.annotation.Nullable private List securityGroups = new ArrayList<>(); + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable private OffsetDateTime updatedAt; + public ServerNetwork() {} + public ServerNetwork(OffsetDateTime createdAt, OffsetDateTime updatedAt) { + this(); + this.createdAt = createdAt; + this.updatedAt = updatedAt; + } + public ServerNetwork allowedAddresses( @javax.annotation.Nullable List allowedAddresses) { this.allowedAddresses = allowedAddresses; @@ -121,6 +138,15 @@ public void setAllowedAddresses( this.allowedAddresses = allowedAddresses; } + /** + * Date-time when resource was created. + * + * @return createdAt + */ + @javax.annotation.Nullable public OffsetDateTime getCreatedAt() { + return createdAt; + } + public ServerNetwork ipv4(@javax.annotation.Nullable String ipv4) { this.ipv4 = ipv4; return this; @@ -296,6 +322,15 @@ public void setSecurityGroups(@javax.annotation.Nullable List securityGrou this.securityGroups = securityGroups; } + /** + * Date-time when resource was last updated. + * + * @return updatedAt + */ + @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + /** * A container for additional, undeclared properties. This is a holder for any undeclared * properties as specified with the 'additionalProperties' keyword in the OAS document. @@ -350,6 +385,7 @@ public boolean equals(Object o) { } ServerNetwork serverNetwork = (ServerNetwork) o; return Objects.equals(this.allowedAddresses, serverNetwork.allowedAddresses) + && Objects.equals(this.createdAt, serverNetwork.createdAt) && Objects.equals(this.ipv4, serverNetwork.ipv4) && Objects.equals(this.ipv6, serverNetwork.ipv6) && Objects.equals(this.mac, serverNetwork.mac) @@ -359,6 +395,7 @@ public boolean equals(Object o) { && Objects.equals(this.nicSecurity, serverNetwork.nicSecurity) && Objects.equals(this.publicIp, serverNetwork.publicIp) && Objects.equals(this.securityGroups, serverNetwork.securityGroups) + && Objects.equals(this.updatedAt, serverNetwork.updatedAt) && Objects.equals(this.additionalProperties, serverNetwork.additionalProperties); } @@ -366,6 +403,7 @@ public boolean equals(Object o) { public int hashCode() { return Objects.hash( allowedAddresses, + createdAt, ipv4, ipv6, mac, @@ -375,6 +413,7 @@ public int hashCode() { nicSecurity, publicIp, securityGroups, + updatedAt, additionalProperties); } @@ -383,6 +422,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ServerNetwork {\n"); sb.append(" allowedAddresses: ").append(toIndentedString(allowedAddresses)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); sb.append(" ipv4: ").append(toIndentedString(ipv4)).append("\n"); sb.append(" ipv6: ").append(toIndentedString(ipv6)).append("\n"); sb.append(" mac: ").append(toIndentedString(mac)).append("\n"); @@ -392,6 +432,7 @@ public String toString() { sb.append(" nicSecurity: ").append(toIndentedString(nicSecurity)).append("\n"); sb.append(" publicIp: ").append(toIndentedString(publicIp)).append("\n"); sb.append(" securityGroups: ").append(toIndentedString(securityGroups)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); @@ -419,6 +460,7 @@ private String toIndentedString(Object o) { new HashSet( Arrays.asList( "allowedAddresses", + "createdAt", "ipv4", "ipv6", "mac", @@ -427,7 +469,8 @@ private String toIndentedString(Object o) { "nicId", "nicSecurity", "publicIp", - "securityGroups")); + "securityGroups", + "updatedAt")); // a set of required properties/fields (JSON key names) openapiRequiredFields = diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Snapshot.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Snapshot.java index c9f90a9f..3b1684c9 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Snapshot.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Snapshot.java @@ -155,11 +155,21 @@ public Snapshot labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateBackupPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateBackupPayload.java index d0541ed2..eb96861a 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateBackupPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateBackupPayload.java @@ -179,11 +179,21 @@ public UpdateBackupPayload labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateImagePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateImagePayload.java index 938a11aa..61a6c16a 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateImagePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateImagePayload.java @@ -136,11 +136,21 @@ public UpdateImagePayload labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateKeyPairPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateKeyPairPayload.java index b23f84a3..8808ddd4 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateKeyPairPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateKeyPairPayload.java @@ -46,11 +46,21 @@ public UpdateKeyPairPayload labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateNetworkAreaRoutePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateNetworkAreaRoutePayload.java index 5d5cd69a..246dcdf9 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateNetworkAreaRoutePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateNetworkAreaRoutePayload.java @@ -46,11 +46,21 @@ public UpdateNetworkAreaRoutePayload labels(@javax.annotation.Nullable Object la } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateNicPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateNicPayload.java index 974fd652..a6e40cd5 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateNicPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateNicPayload.java @@ -120,11 +120,21 @@ public UpdateNicPayload labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdatePublicIPPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdatePublicIPPayload.java index 5fdb7c71..23380154 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdatePublicIPPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdatePublicIPPayload.java @@ -23,6 +23,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; @@ -35,6 +36,11 @@ /** Object that represents a public IP. */ @javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") public class UpdatePublicIPPayload { + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + + @SerializedName(SERIALIZED_NAME_CREATED_AT) + @javax.annotation.Nullable private OffsetDateTime createdAt; + public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @@ -55,12 +61,29 @@ public class UpdatePublicIPPayload { @SerializedName(SERIALIZED_NAME_NETWORK_INTERFACE) @javax.annotation.Nullable private UUID networkInterface; + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable private OffsetDateTime updatedAt; + public UpdatePublicIPPayload() {} - public UpdatePublicIPPayload(UUID id, String ip) { + public UpdatePublicIPPayload( + OffsetDateTime createdAt, UUID id, String ip, OffsetDateTime updatedAt) { this(); + this.createdAt = createdAt; this.id = id; this.ip = ip; + this.updatedAt = updatedAt; + } + + /** + * Date-time when resource was created. + * + * @return createdAt + */ + @javax.annotation.Nullable public OffsetDateTime getCreatedAt() { + return createdAt; } /** @@ -87,11 +110,21 @@ public UpdatePublicIPPayload labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ @@ -122,6 +155,15 @@ public void setNetworkInterface(@javax.annotation.Nullable UUID networkInterface this.networkInterface = networkInterface; } + /** + * Date-time when resource was last updated. + * + * @return updatedAt + */ + @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + /** * A container for additional, undeclared properties. This is a holder for any undeclared * properties as specified with the 'additionalProperties' keyword in the OAS document. @@ -175,10 +217,12 @@ public boolean equals(Object o) { return false; } UpdatePublicIPPayload updatePublicIPPayload = (UpdatePublicIPPayload) o; - return Objects.equals(this.id, updatePublicIPPayload.id) + return Objects.equals(this.createdAt, updatePublicIPPayload.createdAt) + && Objects.equals(this.id, updatePublicIPPayload.id) && Objects.equals(this.ip, updatePublicIPPayload.ip) && Objects.equals(this.labels, updatePublicIPPayload.labels) && Objects.equals(this.networkInterface, updatePublicIPPayload.networkInterface) + && Objects.equals(this.updatedAt, updatePublicIPPayload.updatedAt) && Objects.equals( this.additionalProperties, updatePublicIPPayload.additionalProperties); } @@ -194,7 +238,8 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(id, ip, labels, networkInterface, additionalProperties); + return Objects.hash( + createdAt, id, ip, labels, networkInterface, updatedAt, additionalProperties); } private static int hashCodeNullable(JsonNullable a) { @@ -208,10 +253,12 @@ private static int hashCodeNullable(JsonNullable a) { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class UpdatePublicIPPayload {\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" ip: ").append(toIndentedString(ip)).append("\n"); sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); sb.append(" networkInterface: ").append(toIndentedString(networkInterface)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); @@ -236,7 +283,14 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = - new HashSet(Arrays.asList("id", "ip", "labels", "networkInterface")); + new HashSet( + Arrays.asList( + "createdAt", + "id", + "ip", + "labels", + "networkInterface", + "updatedAt")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(0); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateSecurityGroupPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateSecurityGroupPayload.java index 1ab40acf..f7cec935 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateSecurityGroupPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateSecurityGroupPayload.java @@ -74,11 +74,21 @@ public UpdateSecurityGroupPayload labels(@javax.annotation.Nullable Object label } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateServerPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateServerPayload.java index 6393b9d5..e8188609 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateServerPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateServerPayload.java @@ -56,11 +56,21 @@ public UpdateServerPayload labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateSnapshotPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateSnapshotPayload.java index 98587294..350c9699 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateSnapshotPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateSnapshotPayload.java @@ -74,11 +74,21 @@ public UpdateSnapshotPayload labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateVolumePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateVolumePayload.java index bd6eac7e..203b926d 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateVolumePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateVolumePayload.java @@ -120,11 +120,21 @@ public UpdateVolumePayload labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Volume.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Volume.java index 71dad1b9..4278b578 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Volume.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Volume.java @@ -255,11 +255,21 @@ public Volume labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/VolumePerformanceClass.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/VolumePerformanceClass.java index 2c6de20b..ba6cc7df 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/VolumePerformanceClass.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/VolumePerformanceClass.java @@ -103,11 +103,21 @@ public VolumePerformanceClass labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/ApiCallback.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/ApiCallback.java deleted file mode 100644 index a39eba1d..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/ApiCallback.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api; - -import cloud.stackit.sdk.core.exception.ApiException; -import java.util.List; -import java.util.Map; - -/** - * Callback for asynchronous API call. - * - * @param The return type - */ -public interface ApiCallback { - /** - * This is called when the API call fails. - * - * @param e The exception causing the failure - * @param statusCode Status code of the response if available, otherwise it would be 0 - * @param responseHeaders Headers of the response if available, otherwise it would be null - */ - void onFailure(ApiException e, int statusCode, Map> responseHeaders); - - /** - * This is called when the API call succeeded. - * - * @param result The result deserialized from response - * @param statusCode Status code of the response - * @param responseHeaders Headers of the response - */ - void onSuccess(T result, int statusCode, Map> responseHeaders); - - /** - * This is called when the API upload processing. - * - * @param bytesWritten bytes Written - * @param contentLength content length of request body - * @param done write end - */ - void onUploadProgress(long bytesWritten, long contentLength, boolean done); - - /** - * This is called when the API download processing. - * - * @param bytesRead bytes Read - * @param contentLength content length of the response - * @param done Read end - */ - void onDownloadProgress(long bytesRead, long contentLength, boolean done); -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/ApiClient.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/ApiClient.java deleted file mode 100644 index 4c7c7955..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/ApiClient.java +++ /dev/null @@ -1,1600 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api; - -import cloud.stackit.sdk.core.KeyFlowAuthenticator; -import cloud.stackit.sdk.core.config.CoreConfiguration; -import cloud.stackit.sdk.core.exception.ApiException; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.io.UnsupportedEncodingException; -import java.lang.reflect.Type; -import java.net.URLConnection; -import java.net.URLEncoder; -import java.nio.file.Files; -import java.nio.file.Paths; -import java.security.GeneralSecurityException; -import java.security.KeyStore; -import java.security.SecureRandom; -import java.security.cert.Certificate; -import java.security.cert.CertificateException; -import java.security.cert.CertificateFactory; -import java.text.DateFormat; -import java.time.LocalDate; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.util.*; -import java.util.Map.Entry; -import java.util.concurrent.TimeUnit; -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import javax.net.ssl.*; -import okhttp3.*; -import okhttp3.internal.http.HttpMethod; -import okhttp3.internal.tls.OkHostnameVerifier; -import okhttp3.logging.HttpLoggingInterceptor; -import okhttp3.logging.HttpLoggingInterceptor.Level; -import okio.Buffer; -import okio.BufferedSink; -import okio.Okio; - -/** ApiClient class. */ -public class ApiClient { - - protected String basePath = "https://iaas.api.stackit.cloud"; - protected List servers = - new ArrayList( - Arrays.asList( - new ServerConfiguration( - "https://iaas.api.stackit.cloud", - "No description provided", - new HashMap() { - { - put( - "region", - new ServerVariable( - "No description provided", - "global", - new HashSet())); - } - }))); - protected Integer serverIndex = 0; - protected Map serverVariables = null; - protected boolean debugging = false; - protected Map defaultHeaderMap = new HashMap(); - protected Map defaultCookieMap = new HashMap(); - protected String tempFolderPath = null; - - protected DateFormat dateFormat; - protected DateFormat datetimeFormat; - protected boolean lenientDatetimeFormat; - protected int dateLength; - - protected InputStream sslCaCert; - protected boolean verifyingSsl; - protected KeyManager[] keyManagers; - protected String tlsServerName; - - protected OkHttpClient httpClient; - protected JSON json; - - protected HttpLoggingInterceptor loggingInterceptor; - - protected CoreConfiguration configuration; - - /** - * Basic constructor for ApiClient. - * - *

Not recommended for production use, use the one with the OkHttpClient parameter instead. - * - * @throws IOException thrown when a file can not be found - */ - public ApiClient() throws IOException { - this(null, new CoreConfiguration()); - } - - /** - * Basic constructor for ApiClient - * - *

Not recommended for production use, use the one with the OkHttpClient parameter instead. - * - * @param config a {@link cloud.stackit.sdk.core.config.CoreConfiguration} object - * @throws IOException thrown when a file can not be found - */ - public ApiClient(CoreConfiguration config) throws IOException { - this(null, config); - } - - /** - * Constructor for ApiClient with OkHttpClient parameter. Recommended for production use. - * - * @param httpClient a OkHttpClient object - * @throws IOException thrown when a file can not be found - */ - public ApiClient(OkHttpClient httpClient) throws IOException { - this(httpClient, new CoreConfiguration()); - } - - /** - * Constructor for ApiClient with OkHttpClient parameter. Recommended for production use. - * - * @param httpClient a OkHttpClient object - * @param config a {@link cloud.stackit.sdk.core.config.CoreConfiguration} object - * @throws IOException thrown when a file can not be found - */ - public ApiClient(OkHttpClient httpClient, CoreConfiguration config) throws IOException { - init(); - - if (config.getCustomEndpoint() != null && !config.getCustomEndpoint().trim().isEmpty()) { - basePath = config.getCustomEndpoint(); - } - if (config.getDefaultHeader() != null) { - defaultHeaderMap = config.getDefaultHeader(); - } - this.configuration = config; - - if (httpClient == null) { - initHttpClient(); - KeyFlowAuthenticator authenticator = new KeyFlowAuthenticator(this.httpClient, config); - this.httpClient = this.httpClient.newBuilder().authenticator(authenticator).build(); - } else { - // Authorization has to be configured manually in case a custom http client object is - // passed - this.httpClient = httpClient; - } - } - - protected void initHttpClient() { - initHttpClient(Collections.emptyList()); - } - - protected void initHttpClient(List interceptors) { - OkHttpClient.Builder builder = new OkHttpClient.Builder(); - builder.addNetworkInterceptor(getProgressInterceptor()); - for (Interceptor interceptor : interceptors) { - builder.addInterceptor(interceptor); - } - - httpClient = builder.build(); - } - - protected void init() { - verifyingSsl = true; - - json = new JSON(); - - // Set default User-Agent. - setUserAgent("stackit-sdk-java/iaas"); - } - - /** - * Get base path - * - * @return Base path - */ - public String getBasePath() { - return basePath; - } - - /** - * Set base path - * - * @param basePath Base path of the URL (e.g https://iaas.api.stackit.cloud) - * @return An instance of ApiClient - */ - public ApiClient setBasePath(String basePath) { - this.basePath = basePath; - this.serverIndex = null; - return this; - } - - public List getServers() { - return servers; - } - - public ApiClient setServers(List servers) { - this.servers = servers; - return this; - } - - public Integer getServerIndex() { - return serverIndex; - } - - public ApiClient setServerIndex(Integer serverIndex) { - this.serverIndex = serverIndex; - return this; - } - - public Map getServerVariables() { - return serverVariables; - } - - public ApiClient setServerVariables(Map serverVariables) { - this.serverVariables = serverVariables; - return this; - } - - /** - * Get HTTP client - * - * @return An instance of OkHttpClient - */ - public OkHttpClient getHttpClient() { - return httpClient; - } - - /** - * Get JSON - * - * @return JSON object - */ - public JSON getJSON() { - return json; - } - - /** - * Set JSON - * - * @param json JSON object - * @return Api client - */ - public ApiClient setJSON(JSON json) { - this.json = json; - return this; - } - - /** - * True if isVerifyingSsl flag is on - * - * @return True if isVerifySsl flag is on - */ - public boolean isVerifyingSsl() { - return verifyingSsl; - } - - /** - * Configure whether to verify certificate and hostname when making https requests. Default to - * true. NOTE: Do NOT set to false in production code, otherwise you would face multiple types - * of cryptographic attacks. - * - * @param verifyingSsl True to verify TLS/SSL connection - * @return ApiClient - */ - public ApiClient setVerifyingSsl(boolean verifyingSsl) { - this.verifyingSsl = verifyingSsl; - applySslSettings(); - return this; - } - - /** - * Get SSL CA cert. - * - * @return Input stream to the SSL CA cert - */ - public InputStream getSslCaCert() { - return sslCaCert; - } - - /** - * Configure the CA certificate to be trusted when making https requests. Use null to reset to - * default. - * - * @param sslCaCert input stream for SSL CA cert - * @return ApiClient - */ - public ApiClient setSslCaCert(InputStream sslCaCert) { - this.sslCaCert = sslCaCert; - applySslSettings(); - return this; - } - - /** - * Getter for the field keyManagers. - * - * @return an array of {@link javax.net.ssl.KeyManager} objects - */ - public KeyManager[] getKeyManagers() { - return keyManagers; - } - - /** - * Configure client keys to use for authorization in an SSL session. Use null to reset to - * default. - * - * @param managers The KeyManagers to use - * @return ApiClient - */ - public ApiClient setKeyManagers(KeyManager[] managers) { - this.keyManagers = managers; - applySslSettings(); - return this; - } - - /** - * Get TLS server name for SNI (Server Name Indication). - * - * @return The TLS server name - */ - public String getTlsServerName() { - return tlsServerName; - } - - /** - * Set TLS server name for SNI (Server Name Indication). This is used to verify the server - * certificate against a specific hostname instead of the hostname in the URL. - * - * @param tlsServerName The TLS server name to use for certificate verification - * @return ApiClient - */ - public ApiClient setTlsServerName(String tlsServerName) { - this.tlsServerName = tlsServerName; - applySslSettings(); - return this; - } - - /** - * Getter for the field dateFormat. - * - * @return a {@link java.text.DateFormat} object - */ - public DateFormat getDateFormat() { - return dateFormat; - } - - /** - * Setter for the field dateFormat. - * - * @param dateFormat a {@link java.text.DateFormat} object - * @return a {@link cloud.stackit.sdk.iaas.v2alpha1api.ApiClient} object - */ - public ApiClient setDateFormat(DateFormat dateFormat) { - JSON.setDateFormat(dateFormat); - return this; - } - - /** - * Set SqlDateFormat. - * - * @param dateFormat a {@link java.text.DateFormat} object - * @return a {@link cloud.stackit.sdk.iaas.v2alpha1api.ApiClient} object - */ - public ApiClient setSqlDateFormat(DateFormat dateFormat) { - JSON.setSqlDateFormat(dateFormat); - return this; - } - - /** - * Set OffsetDateTimeFormat. - * - * @param dateFormat a {@link java.time.format.DateTimeFormatter} object - * @return a {@link cloud.stackit.sdk.iaas.v2alpha1api.ApiClient} object - */ - public ApiClient setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { - JSON.setOffsetDateTimeFormat(dateFormat); - return this; - } - - /** - * Set LocalDateFormat. - * - * @param dateFormat a {@link java.time.format.DateTimeFormatter} object - * @return a {@link cloud.stackit.sdk.iaas.v2alpha1api.ApiClient} object - */ - public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) { - JSON.setLocalDateFormat(dateFormat); - return this; - } - - /** - * Set LenientOnJson. - * - * @param lenientOnJson a boolean - * @return a {@link cloud.stackit.sdk.iaas.v2alpha1api.ApiClient} object - */ - public ApiClient setLenientOnJson(boolean lenientOnJson) { - JSON.setLenientOnJson(lenientOnJson); - return this; - } - - /** - * Set the User-Agent header's value (by adding to the default header map). - * - * @param userAgent HTTP request's user agent - * @return ApiClient - */ - public ApiClient setUserAgent(String userAgent) { - addDefaultHeader("User-Agent", userAgent); - return this; - } - - /** - * Add a default header. - * - * @param key The header's key - * @param value The header's value - * @return ApiClient - */ - public ApiClient addDefaultHeader(String key, String value) { - defaultHeaderMap.put(key, value); - return this; - } - - /** - * Add a default cookie. - * - * @param key The cookie's key - * @param value The cookie's value - * @return ApiClient - */ - public ApiClient addDefaultCookie(String key, String value) { - defaultCookieMap.put(key, value); - return this; - } - - /** - * Check that whether debugging is enabled for this API client. - * - * @return True if debugging is enabled, false otherwise. - */ - public boolean isDebugging() { - return debugging; - } - - /** - * Enable/disable debugging for this API client. - * - * @param debugging To enable (true) or disable (false) debugging - * @return ApiClient - */ - public ApiClient setDebugging(boolean debugging) { - if (debugging != this.debugging) { - if (debugging) { - loggingInterceptor = new HttpLoggingInterceptor(); - loggingInterceptor.setLevel(Level.BODY); - httpClient = httpClient.newBuilder().addInterceptor(loggingInterceptor).build(); - } else { - final OkHttpClient.Builder builder = httpClient.newBuilder(); - builder.interceptors().remove(loggingInterceptor); - httpClient = builder.build(); - loggingInterceptor = null; - } - } - this.debugging = debugging; - return this; - } - - /** - * The path of temporary folder used to store downloaded files from endpoints with file - * response. The default value is null, i.e. using the system's default temporary - * folder. - * - * @see createTempFile - * @return Temporary folder path - */ - public String getTempFolderPath() { - return tempFolderPath; - } - - /** - * Set the temporary folder path (for downloading files) - * - * @param tempFolderPath Temporary folder path - * @return ApiClient - */ - public ApiClient setTempFolderPath(String tempFolderPath) { - this.tempFolderPath = tempFolderPath; - return this; - } - - /** - * Get connection timeout (in milliseconds). - * - * @return Timeout in milliseconds - */ - public int getConnectTimeout() { - return httpClient.connectTimeoutMillis(); - } - - /** - * Sets the connect timeout (in milliseconds). A value of 0 means no timeout, otherwise values - * must be between 1 and {@link java.lang.Integer#MAX_VALUE}. - * - * @param connectionTimeout connection timeout in milliseconds - * @return Api client - */ - public ApiClient setConnectTimeout(int connectionTimeout) { - httpClient = - httpClient - .newBuilder() - .connectTimeout(connectionTimeout, TimeUnit.MILLISECONDS) - .build(); - return this; - } - - /** - * Get read timeout (in milliseconds). - * - * @return Timeout in milliseconds - */ - public int getReadTimeout() { - return httpClient.readTimeoutMillis(); - } - - /** - * Sets the read timeout (in milliseconds). A value of 0 means no timeout, otherwise values must - * be between 1 and {@link java.lang.Integer#MAX_VALUE}. - * - * @param readTimeout read timeout in milliseconds - * @return Api client - */ - public ApiClient setReadTimeout(int readTimeout) { - httpClient = - httpClient.newBuilder().readTimeout(readTimeout, TimeUnit.MILLISECONDS).build(); - return this; - } - - /** - * Get write timeout (in milliseconds). - * - * @return Timeout in milliseconds - */ - public int getWriteTimeout() { - return httpClient.writeTimeoutMillis(); - } - - /** - * Sets the write timeout (in milliseconds). A value of 0 means no timeout, otherwise values - * must be between 1 and {@link java.lang.Integer#MAX_VALUE}. - * - * @param writeTimeout connection timeout in milliseconds - * @return Api client - */ - public ApiClient setWriteTimeout(int writeTimeout) { - httpClient = - httpClient.newBuilder().writeTimeout(writeTimeout, TimeUnit.MILLISECONDS).build(); - return this; - } - - /** - * Format the given parameter object into string. - * - * @param param Parameter - * @return String representation of the parameter - */ - public String parameterToString(Object param) { - if (param == null) { - return ""; - } else if (param instanceof Date - || param instanceof OffsetDateTime - || param instanceof LocalDate) { - // Serialize to json string and remove the " enclosing characters - String jsonStr = JSON.serialize(param); - return jsonStr.substring(1, jsonStr.length() - 1); - } else if (param instanceof Collection) { - StringBuilder b = new StringBuilder(); - for (Object o : (Collection) param) { - if (b.length() > 0) { - b.append(","); - } - b.append(o); - } - return b.toString(); - } else { - return String.valueOf(param); - } - } - - /** - * Formats the specified query parameter to a list containing a single {@code Pair} object. - * - *

Note that {@code value} must not be a collection. - * - * @param name The name of the parameter. - * @param value The value of the parameter. - * @return A list containing a single {@code Pair} object. - */ - public List parameterToPair(String name, Object value) { - List params = new ArrayList(); - - // preconditions - if (name == null || name.isEmpty() || value == null || value instanceof Collection) { - return params; - } - - params.add(new Pair(name, parameterToString(value))); - return params; - } - - /** - * Formats the specified collection query parameters to a list of {@code Pair} objects. - * - *

Note that the values of each of the returned Pair objects are percent-encoded. - * - * @param collectionFormat The collection format of the parameter. - * @param name The name of the parameter. - * @param value The value of the parameter. - * @return A list of {@code Pair} objects. - */ - public List parameterToPairs(String collectionFormat, String name, Collection value) { - List params = new ArrayList(); - - // preconditions - if (name == null || name.isEmpty() || value == null || value.isEmpty()) { - return params; - } - - // create the params based on the collection format - if ("multi".equals(collectionFormat)) { - for (Object item : value) { - params.add(new Pair(name, escapeString(parameterToString(item)))); - } - return params; - } - - // collectionFormat is assumed to be "csv" by default - String delimiter = ","; - - // escape all delimiters except commas, which are URI reserved - // characters - if ("ssv".equals(collectionFormat)) { - delimiter = escapeString(" "); - } else if ("tsv".equals(collectionFormat)) { - delimiter = escapeString("\t"); - } else if ("pipes".equals(collectionFormat)) { - delimiter = escapeString("|"); - } - - StringBuilder sb = new StringBuilder(); - for (Object item : value) { - sb.append(delimiter); - sb.append(escapeString(parameterToString(item))); - } - - params.add(new Pair(name, sb.substring(delimiter.length()))); - - return params; - } - - /** - * Formats the specified free-form query parameters to a list of {@code Pair} objects. - * - * @param value The free-form query parameters. - * @return A list of {@code Pair} objects. - */ - public List freeFormParameterToPairs(Object value) { - List params = new ArrayList<>(); - - // preconditions - if (value == null || !(value instanceof Map)) { - return params; - } - - @SuppressWarnings("unchecked") - final Map valuesMap = (Map) value; - - for (Map.Entry entry : valuesMap.entrySet()) { - params.add(new Pair(entry.getKey(), parameterToString(entry.getValue()))); - } - - return params; - } - - /** - * Formats the specified collection path parameter to a string value. - * - * @param collectionFormat The collection format of the parameter. - * @param value The value of the parameter. - * @return String representation of the parameter - */ - public String collectionPathParameterToString(String collectionFormat, Collection value) { - // create the value based on the collection format - if ("multi".equals(collectionFormat)) { - // not valid for path params - return parameterToString(value); - } - - // collectionFormat is assumed to be "csv" by default - String delimiter = ","; - - if ("ssv".equals(collectionFormat)) { - delimiter = " "; - } else if ("tsv".equals(collectionFormat)) { - delimiter = "\t"; - } else if ("pipes".equals(collectionFormat)) { - delimiter = "|"; - } - - StringBuilder sb = new StringBuilder(); - for (Object item : value) { - sb.append(delimiter); - sb.append(parameterToString(item)); - } - - return sb.substring(delimiter.length()); - } - - /** - * Sanitize filename by removing path. e.g. ../../sun.gif becomes sun.gif - * - * @param filename The filename to be sanitized - * @return The sanitized filename - */ - public String sanitizeFilename(String filename) { - return filename.replaceFirst("^.*[/\\\\]", ""); - } - - /** - * Check if the given MIME is a JSON MIME. JSON MIME examples: application/json - * application/json; charset=UTF8 APPLICATION/JSON application/vnd.company+json "* / *" is also - * default to JSON - * - * @param mime MIME (Multipurpose Internet Mail Extensions) - * @return True if the given MIME is JSON, false otherwise. - */ - public boolean isJsonMime(String mime) { - String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; - return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); - } - - /** - * Select the Accept header's value from the given accepts array: if JSON exists in the given - * array, use it; otherwise use all of them (joining into a string) - * - * @param accepts The accepts array to select from - * @return The Accept header to use. If the given array is empty, null will be returned (not to - * set the Accept header explicitly). - */ - public String selectHeaderAccept(String[] accepts) { - if (accepts.length == 0) { - return null; - } - for (String accept : accepts) { - if (isJsonMime(accept)) { - return accept; - } - } - return StringUtil.join(accepts, ","); - } - - /** - * Select the Content-Type header's value from the given array: if JSON exists in the given - * array, use it; otherwise use the first one of the array. - * - * @param contentTypes The Content-Type array to select from - * @return The Content-Type header to use. If the given array is empty, returns null. If it - * matches "any", JSON will be used. - */ - public String selectHeaderContentType(String[] contentTypes) { - if (contentTypes.length == 0) { - return null; - } - - if (contentTypes[0].equals("*/*")) { - return "application/json"; - } - - for (String contentType : contentTypes) { - if (isJsonMime(contentType)) { - return contentType; - } - } - - return contentTypes[0]; - } - - /** - * Escape the given string to be used as URL query value. - * - * @param str String to be escaped - * @return Escaped string - */ - public String escapeString(String str) { - try { - return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); - } catch (UnsupportedEncodingException e) { - return str; - } - } - - /** - * Deserialize response body to Java object, according to the return type and the Content-Type - * response header. - * - * @param Type - * @param response HTTP response - * @param returnType The type of the Java object - * @return The deserialized Java object - * @throws cloud.stackit.sdk.core.exception.ApiException If fail to deserialize response body, - * i.e. cannot read response body or the Content-Type of the response is not supported. - */ - @SuppressWarnings("unchecked") - public T deserialize(Response response, Type returnType) throws ApiException { - if (response == null || returnType == null) { - return null; - } - - if ("byte[]".equals(returnType.toString())) { - // Handle binary response (byte array). - try { - return (T) response.body().bytes(); - } catch (IOException e) { - throw new ApiException(e); - } - } else if (returnType.equals(File.class)) { - // Handle file downloading. - return (T) downloadFileFromResponse(response); - } - - ResponseBody respBody = response.body(); - if (respBody == null) { - return null; - } - - String contentType = response.headers().get("Content-Type"); - if (contentType == null) { - // ensuring a default content type - contentType = "application/json"; - } - try { - if (isJsonMime(contentType)) { - if (returnType.equals(String.class)) { - String respBodyString = respBody.string(); - if (respBodyString.isEmpty()) { - return null; - } - // Use String-based deserialize for String return type with fallback - return JSON.deserialize(respBodyString, returnType); - } else { - // Use InputStream-based deserialize which supports responses > 2GB - return JSON.deserialize(respBody.byteStream(), returnType); - } - } else if (returnType.equals(String.class)) { - String respBodyString = respBody.string(); - if (respBodyString.isEmpty()) { - return null; - } - // Expecting string, return the raw response body. - return (T) respBodyString; - } else { - throw new ApiException( - "Content type \"" - + contentType - + "\" is not supported for type: " - + returnType, - response.code(), - response.headers().toMultimap(), - response.body().string()); - } - } catch (IOException e) { - throw new ApiException(e); - } - } - - /** - * Serialize the given Java object into request body according to the object's class and the - * request Content-Type. - * - * @param obj The Java object - * @param contentType The request Content-Type - * @return The serialized request body - * @throws cloud.stackit.sdk.core.exception.ApiException If fail to serialize the given object - */ - public RequestBody serialize(Object obj, String contentType) throws ApiException { - if (obj instanceof byte[]) { - // Binary (byte array) body parameter support. - return RequestBody.create((byte[]) obj, MediaType.parse(contentType)); - } else if (obj instanceof File) { - // File body parameter support. - return RequestBody.create((File) obj, MediaType.parse(contentType)); - } else if ("text/plain".equals(contentType) && obj instanceof String) { - return RequestBody.create((String) obj, MediaType.parse(contentType)); - } else if (isJsonMime(contentType)) { - String content; - if (obj != null) { - content = JSON.serialize(obj); - } else { - content = null; - } - return RequestBody.create(content, MediaType.parse(contentType)); - } else if (obj instanceof String) { - return RequestBody.create((String) obj, MediaType.parse(contentType)); - } else { - throw new ApiException("Content type \"" + contentType + "\" is not supported"); - } - } - - /** - * Download file from the given response. - * - * @param response An instance of the Response object - * @throws cloud.stackit.sdk.core.exception.ApiException If fail to read file content from - * response and write to disk - * @return Downloaded file - */ - public File downloadFileFromResponse(Response response) throws ApiException { - try { - File file = prepareDownloadFile(response); - BufferedSink sink = Okio.buffer(Okio.sink(file)); - sink.writeAll(response.body().source()); - sink.close(); - return file; - } catch (IOException e) { - throw new ApiException(e); - } - } - - /** - * Prepare file for download - * - * @param response An instance of the Response object - * @return Prepared file for the download - * @throws java.io.IOException If fail to prepare file for download - */ - public File prepareDownloadFile(Response response) throws IOException { - String filename = null; - String contentDisposition = response.header("Content-Disposition"); - if (contentDisposition != null && !"".equals(contentDisposition)) { - // Get filename from the Content-Disposition header. - Pattern pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); - Matcher matcher = pattern.matcher(contentDisposition); - if (matcher.find()) { - filename = sanitizeFilename(matcher.group(1)); - } - } - - String prefix = null; - String suffix = null; - if (filename == null) { - prefix = "download-"; - suffix = ""; - } else { - int pos = filename.lastIndexOf("."); - if (pos == -1) { - prefix = filename + "-"; - } else { - prefix = filename.substring(0, pos) + "-"; - suffix = filename.substring(pos); - } - // Files.createTempFile requires the prefix to be at least three characters long - if (prefix.length() < 3) prefix = "download-"; - } - - if (tempFolderPath == null) return Files.createTempFile(prefix, suffix).toFile(); - else return Files.createTempFile(Paths.get(tempFolderPath), prefix, suffix).toFile(); - } - - /** - * {@link #execute(Call, Type)} - * - * @param Type - * @param call An instance of the Call object - * @return ApiResponse<T> - * @throws cloud.stackit.sdk.core.exception.ApiException If fail to execute the call - */ - public ApiResponse execute(Call call) throws ApiException { - return execute(call, null); - } - - /** - * Execute HTTP call and deserialize the HTTP response body into the given return type. - * - * @param returnType The return type used to deserialize HTTP response body - * @param The return type corresponding to (same with) returnType - * @param call Call - * @return ApiResponse object containing response status, headers and data, which is a Java - * object deserialized from response body and would be null when returnType is null. - * @throws cloud.stackit.sdk.core.exception.ApiException If fail to execute the call - */ - public ApiResponse execute(Call call, Type returnType) throws ApiException { - try { - Response response = call.execute(); - T data = handleResponse(response, returnType); - return new ApiResponse(response.code(), response.headers().toMultimap(), data); - } catch (IOException e) { - throw new ApiException(e); - } - } - - /** - * {@link #executeAsync(Call, Type, ApiCallback)} - * - * @param Type - * @param call An instance of the Call object - * @param callback ApiCallback<T> - */ - public void executeAsync(Call call, ApiCallback callback) { - executeAsync(call, null, callback); - } - - /** - * Execute HTTP call asynchronously. - * - * @param Type - * @param call The callback to be executed when the API call finishes - * @param returnType Return type - * @param callback ApiCallback - * @see #execute(Call, Type) - */ - @SuppressWarnings("unchecked") - public void executeAsync(Call call, final Type returnType, final ApiCallback callback) { - call.enqueue( - new Callback() { - @Override - public void onFailure(Call call, IOException e) { - callback.onFailure(new ApiException(e), 0, null); - } - - @Override - public void onResponse(Call call, Response response) throws IOException { - T result; - try { - result = (T) handleResponse(response, returnType); - } catch (ApiException e) { - callback.onFailure(e, response.code(), response.headers().toMultimap()); - return; - } catch (Exception e) { - callback.onFailure( - new ApiException(e), - response.code(), - response.headers().toMultimap()); - return; - } - callback.onSuccess( - result, response.code(), response.headers().toMultimap()); - } - }); - } - - /** - * Handle the given response, return the deserialized object when the response is successful. - * - * @param Type - * @param response Response - * @param returnType Return type - * @return Type - * @throws cloud.stackit.sdk.core.exception.ApiException If the response has an unsuccessful - * status code or fail to deserialize the response body - */ - public T handleResponse(Response response, Type returnType) throws ApiException { - if (response.isSuccessful()) { - if (returnType == null || response.code() == 204) { - // returning null if the returnType is not defined, - // or the status code is 204 (No Content) - if (response.body() != null) { - try { - response.body().close(); - } catch (Exception e) { - throw new ApiException( - response.message(), - e, - response.code(), - response.headers().toMultimap()); - } - } - return null; - } else { - return deserialize(response, returnType); - } - } else { - String respBody = null; - if (response.body() != null) { - try { - respBody = response.body().string(); - } catch (IOException e) { - throw new ApiException( - response.message(), - e, - response.code(), - response.headers().toMultimap()); - } - } - throw new ApiException( - response.message(), response.code(), response.headers().toMultimap(), respBody); - } - } - - /** - * Build HTTP call with the given options. - * - * @param baseUrl The base URL - * @param path The sub-path of the HTTP URL - * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and - * "DELETE" - * @param queryParams The query parameters - * @param collectionQueryParams The collection query parameters - * @param body The request body object - * @param headerParams The header parameters - * @param cookieParams The cookie parameters - * @param formParams The form parameters - * @param authNames The authentications to apply - * @param callback Callback for upload/download progress - * @return The HTTP call - * @throws cloud.stackit.sdk.core.exception.ApiException If fail to serialize the request body - * object - */ - public Call buildCall( - String baseUrl, - String path, - String method, - List queryParams, - List collectionQueryParams, - Object body, - Map headerParams, - Map cookieParams, - Map formParams, - String[] authNames, - ApiCallback callback) - throws ApiException { - Request request = - buildRequest( - baseUrl, - path, - method, - queryParams, - collectionQueryParams, - body, - headerParams, - cookieParams, - formParams, - authNames, - callback); - - return httpClient.newCall(request); - } - - /** - * Build an HTTP request with the given options. - * - * @param baseUrl The base URL - * @param path The sub-path of the HTTP URL - * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and - * "DELETE" - * @param queryParams The query parameters - * @param collectionQueryParams The collection query parameters - * @param body The request body object - * @param headerParams The header parameters - * @param cookieParams The cookie parameters - * @param formParams The form parameters - * @param authNames The authentications to apply - * @param callback Callback for upload/download progress - * @return The HTTP request - * @throws cloud.stackit.sdk.core.exception.ApiException If fail to serialize the request body - * object - */ - public Request buildRequest( - String baseUrl, - String path, - String method, - List queryParams, - List collectionQueryParams, - Object body, - Map headerParams, - Map cookieParams, - Map formParams, - String[] authNames, - ApiCallback callback) - throws ApiException { - final String url = buildUrl(baseUrl, path, queryParams, collectionQueryParams); - - // prepare HTTP request body - RequestBody reqBody; - String contentType = headerParams.get("Content-Type"); - String contentTypePure = contentType; - if (contentTypePure != null && contentTypePure.contains(";")) { - contentTypePure = contentType.substring(0, contentType.indexOf(";")); - } - if (!HttpMethod.permitsRequestBody(method)) { - reqBody = null; - } else if ("application/x-www-form-urlencoded".equals(contentTypePure)) { - reqBody = buildRequestBodyFormEncoding(formParams); - } else if ("multipart/form-data".equals(contentTypePure)) { - reqBody = buildRequestBodyMultipart(formParams); - } else if (body == null) { - if ("DELETE".equals(method)) { - // allow calling DELETE without sending a request body - reqBody = null; - } else { - // use an empty request body (for POST, PUT and PATCH) - reqBody = - RequestBody.create( - "", contentType == null ? null : MediaType.parse(contentType)); - } - } else { - reqBody = serialize(body, contentType); - } - - List updatedQueryParams = new ArrayList<>(queryParams); - - final Request.Builder reqBuilder = - new Request.Builder() - .url(buildUrl(baseUrl, path, updatedQueryParams, collectionQueryParams)); - processHeaderParams(headerParams, reqBuilder); - processCookieParams(cookieParams, reqBuilder); - - // Associate callback with request (if not null) so interceptor can - // access it when creating ProgressResponseBody - reqBuilder.tag(callback); - - Request request = null; - - if (callback != null && reqBody != null) { - ProgressRequestBody progressRequestBody = new ProgressRequestBody(reqBody, callback); - request = reqBuilder.method(method, progressRequestBody).build(); - } else { - request = reqBuilder.method(method, reqBody).build(); - } - - return request; - } - - /** - * Build full URL by concatenating base path, the given sub path and query parameters. - * - * @param baseUrl The base URL - * @param path The sub path - * @param queryParams The query parameters - * @param collectionQueryParams The collection query parameters - * @return The full URL - */ - public String buildUrl( - String baseUrl, String path, List queryParams, List collectionQueryParams) { - final StringBuilder url = new StringBuilder(); - if (baseUrl != null) { - url.append(baseUrl).append(path); - } else { - String baseURL; - if (serverIndex != null) { - if (serverIndex < 0 || serverIndex >= servers.size()) { - throw new ArrayIndexOutOfBoundsException( - String.format( - java.util.Locale.ROOT, - "Invalid index %d when selecting the host settings. Must be less than %d", - serverIndex, - servers.size())); - } - baseURL = servers.get(serverIndex).URL(serverVariables); - } else { - baseURL = basePath; - } - url.append(baseURL).append(path); - } - - if (queryParams != null && !queryParams.isEmpty()) { - // support (constant) query string in `path`, e.g. "/posts?draft=1" - String prefix = path.contains("?") ? "&" : "?"; - for (Pair param : queryParams) { - if (param.getValue() != null) { - if (prefix != null) { - url.append(prefix); - prefix = null; - } else { - url.append("&"); - } - String value = parameterToString(param.getValue()); - url.append(escapeString(param.getName())) - .append("=") - .append(escapeString(value)); - } - } - } - - if (collectionQueryParams != null && !collectionQueryParams.isEmpty()) { - String prefix = url.toString().contains("?") ? "&" : "?"; - for (Pair param : collectionQueryParams) { - if (param.getValue() != null) { - if (prefix != null) { - url.append(prefix); - prefix = null; - } else { - url.append("&"); - } - String value = parameterToString(param.getValue()); - // collection query parameter value already escaped as part of parameterToPairs - url.append(escapeString(param.getName())).append("=").append(value); - } - } - } - - return url.toString(); - } - - /** - * Set header parameters to the request builder, including default headers. - * - * @param headerParams Header parameters in the form of Map - * @param reqBuilder Request.Builder - */ - public void processHeaderParams(Map headerParams, Request.Builder reqBuilder) { - for (Entry param : headerParams.entrySet()) { - reqBuilder.header(param.getKey(), parameterToString(param.getValue())); - } - for (Entry header : defaultHeaderMap.entrySet()) { - if (!headerParams.containsKey(header.getKey())) { - reqBuilder.header(header.getKey(), parameterToString(header.getValue())); - } - } - } - - /** - * Set cookie parameters to the request builder, including default cookies. - * - * @param cookieParams Cookie parameters in the form of Map - * @param reqBuilder Request.Builder - */ - public void processCookieParams(Map cookieParams, Request.Builder reqBuilder) { - for (Entry param : cookieParams.entrySet()) { - reqBuilder.addHeader( - "Cookie", - String.format( - java.util.Locale.ROOT, "%s=%s", param.getKey(), param.getValue())); - } - for (Entry param : defaultCookieMap.entrySet()) { - if (!cookieParams.containsKey(param.getKey())) { - reqBuilder.addHeader( - "Cookie", - String.format( - java.util.Locale.ROOT, "%s=%s", param.getKey(), param.getValue())); - } - } - } - - /** - * Build a form-encoding request body with the given form parameters. - * - * @param formParams Form parameters in the form of Map - * @return RequestBody - */ - public RequestBody buildRequestBodyFormEncoding(Map formParams) { - okhttp3.FormBody.Builder formBuilder = new okhttp3.FormBody.Builder(); - for (Entry param : formParams.entrySet()) { - formBuilder.add(param.getKey(), parameterToString(param.getValue())); - } - return formBuilder.build(); - } - - /** - * Build a multipart (file uploading) request body with the given form parameters, which could - * contain text fields and file fields. - * - * @param formParams Form parameters in the form of Map - * @return RequestBody - */ - public RequestBody buildRequestBodyMultipart(Map formParams) { - MultipartBody.Builder mpBuilder = new MultipartBody.Builder().setType(MultipartBody.FORM); - for (Entry param : formParams.entrySet()) { - if (param.getValue() instanceof File) { - File file = (File) param.getValue(); - addPartToMultiPartBuilder(mpBuilder, param.getKey(), file); - } else if (param.getValue() instanceof List) { - List list = (List) param.getValue(); - for (Object item : list) { - if (item instanceof File) { - addPartToMultiPartBuilder(mpBuilder, param.getKey(), (File) item); - } else { - addPartToMultiPartBuilder(mpBuilder, param.getKey(), param.getValue()); - } - } - } else { - addPartToMultiPartBuilder(mpBuilder, param.getKey(), param.getValue()); - } - } - return mpBuilder.build(); - } - - /** - * Guess Content-Type header from the given file (defaults to "application/octet-stream"). - * - * @param file The given file - * @return The guessed Content-Type - */ - public String guessContentTypeFromFile(File file) { - String contentType = URLConnection.guessContentTypeFromName(file.getName()); - if (contentType == null) { - return "application/octet-stream"; - } else { - return contentType; - } - } - - /** - * Add a Content-Disposition Header for the given key and file to the MultipartBody Builder. - * - * @param mpBuilder MultipartBody.Builder - * @param key The key of the Header element - * @param file The file to add to the Header - */ - protected void addPartToMultiPartBuilder( - MultipartBody.Builder mpBuilder, String key, File file) { - Headers partHeaders = - Headers.of( - "Content-Disposition", - "form-data; name=\"" + key + "\"; filename=\"" + file.getName() + "\""); - MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); - mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType)); - } - - /** - * Add a Content-Disposition Header for the given key and complex object to the MultipartBody - * Builder. - * - * @param mpBuilder MultipartBody.Builder - * @param key The key of the Header element - * @param obj The complex object to add to the Header - */ - protected void addPartToMultiPartBuilder( - MultipartBody.Builder mpBuilder, String key, Object obj) { - RequestBody requestBody; - if (obj instanceof String) { - requestBody = RequestBody.create((String) obj, MediaType.parse("text/plain")); - } else { - String content; - if (obj != null) { - content = JSON.serialize(obj); - } else { - content = null; - } - requestBody = RequestBody.create(content, MediaType.parse("application/json")); - } - - Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\""); - mpBuilder.addPart(partHeaders, requestBody); - } - - /** - * Get network interceptor to add it to the httpClient to track download progress for async - * requests. - */ - protected Interceptor getProgressInterceptor() { - return new Interceptor() { - @Override - public Response intercept(Interceptor.Chain chain) throws IOException { - final Request request = chain.request(); - final Response originalResponse = chain.proceed(request); - if (request.tag() instanceof ApiCallback) { - final ApiCallback callback = (ApiCallback) request.tag(); - return originalResponse - .newBuilder() - .body(new ProgressResponseBody(originalResponse.body(), callback)) - .build(); - } - return originalResponse; - } - }; - } - - /** - * Apply SSL related settings to httpClient according to the current values of verifyingSsl and - * sslCaCert. - */ - protected void applySslSettings() { - try { - TrustManager[] trustManagers; - HostnameVerifier hostnameVerifier; - if (!verifyingSsl) { - trustManagers = - new TrustManager[] { - new X509TrustManager() { - @Override - public void checkClientTrusted( - java.security.cert.X509Certificate[] chain, String authType) - throws CertificateException {} - - @Override - public void checkServerTrusted( - java.security.cert.X509Certificate[] chain, String authType) - throws CertificateException {} - - @Override - public java.security.cert.X509Certificate[] getAcceptedIssuers() { - return new java.security.cert.X509Certificate[] {}; - } - } - }; - hostnameVerifier = - new HostnameVerifier() { - @Override - public boolean verify(String hostname, SSLSession session) { - return true; - } - }; - } else { - TrustManagerFactory trustManagerFactory = - TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); - - if (sslCaCert == null) { - trustManagerFactory.init((KeyStore) null); - } else { - char[] password = null; // Any password will work. - CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509"); - Collection certificates = - certificateFactory.generateCertificates(sslCaCert); - if (certificates.isEmpty()) { - throw new IllegalArgumentException( - "expected non-empty set of trusted certificates"); - } - KeyStore caKeyStore = newEmptyKeyStore(password); - int index = 0; - for (Certificate certificate : certificates) { - String certificateAlias = "ca" + (index++); - caKeyStore.setCertificateEntry(certificateAlias, certificate); - } - trustManagerFactory.init(caKeyStore); - } - trustManagers = trustManagerFactory.getTrustManagers(); - if (tlsServerName != null && !tlsServerName.isEmpty()) { - hostnameVerifier = - new HostnameVerifier() { - @Override - public boolean verify(String hostname, SSLSession session) { - // Verify the certificate against tlsServerName instead of the - // actual hostname - return OkHostnameVerifier.INSTANCE.verify( - tlsServerName, session); - } - }; - } else { - hostnameVerifier = OkHostnameVerifier.INSTANCE; - } - } - - SSLContext sslContext = SSLContext.getInstance("TLS"); - sslContext.init(keyManagers, trustManagers, new SecureRandom()); - httpClient = - httpClient - .newBuilder() - .sslSocketFactory( - sslContext.getSocketFactory(), - (X509TrustManager) trustManagers[0]) - .hostnameVerifier(hostnameVerifier) - .build(); - } catch (GeneralSecurityException e) { - throw new RuntimeException(e); - } - } - - protected KeyStore newEmptyKeyStore(char[] password) throws GeneralSecurityException { - try { - KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); - keyStore.load(null, password); - return keyStore; - } catch (IOException e) { - throw new AssertionError(e); - } - } - - /** - * Convert the HTTP request body to a string. - * - * @param requestBody The HTTP request object - * @return The string representation of the HTTP request body - * @throws cloud.stackit.sdk.core.exception.ApiException If fail to serialize the request body - * object into a string - */ - protected String requestBodyToString(RequestBody requestBody) throws ApiException { - if (requestBody != null) { - try { - final Buffer buffer = new Buffer(); - requestBody.writeTo(buffer); - return buffer.readUtf8(); - } catch (final IOException e) { - throw new ApiException(e); - } - } - - // empty http request body - return ""; - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/ApiResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/ApiResponse.java deleted file mode 100644 index b05ee68f..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/ApiResponse.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api; - -import java.util.List; -import java.util.Map; - -/** API response returned by API call. */ -public class ApiResponse { - private final int statusCode; - private final Map> headers; - private final T data; - - /** - * Constructor for ApiResponse. - * - * @param statusCode The status code of HTTP response - * @param headers The headers of HTTP response - */ - public ApiResponse(int statusCode, Map> headers) { - this(statusCode, headers, null); - } - - /** - * Constructor for ApiResponse. - * - * @param statusCode The status code of HTTP response - * @param headers The headers of HTTP response - * @param data The object deserialized from response bod - */ - public ApiResponse(int statusCode, Map> headers, T data) { - this.statusCode = statusCode; - this.headers = headers; - this.data = data; - } - - /** - * Get the status code. - * - * @return the status code - */ - public int getStatusCode() { - return statusCode; - } - - /** - * Get the headers. - * - * @return a {@link java.util.Map} of headers - */ - public Map> getHeaders() { - return headers; - } - - /** - * Get the data. - * - * @return the data - */ - public T getData() { - return data; - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/GzipRequestInterceptor.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/GzipRequestInterceptor.java deleted file mode 100644 index d5e0fd5a..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/GzipRequestInterceptor.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api; - -import java.io.IOException; -import okhttp3.*; -import okio.Buffer; -import okio.BufferedSink; -import okio.GzipSink; -import okio.Okio; - -/** - * Encodes request bodies using gzip. - * - *

Taken from https://github.com/square/okhttp/issues/350 - */ -class GzipRequestInterceptor implements Interceptor { - @Override - public Response intercept(Chain chain) throws IOException { - Request originalRequest = chain.request(); - if (originalRequest.body() == null || originalRequest.header("Content-Encoding") != null) { - return chain.proceed(originalRequest); - } - - Request compressedRequest = - originalRequest - .newBuilder() - .header("Content-Encoding", "gzip") - .method( - originalRequest.method(), - forceContentLength(gzip(originalRequest.body()))) - .build(); - return chain.proceed(compressedRequest); - } - - private RequestBody forceContentLength(final RequestBody requestBody) throws IOException { - final Buffer buffer = new Buffer(); - requestBody.writeTo(buffer); - return new RequestBody() { - @Override - public MediaType contentType() { - return requestBody.contentType(); - } - - @Override - public long contentLength() { - return buffer.size(); - } - - @Override - public void writeTo(BufferedSink sink) throws IOException { - sink.write(buffer.snapshot()); - } - }; - } - - private RequestBody gzip(final RequestBody body) { - return new RequestBody() { - @Override - public MediaType contentType() { - return body.contentType(); - } - - @Override - public long contentLength() { - return -1; // We don't know the compressed length in advance! - } - - @Override - public void writeTo(BufferedSink sink) throws IOException { - BufferedSink gzipSink = Okio.buffer(new GzipSink(sink)); - body.writeTo(gzipSink); - gzipSink.close(); - } - }; - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/JSON.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/JSON.java deleted file mode 100644 index 7c6958c0..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/JSON.java +++ /dev/null @@ -1,884 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonElement; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapter; -import com.google.gson.internal.bind.util.ISO8601Utils; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.gsonfire.GsonFireBuilder; -import io.gsonfire.TypeSelector; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.StringReader; -import java.lang.reflect.Type; -import java.nio.charset.StandardCharsets; -import java.text.DateFormat; -import java.text.ParseException; -import java.text.ParsePosition; -import java.time.LocalDate; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.util.Date; -import java.util.HashMap; -import java.util.Map; -import okio.ByteString; - -/* - * A JSON utility class - * - * NOTE: in the future, this class may be converted to static, which may break - * backward-compatibility - */ -public class JSON { - private static Gson gson; - private static boolean isLenientOnJson = false; - private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); - private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); - private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = - new OffsetDateTimeTypeAdapter(); - private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); - private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); - - @SuppressWarnings("unchecked") - public static GsonBuilder createGson() { - GsonFireBuilder fireBuilder = - new GsonFireBuilder() - .registerTypeSelector( - cloud.stackit.sdk.iaas.v2alpha1api.model - .AddVPCStaticRoutePayloadDestination.class, - new TypeSelector< - cloud.stackit.sdk.iaas.v2alpha1api.model - .AddVPCStaticRoutePayloadDestination>() { - @Override - public Class< - ? extends - cloud.stackit.sdk.iaas.v2alpha1api.model - .AddVPCStaticRoutePayloadDestination> - getClassForElement(JsonElement readElement) { - Map classByDiscriminatorValue = - new HashMap(); - classByDiscriminatorValue.put( - "cidrv4", - cloud.stackit.sdk.iaas.v2alpha1api.model - .DestinationCIDRv4.class); - classByDiscriminatorValue.put( - "cidrv6", - cloud.stackit.sdk.iaas.v2alpha1api.model - .DestinationCIDRv6.class); - classByDiscriminatorValue.put( - "AddVPCStaticRoutePayload_destination", - cloud.stackit.sdk.iaas.v2alpha1api.model - .AddVPCStaticRoutePayloadDestination.class); - return getClassByDiscriminator( - classByDiscriminatorValue, - getDiscriminatorValue(readElement, "type")); - } - }) - .registerTypeSelector( - cloud.stackit.sdk.iaas.v2alpha1api.model - .AddVPCStaticRoutePayloadNexthop.class, - new TypeSelector< - cloud.stackit.sdk.iaas.v2alpha1api.model - .AddVPCStaticRoutePayloadNexthop>() { - @Override - public Class< - ? extends - cloud.stackit.sdk.iaas.v2alpha1api.model - .AddVPCStaticRoutePayloadNexthop> - getClassForElement(JsonElement readElement) { - Map classByDiscriminatorValue = - new HashMap(); - classByDiscriminatorValue.put( - "blackhole", - cloud.stackit.sdk.iaas.v2alpha1api.model - .NexthopBlackhole.class); - classByDiscriminatorValue.put( - "internet", - cloud.stackit.sdk.iaas.v2alpha1api.model - .NexthopInternet.class); - classByDiscriminatorValue.put( - "ipv4", - cloud.stackit.sdk.iaas.v2alpha1api.model.NexthopIPv4 - .class); - classByDiscriminatorValue.put( - "ipv6", - cloud.stackit.sdk.iaas.v2alpha1api.model.NexthopIPv6 - .class); - classByDiscriminatorValue.put( - "AddVPCStaticRoutePayload_nexthop", - cloud.stackit.sdk.iaas.v2alpha1api.model - .AddVPCStaticRoutePayloadNexthop.class); - return getClassByDiscriminator( - classByDiscriminatorValue, - getDiscriminatorValue(readElement, "type")); - } - }) - .registerTypeSelector( - cloud.stackit.sdk.iaas.v2alpha1api.model.AnyRoute.class, - new TypeSelector< - cloud.stackit.sdk.iaas.v2alpha1api.model.AnyRoute>() { - @Override - public Class< - ? extends - cloud.stackit.sdk.iaas.v2alpha1api.model - .AnyRoute> - getClassForElement(JsonElement readElement) { - Map classByDiscriminatorValue = - new HashMap(); - classByDiscriminatorValue.put( - "dynamic", - cloud.stackit.sdk.iaas.v2alpha1api.model - .AnyRouteDynamic.class); - classByDiscriminatorValue.put( - "service", - cloud.stackit.sdk.iaas.v2alpha1api.model - .AnyRouteService.class); - classByDiscriminatorValue.put( - "static", - cloud.stackit.sdk.iaas.v2alpha1api.model - .AnyRouteStatic.class); - classByDiscriminatorValue.put( - "system", - cloud.stackit.sdk.iaas.v2alpha1api.model - .AnyRouteSystem.class); - classByDiscriminatorValue.put( - "AnyRoute", - cloud.stackit.sdk.iaas.v2alpha1api.model.AnyRoute - .class); - return getClassByDiscriminator( - classByDiscriminatorValue, - getDiscriminatorValue(readElement, "type")); - } - }) - .registerTypeSelector( - cloud.stackit.sdk.iaas.v2alpha1api.model - .CreateVPCNetworkRangePayload.class, - new TypeSelector< - cloud.stackit.sdk.iaas.v2alpha1api.model - .CreateVPCNetworkRangePayload>() { - @Override - public Class< - ? extends - cloud.stackit.sdk.iaas.v2alpha1api.model - .CreateVPCNetworkRangePayload> - getClassForElement(JsonElement readElement) { - Map classByDiscriminatorValue = - new HashMap(); - classByDiscriminatorValue.put( - "ipv4", - cloud.stackit.sdk.iaas.v2alpha1api.model - .NetworkRangeIPv4Request.class); - classByDiscriminatorValue.put( - "CreateVPCNetworkRangePayload", - cloud.stackit.sdk.iaas.v2alpha1api.model - .CreateVPCNetworkRangePayload.class); - return getClassByDiscriminator( - classByDiscriminatorValue, - getDiscriminatorValue(readElement, "ipVersion")); - } - }) - .registerTypeSelector( - cloud.stackit.sdk.iaas.v2alpha1api.model.RouteDestination.class, - new TypeSelector< - cloud.stackit.sdk.iaas.v2alpha1api.model - .RouteDestination>() { - @Override - public Class< - ? extends - cloud.stackit.sdk.iaas.v2alpha1api.model - .RouteDestination> - getClassForElement(JsonElement readElement) { - Map classByDiscriminatorValue = - new HashMap(); - classByDiscriminatorValue.put( - "cidrv4", - cloud.stackit.sdk.iaas.v2alpha1api.model - .DestinationCIDRv4.class); - classByDiscriminatorValue.put( - "cidrv6", - cloud.stackit.sdk.iaas.v2alpha1api.model - .DestinationCIDRv6.class); - classByDiscriminatorValue.put( - "Route_destination", - cloud.stackit.sdk.iaas.v2alpha1api.model - .RouteDestination.class); - return getClassByDiscriminator( - classByDiscriminatorValue, - getDiscriminatorValue(readElement, "type")); - } - }) - .registerTypeSelector( - cloud.stackit.sdk.iaas.v2alpha1api.model.RouteNexthop.class, - new TypeSelector< - cloud.stackit.sdk.iaas.v2alpha1api.model.RouteNexthop>() { - @Override - public Class< - ? extends - cloud.stackit.sdk.iaas.v2alpha1api.model - .RouteNexthop> - getClassForElement(JsonElement readElement) { - Map classByDiscriminatorValue = - new HashMap(); - classByDiscriminatorValue.put( - "blackhole", - cloud.stackit.sdk.iaas.v2alpha1api.model - .NexthopBlackhole.class); - classByDiscriminatorValue.put( - "internet", - cloud.stackit.sdk.iaas.v2alpha1api.model - .NexthopInternet.class); - classByDiscriminatorValue.put( - "ipv4", - cloud.stackit.sdk.iaas.v2alpha1api.model.NexthopIPv4 - .class); - classByDiscriminatorValue.put( - "ipv6", - cloud.stackit.sdk.iaas.v2alpha1api.model.NexthopIPv6 - .class); - classByDiscriminatorValue.put( - "Route_nexthop", - cloud.stackit.sdk.iaas.v2alpha1api.model - .RouteNexthop.class); - return getClassByDiscriminator( - classByDiscriminatorValue, - getDiscriminatorValue(readElement, "type")); - } - }) - .registerTypeSelector( - cloud.stackit.sdk.iaas.v2alpha1api.model - .UpdateVPCNetworkRangePayload.class, - new TypeSelector< - cloud.stackit.sdk.iaas.v2alpha1api.model - .UpdateVPCNetworkRangePayload>() { - @Override - public Class< - ? extends - cloud.stackit.sdk.iaas.v2alpha1api.model - .UpdateVPCNetworkRangePayload> - getClassForElement(JsonElement readElement) { - Map classByDiscriminatorValue = - new HashMap(); - classByDiscriminatorValue.put( - "ipv4", - cloud.stackit.sdk.iaas.v2alpha1api.model - .V1UpdateVPCNetworkRangeIPv4.class); - classByDiscriminatorValue.put( - "UpdateVPCNetworkRangePayload", - cloud.stackit.sdk.iaas.v2alpha1api.model - .UpdateVPCNetworkRangePayload.class); - return getClassByDiscriminator( - classByDiscriminatorValue, - getDiscriminatorValue(readElement, "ipVersion")); - } - }) - .registerTypeSelector( - cloud.stackit.sdk.iaas.v2alpha1api.model.VPCNetworkRange.class, - new TypeSelector< - cloud.stackit.sdk.iaas.v2alpha1api.model - .VPCNetworkRange>() { - @Override - public Class< - ? extends - cloud.stackit.sdk.iaas.v2alpha1api.model - .VPCNetworkRange> - getClassForElement(JsonElement readElement) { - Map classByDiscriminatorValue = - new HashMap(); - classByDiscriminatorValue.put( - "ipv4", - cloud.stackit.sdk.iaas.v2alpha1api.model - .VPCNetworkRangeIPv4.class); - classByDiscriminatorValue.put( - "ipv6", - cloud.stackit.sdk.iaas.v2alpha1api.model - .VPCNetworkRangeIPv6.class); - classByDiscriminatorValue.put( - "VPCNetworkRange", - cloud.stackit.sdk.iaas.v2alpha1api.model - .VPCNetworkRange.class); - return getClassByDiscriminator( - classByDiscriminatorValue, - getDiscriminatorValue(readElement, "ipVersion")); - } - }); - GsonBuilder builder = fireBuilder.createGsonBuilder(); - return builder; - } - - private static String getDiscriminatorValue( - JsonElement readElement, String discriminatorField) { - JsonElement element = readElement.getAsJsonObject().get(discriminatorField); - if (null == element) { - throw new IllegalArgumentException( - "missing discriminator field: <" + discriminatorField + ">"); - } - return element.getAsString(); - } - - /** - * Returns the Java class that implements the OpenAPI schema for the specified discriminator - * value. - * - * @param classByDiscriminatorValue The map of discriminator values to Java classes. - * @param discriminatorValue The value of the OpenAPI discriminator in the input data. - * @return The Java class that implements the OpenAPI schema - */ - private static Class getClassByDiscriminator( - Map classByDiscriminatorValue, String discriminatorValue) { - Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); - if (null == clazz) { - throw new IllegalArgumentException( - "cannot determine model class of name: <" + discriminatorValue + ">"); - } - return clazz; - } - - static { - GsonBuilder gsonBuilder = createGson(); - gsonBuilder.registerTypeAdapter(Date.class, dateTypeAdapter); - gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter); - gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); - gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); - gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.v2alpha1api.model.AddRoutesToRoutingTablePayload - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.v2alpha1api.model.AddRoutingTableToAreaPayload - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.v2alpha1api.model.AddVPCRoutingTablePayload - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.v2alpha1api.model.AddVPCStaticRoutePayload - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.v2alpha1api.model.AddVPCStaticRoutePayloadDestination - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.v2alpha1api.model.AddVPCStaticRoutePayloadNexthop - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.v2alpha1api.model.AllRouteListResponse - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.v2alpha1api.model.AnyRoute.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.v2alpha1api.model.AnyRouteDynamic - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.v2alpha1api.model.AnyRouteService - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.v2alpha1api.model.AnyRouteSource - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.v2alpha1api.model.AnyRouteSourceId - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.v2alpha1api.model.AnyRouteStatic - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.v2alpha1api.model.AnyRouteSystem - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.v2alpha1api.model.BaseRoute.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.v2alpha1api.model.CreateNetworkIPv4 - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.v2alpha1api.model.CreateNetworkIPv4WithPrefix - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.v2alpha1api.model.CreateNetworkIPv4WithPrefixLength - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.v2alpha1api.model.CreateNetworkIPv6 - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.v2alpha1api.model.CreateNetworkIPv6WithPrefix - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.v2alpha1api.model.CreateNetworkIPv6WithPrefixLength - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.v2alpha1api.model.CreateNetworkPayload - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.v2alpha1api.model.CreateVPCNetworkRangePayload - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.v2alpha1api.model.CreateVPCPayload - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.v2alpha1api.model.CreateVPCRegionPayload - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.v2alpha1api.model.DestinationCIDRv4 - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.v2alpha1api.model.DestinationCIDRv6 - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.v2alpha1api.model.Error.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.v2alpha1api.model.Network.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.v2alpha1api.model.NetworkIPv4 - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.v2alpha1api.model.NetworkIPv6 - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.v2alpha1api.model.NetworkListResponse - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.v2alpha1api.model.NetworkRangeIPv4Request - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.v2alpha1api.model.NexthopBlackhole - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.v2alpha1api.model.NexthopIPv4 - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.v2alpha1api.model.NexthopIPv6 - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.v2alpha1api.model.NexthopInternet - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.v2alpha1api.model.PartialUpdateNetworkPayload - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.v2alpha1api.model.PartialUpdateVPCPayload - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.v2alpha1api.model.PrefixEntries - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.v2alpha1api.model.PrefixList.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.v2alpha1api.model.PrefixListListResponse - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.v2alpha1api.model.RegionalVPC - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.v2alpha1api.model.RegionalVPCIPv4 - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.v2alpha1api.model.RegionalVPCList - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.v2alpha1api.model.RetypeVolumePayload - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.v2alpha1api.model.Route.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.v2alpha1api.model.RouteDestination - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.v2alpha1api.model.RouteListResponse - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.v2alpha1api.model.RouteNexthop - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.v2alpha1api.model.RoutingTable - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.v2alpha1api.model.RoutingTableListResponse - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.v2alpha1api.model.UpdateNetworkIPv4Body - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.v2alpha1api.model.UpdateNetworkIPv6Body - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.v2alpha1api.model.UpdateRouteOfRoutingTablePayload - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.v2alpha1api.model.UpdateRoutingTableOfAreaPayload - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.v2alpha1api.model.UpdateVPCNetworkRangePayload - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.v2alpha1api.model.UpdateVPCRegionPayload - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.v2alpha1api.model.UpdateVPCRoutingTablePayload - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.v2alpha1api.model.UpdateVPCStaticRoutePayload - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.v2alpha1api.model.V1UpdateVPCNetworkRangeIPv4 - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.v2alpha1api.model.VPC.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.v2alpha1api.model.VPCBaseNetworkRange - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.v2alpha1api.model.VPCList.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.v2alpha1api.model.VPCNetworkRange - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.v2alpha1api.model.VPCNetworkRangeIPv4 - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.v2alpha1api.model.VPCNetworkRangeIPv6 - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.v2alpha1api.model.VPCNetworkRangeList - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.v2alpha1api.model.VPCRoutingTable - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.v2alpha1api.model.VPCRoutingTableList - .CustomTypeAdapterFactory()); - gson = gsonBuilder.create(); - } - - /** - * Get Gson. - * - * @return Gson - */ - public static Gson getGson() { - return gson; - } - - /** - * Set Gson. - * - * @param gson Gson - */ - public static void setGson(Gson gson) { - JSON.gson = gson; - } - - public static void setLenientOnJson(boolean lenientOnJson) { - isLenientOnJson = lenientOnJson; - } - - /** - * Serialize the given Java object into JSON string. - * - * @param obj Object - * @return String representation of the JSON - */ - public static String serialize(Object obj) { - return gson.toJson(obj); - } - - /** - * Deserialize the given JSON string to Java object. - * - * @param Type - * @param body The JSON string - * @param returnType The type to deserialize into - * @return The deserialized Java object - */ - @SuppressWarnings("unchecked") - public static T deserialize(String body, Type returnType) { - try { - if (isLenientOnJson) { - JsonReader jsonReader = new JsonReader(new StringReader(body)); - // see - // https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) - jsonReader.setLenient(true); - return gson.fromJson(jsonReader, returnType); - } else { - return gson.fromJson(body, returnType); - } - } catch (JsonParseException e) { - // Fallback processing when failed to parse JSON form response body: - // return the response body string directly for the String return type; - if (returnType.equals(String.class)) { - return (T) body; - } else { - throw (e); - } - } - } - - /** - * Deserialize the given JSON InputStream to a Java object. - * - * @param Type - * @param inputStream The JSON InputStream - * @param returnType The type to deserialize into - * @return The deserialized Java object - */ - @SuppressWarnings("unchecked") - public static T deserialize(InputStream inputStream, Type returnType) throws IOException { - try (InputStreamReader reader = - new InputStreamReader(inputStream, StandardCharsets.UTF_8)) { - if (isLenientOnJson) { - // see - // https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) - JsonReader jsonReader = new JsonReader(reader); - jsonReader.setLenient(true); - return gson.fromJson(jsonReader, returnType); - } else { - return gson.fromJson(reader, returnType); - } - } - } - - /** Gson TypeAdapter for Byte Array type */ - public static class ByteArrayAdapter extends TypeAdapter { - - @Override - public void write(JsonWriter out, byte[] value) throws IOException { - if (value == null) { - out.nullValue(); - } else { - out.value(ByteString.of(value).base64()); - } - } - - @Override - public byte[] read(JsonReader in) throws IOException { - switch (in.peek()) { - case NULL: - in.nextNull(); - return null; - default: - String bytesAsBase64 = in.nextString(); - ByteString byteString = ByteString.decodeBase64(bytesAsBase64); - return byteString.toByteArray(); - } - } - } - - /** Gson TypeAdapter for JSR310 OffsetDateTime type */ - public static class OffsetDateTimeTypeAdapter extends TypeAdapter { - - private DateTimeFormatter formatter; - - public OffsetDateTimeTypeAdapter() { - this(DateTimeFormatter.ISO_OFFSET_DATE_TIME); - } - - public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) { - this.formatter = formatter; - } - - public void setFormat(DateTimeFormatter dateFormat) { - this.formatter = dateFormat; - } - - @Override - public void write(JsonWriter out, OffsetDateTime date) throws IOException { - if (date == null) { - out.nullValue(); - } else { - out.value(formatter.format(date)); - } - } - - @Override - public OffsetDateTime read(JsonReader in) throws IOException { - switch (in.peek()) { - case NULL: - in.nextNull(); - return null; - default: - String date = in.nextString(); - if (date.endsWith("+0000")) { - date = date.substring(0, date.length() - 5) + "Z"; - } - return OffsetDateTime.parse(date, formatter); - } - } - } - - /** Gson TypeAdapter for JSR310 LocalDate type */ - public static class LocalDateTypeAdapter extends TypeAdapter { - - private DateTimeFormatter formatter; - - public LocalDateTypeAdapter() { - this(DateTimeFormatter.ISO_LOCAL_DATE); - } - - public LocalDateTypeAdapter(DateTimeFormatter formatter) { - this.formatter = formatter; - } - - public void setFormat(DateTimeFormatter dateFormat) { - this.formatter = dateFormat; - } - - @Override - public void write(JsonWriter out, LocalDate date) throws IOException { - if (date == null) { - out.nullValue(); - } else { - out.value(formatter.format(date)); - } - } - - @Override - public LocalDate read(JsonReader in) throws IOException { - switch (in.peek()) { - case NULL: - in.nextNull(); - return null; - default: - String date = in.nextString(); - return LocalDate.parse(date, formatter); - } - } - } - - public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { - offsetDateTimeTypeAdapter.setFormat(dateFormat); - } - - public static void setLocalDateFormat(DateTimeFormatter dateFormat) { - localDateTypeAdapter.setFormat(dateFormat); - } - - /** - * Gson TypeAdapter for java.sql.Date type If the dateFormat is null, a simple "yyyy-MM-dd" - * format will be used (more efficient than SimpleDateFormat). - */ - public static class SqlDateTypeAdapter extends TypeAdapter { - - private DateFormat dateFormat; - - public SqlDateTypeAdapter() {} - - public SqlDateTypeAdapter(DateFormat dateFormat) { - this.dateFormat = dateFormat; - } - - public void setFormat(DateFormat dateFormat) { - this.dateFormat = dateFormat; - } - - @Override - public void write(JsonWriter out, java.sql.Date date) throws IOException { - if (date == null) { - out.nullValue(); - } else { - String value; - if (dateFormat != null) { - value = dateFormat.format(date); - } else { - value = date.toString(); - } - out.value(value); - } - } - - @Override - public java.sql.Date read(JsonReader in) throws IOException { - switch (in.peek()) { - case NULL: - in.nextNull(); - return null; - default: - String date = in.nextString(); - try { - if (dateFormat != null) { - return new java.sql.Date(dateFormat.parse(date).getTime()); - } - return new java.sql.Date( - ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); - } catch (ParseException e) { - throw new JsonParseException(e); - } - } - } - } - - /** - * Gson TypeAdapter for java.util.Date type If the dateFormat is null, ISO8601Utils will be - * used. - */ - public static class DateTypeAdapter extends TypeAdapter { - - private DateFormat dateFormat; - - public DateTypeAdapter() {} - - public DateTypeAdapter(DateFormat dateFormat) { - this.dateFormat = dateFormat; - } - - public void setFormat(DateFormat dateFormat) { - this.dateFormat = dateFormat; - } - - @Override - public void write(JsonWriter out, Date date) throws IOException { - if (date == null) { - out.nullValue(); - } else { - String value; - if (dateFormat != null) { - value = dateFormat.format(date); - } else { - value = ISO8601Utils.format(date, true); - } - out.value(value); - } - } - - @Override - public Date read(JsonReader in) throws IOException { - try { - switch (in.peek()) { - case NULL: - in.nextNull(); - return null; - default: - String date = in.nextString(); - try { - if (dateFormat != null) { - return dateFormat.parse(date); - } - return ISO8601Utils.parse(date, new ParsePosition(0)); - } catch (ParseException e) { - throw new JsonParseException(e); - } - } - } catch (IllegalArgumentException e) { - throw new JsonParseException(e); - } - } - } - - public static void setDateFormat(DateFormat dateFormat) { - dateTypeAdapter.setFormat(dateFormat); - } - - public static void setSqlDateFormat(DateFormat dateFormat) { - sqlDateTypeAdapter.setFormat(dateFormat); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/Pair.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/Pair.java deleted file mode 100644 index 2fd6109d..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/Pair.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api; - -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class Pair { - private final String name; - private final String value; - - public Pair(String name, String value) { - this.name = isValidString(name) ? name : ""; - this.value = isValidString(value) ? value : ""; - } - - public String getName() { - return this.name; - } - - public String getValue() { - return this.value; - } - - private static boolean isValidString(String arg) { - return arg != null; - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/ProgressRequestBody.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/ProgressRequestBody.java deleted file mode 100644 index 78f6f49e..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/ProgressRequestBody.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api; - -import java.io.IOException; -import okhttp3.MediaType; -import okhttp3.RequestBody; -import okio.Buffer; -import okio.BufferedSink; -import okio.ForwardingSink; -import okio.Okio; -import okio.Sink; - -public class ProgressRequestBody extends RequestBody { - - private final RequestBody requestBody; - - private final ApiCallback callback; - - public ProgressRequestBody(RequestBody requestBody, ApiCallback callback) { - this.requestBody = requestBody; - this.callback = callback; - } - - @Override - public MediaType contentType() { - return requestBody.contentType(); - } - - @Override - public long contentLength() throws IOException { - return requestBody.contentLength(); - } - - @Override - public void writeTo(BufferedSink sink) throws IOException { - BufferedSink bufferedSink = Okio.buffer(sink(sink)); - requestBody.writeTo(bufferedSink); - bufferedSink.flush(); - } - - private Sink sink(Sink sink) { - return new ForwardingSink(sink) { - - long bytesWritten = 0L; - long contentLength = 0L; - - @Override - public void write(Buffer source, long byteCount) throws IOException { - super.write(source, byteCount); - if (contentLength == 0) { - contentLength = contentLength(); - } - - bytesWritten += byteCount; - callback.onUploadProgress( - bytesWritten, contentLength, bytesWritten == contentLength); - } - }; - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/ProgressResponseBody.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/ProgressResponseBody.java deleted file mode 100644 index b3db5d59..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/ProgressResponseBody.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api; - -import java.io.IOException; -import okhttp3.MediaType; -import okhttp3.ResponseBody; -import okio.Buffer; -import okio.BufferedSource; -import okio.ForwardingSource; -import okio.Okio; -import okio.Source; - -public class ProgressResponseBody extends ResponseBody { - - private final ResponseBody responseBody; - private final ApiCallback callback; - private BufferedSource bufferedSource; - - public ProgressResponseBody(ResponseBody responseBody, ApiCallback callback) { - this.responseBody = responseBody; - this.callback = callback; - } - - @Override - public MediaType contentType() { - return responseBody.contentType(); - } - - @Override - public long contentLength() { - return responseBody.contentLength(); - } - - @Override - public BufferedSource source() { - if (bufferedSource == null) { - bufferedSource = Okio.buffer(source(responseBody.source())); - } - return bufferedSource; - } - - private Source source(Source source) { - return new ForwardingSource(source) { - long totalBytesRead = 0L; - - @Override - public long read(Buffer sink, long byteCount) throws IOException { - long bytesRead = super.read(sink, byteCount); - // read() returns the number of bytes read, or -1 if this source is exhausted. - totalBytesRead += bytesRead != -1 ? bytesRead : 0; - callback.onDownloadProgress( - totalBytesRead, responseBody.contentLength(), bytesRead == -1); - return bytesRead; - } - }; - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/ServerConfiguration.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/ServerConfiguration.java deleted file mode 100644 index 8beef15f..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/ServerConfiguration.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api; - -import java.util.Map; - -/** Representing a Server configuration. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class ServerConfiguration { - public String URL; - public String description; - public Map variables; - - /** - * @param URL A URL to the target host. - * @param description A description of the host designated by the URL. - * @param variables A map between a variable name and its value. The value is used for - * substitution in the server's URL template. - */ - public ServerConfiguration( - String URL, String description, Map variables) { - this.URL = URL; - this.description = description; - this.variables = variables; - } - - /** - * Format URL template using given variables. - * - * @param variables A map between a variable name and its value. - * @return Formatted URL. - */ - public String URL(Map variables) { - String url = this.URL; - - // go through variables and replace placeholders - for (Map.Entry variable : this.variables.entrySet()) { - String name = variable.getKey(); - ServerVariable serverVariable = variable.getValue(); - String value = serverVariable.defaultValue; - - if (variables != null && variables.containsKey(name)) { - value = variables.get(name); - if (serverVariable.enumValues.size() > 0 - && !serverVariable.enumValues.contains(value)) { - throw new IllegalArgumentException( - "The variable " - + name - + " in the server URL has invalid value " - + value - + "."); - } - } - url = url.replace("{" + name + "}", value); - } - return url; - } - - /** - * Format URL template using default server variables. - * - * @return Formatted URL. - */ - public String URL() { - return URL(null); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/ServerVariable.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/ServerVariable.java deleted file mode 100644 index 0facec26..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/ServerVariable.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api; - -import java.util.HashSet; - -/** Representing a Server Variable for server URL template substitution. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class ServerVariable { - public String description; - public String defaultValue; - public HashSet enumValues = null; - - /** - * @param description A description for the server variable. - * @param defaultValue The default value to use for substitution. - * @param enumValues An enumeration of string values to be used if the substitution options are - * from a limited set. - */ - public ServerVariable(String description, String defaultValue, HashSet enumValues) { - this.description = description; - this.defaultValue = defaultValue; - this.enumValues = enumValues; - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/StringUtil.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/StringUtil.java deleted file mode 100644 index ee4be71d..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/StringUtil.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api; - -import java.util.Collection; -import java.util.Iterator; - -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class StringUtil { - /** - * Check if the given array contains the given value (with case-insensitive comparison). - * - * @param array The array - * @param value The value to search - * @return true if the array contains the value - */ - public static boolean containsIgnoreCase(String[] array, String value) { - for (String str : array) { - if (value == null && str == null) { - return true; - } - if (value != null && value.equalsIgnoreCase(str)) { - return true; - } - } - return false; - } - - /** - * Join an array of strings with the given separator. - * - *

Note: This might be replaced by utility method from commons-lang or guava someday if one - * of those libraries is added as dependency. - * - * @param array The array of strings - * @param separator The separator - * @return the resulting string - */ - public static String join(String[] array, String separator) { - int len = array.length; - if (len == 0) { - return ""; - } - - StringBuilder out = new StringBuilder(); - out.append(array[0]); - for (int i = 1; i < len; i++) { - out.append(separator).append(array[i]); - } - return out.toString(); - } - - /** - * Join a list of strings with the given separator. - * - * @param list The list of strings - * @param separator The separator - * @return the resulting string - */ - public static String join(Collection list, String separator) { - Iterator iterator = list.iterator(); - StringBuilder out = new StringBuilder(); - if (iterator.hasNext()) { - out.append(iterator.next()); - } - while (iterator.hasNext()) { - out.append(separator).append(iterator.next()); - } - return out.toString(); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/api/DefaultApi.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/api/DefaultApi.java deleted file mode 100644 index 26957163..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/api/DefaultApi.java +++ /dev/null @@ -1,11518 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.api; - -import cloud.stackit.sdk.core.config.CoreConfiguration; -import cloud.stackit.sdk.core.exception.ApiException; -import cloud.stackit.sdk.iaas.v2alpha1api.ApiCallback; -import cloud.stackit.sdk.iaas.v2alpha1api.ApiClient; -import cloud.stackit.sdk.iaas.v2alpha1api.ApiResponse; -import cloud.stackit.sdk.iaas.v2alpha1api.Pair; -import cloud.stackit.sdk.iaas.v2alpha1api.model.AddRoutesToRoutingTablePayload; -import cloud.stackit.sdk.iaas.v2alpha1api.model.AddRoutingTableToAreaPayload; -import cloud.stackit.sdk.iaas.v2alpha1api.model.AddVPCRoutingTablePayload; -import cloud.stackit.sdk.iaas.v2alpha1api.model.AddVPCStaticRoutePayload; -import cloud.stackit.sdk.iaas.v2alpha1api.model.AllRouteListResponse; -import cloud.stackit.sdk.iaas.v2alpha1api.model.CreateNetworkPayload; -import cloud.stackit.sdk.iaas.v2alpha1api.model.CreateVPCNetworkRangePayload; -import cloud.stackit.sdk.iaas.v2alpha1api.model.CreateVPCPayload; -import cloud.stackit.sdk.iaas.v2alpha1api.model.CreateVPCRegionPayload; -import cloud.stackit.sdk.iaas.v2alpha1api.model.Network; -import cloud.stackit.sdk.iaas.v2alpha1api.model.NetworkListResponse; -import cloud.stackit.sdk.iaas.v2alpha1api.model.PartialUpdateNetworkPayload; -import cloud.stackit.sdk.iaas.v2alpha1api.model.PartialUpdateVPCPayload; -import cloud.stackit.sdk.iaas.v2alpha1api.model.PrefixEntries; -import cloud.stackit.sdk.iaas.v2alpha1api.model.PrefixList; -import cloud.stackit.sdk.iaas.v2alpha1api.model.PrefixListListResponse; -import cloud.stackit.sdk.iaas.v2alpha1api.model.RegionalVPC; -import cloud.stackit.sdk.iaas.v2alpha1api.model.RegionalVPCList; -import cloud.stackit.sdk.iaas.v2alpha1api.model.RetypeVolumePayload; -import cloud.stackit.sdk.iaas.v2alpha1api.model.Route; -import cloud.stackit.sdk.iaas.v2alpha1api.model.RouteListResponse; -import cloud.stackit.sdk.iaas.v2alpha1api.model.RoutingTable; -import cloud.stackit.sdk.iaas.v2alpha1api.model.RoutingTableListResponse; -import cloud.stackit.sdk.iaas.v2alpha1api.model.UpdateRouteOfRoutingTablePayload; -import cloud.stackit.sdk.iaas.v2alpha1api.model.UpdateRoutingTableOfAreaPayload; -import cloud.stackit.sdk.iaas.v2alpha1api.model.UpdateVPCNetworkRangePayload; -import cloud.stackit.sdk.iaas.v2alpha1api.model.UpdateVPCRegionPayload; -import cloud.stackit.sdk.iaas.v2alpha1api.model.UpdateVPCRoutingTablePayload; -import cloud.stackit.sdk.iaas.v2alpha1api.model.UpdateVPCStaticRoutePayload; -import cloud.stackit.sdk.iaas.v2alpha1api.model.VPC; -import cloud.stackit.sdk.iaas.v2alpha1api.model.VPCList; -import cloud.stackit.sdk.iaas.v2alpha1api.model.VPCNetworkRange; -import cloud.stackit.sdk.iaas.v2alpha1api.model.VPCNetworkRangeList; -import cloud.stackit.sdk.iaas.v2alpha1api.model.VPCRoutingTable; -import cloud.stackit.sdk.iaas.v2alpha1api.model.VPCRoutingTableList; -import com.google.gson.reflect.TypeToken; -import java.io.IOException; -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.UUID; -import okhttp3.OkHttpClient; - -// Package-private access to enforce service-specific API usage (DefaultApi => Api) -class DefaultApi { - private ApiClient localVarApiClient; - private int localHostIndex; - private String localCustomBaseUrl; - - /** - * Basic constructor for DefaultApi - * - *

For production use consider using the constructor with the OkHttpClient parameter. - * - * @throws IOException - */ - public DefaultApi() throws IOException { - this(null, new CoreConfiguration()); - } - - /** - * Basic Constructor for DefaultApi - * - *

For production use consider using the constructor with the OkHttpClient parameter. - * - * @param config your STACKIT SDK CoreConfiguration - * @throws IOException - */ - public DefaultApi(CoreConfiguration config) throws IOException { - this(null, config); - } - - /** - * Constructor for DefaultApi - * - * @param httpClient OkHttpClient object - * @throws IOException - */ - public DefaultApi(OkHttpClient httpClient) throws IOException { - this(httpClient, new CoreConfiguration()); - } - - /** - * Constructor for DefaultApi - * - * @param httpClient OkHttpClient object - * @param config your STACKIT SDK CoreConfiguration - * @throws IOException - */ - public DefaultApi(OkHttpClient httpClient, CoreConfiguration config) throws IOException { - if (config.getCustomEndpoint() != null && !config.getCustomEndpoint().trim().isEmpty()) { - localCustomBaseUrl = config.getCustomEndpoint(); - } - this.localVarApiClient = new ApiClient(httpClient, config); - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public int getHostIndex() { - return localHostIndex; - } - - public void setHostIndex(int hostIndex) { - this.localHostIndex = hostIndex; - } - - public String getCustomBaseUrl() { - return localCustomBaseUrl; - } - - public void setCustomBaseUrl(String customBaseUrl) { - this.localCustomBaseUrl = customBaseUrl; - } - - /** - * Build call for addRoutesToRoutingTable - * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @param addRoutesToRoutingTablePayload Request an addition of routes to a routing table. - * (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
201 Adding routes to routing table was successful. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
409 A conflict has occurred. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call addRoutesToRoutingTableCall( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - @javax.annotation.Nonnull AddRoutesToRoutingTablePayload addRoutesToRoutingTablePayload, - final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = addRoutesToRoutingTablePayload; - - // create path and map variables - String localVarPath = - "/v2alpha1/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables/{routingTableId}/routes" - .replace( - "{" + "organizationId" + "}", - localVarApiClient.escapeString(organizationId.toString())) - .replace( - "{" + "areaId" + "}", - localVarApiClient.escapeString(areaId.toString())) - .replace( - "{" + "region" + "}", - localVarApiClient.escapeString(region.toString())) - .replace( - "{" + "routingTableId" + "}", - localVarApiClient.escapeString(routingTableId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/json"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "POST", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call addRoutesToRoutingTableValidateBeforeCall( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - @javax.annotation.Nonnull AddRoutesToRoutingTablePayload addRoutesToRoutingTablePayload, - final ApiCallback _callback) - throws ApiException { - // verify the required parameter 'organizationId' is set - if (organizationId == null) { - throw new ApiException( - "Missing the required parameter 'organizationId' when calling addRoutesToRoutingTable(Async)"); - } - - // verify the required parameter 'areaId' is set - if (areaId == null) { - throw new ApiException( - "Missing the required parameter 'areaId' when calling addRoutesToRoutingTable(Async)"); - } - - // verify the required parameter 'region' is set - if (region == null) { - throw new ApiException( - "Missing the required parameter 'region' when calling addRoutesToRoutingTable(Async)"); - } - - // verify the required parameter 'routingTableId' is set - if (routingTableId == null) { - throw new ApiException( - "Missing the required parameter 'routingTableId' when calling addRoutesToRoutingTable(Async)"); - } - - // verify the required parameter 'addRoutesToRoutingTablePayload' is set - if (addRoutesToRoutingTablePayload == null) { - throw new ApiException( - "Missing the required parameter 'addRoutesToRoutingTablePayload' when calling addRoutesToRoutingTable(Async)"); - } - - return addRoutesToRoutingTableCall( - organizationId, - areaId, - region, - routingTableId, - addRoutesToRoutingTablePayload, - _callback); - } - - /** - * Create new routes in a routing table. Create new routes in an existing routing table of a - * network area. - * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @param addRoutesToRoutingTablePayload Request an addition of routes to a routing table. - * (required) - * @return RouteListResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
201 Adding routes to routing table was successful. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
409 A conflict has occurred. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public RouteListResponse addRoutesToRoutingTable( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - @javax.annotation.Nonnull AddRoutesToRoutingTablePayload addRoutesToRoutingTablePayload) - throws ApiException { - ApiResponse localVarResp = - addRoutesToRoutingTableWithHttpInfo( - organizationId, - areaId, - region, - routingTableId, - addRoutesToRoutingTablePayload); - return localVarResp.getData(); - } - - /** - * Create new routes in a routing table. Create new routes in an existing routing table of a - * network area. - * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @param addRoutesToRoutingTablePayload Request an addition of routes to a routing table. - * (required) - * @return ApiResponse<RouteListResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
201 Adding routes to routing table was successful. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
409 A conflict has occurred. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public ApiResponse addRoutesToRoutingTableWithHttpInfo( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - @javax.annotation.Nonnull AddRoutesToRoutingTablePayload addRoutesToRoutingTablePayload) - throws ApiException { - okhttp3.Call localVarCall = - addRoutesToRoutingTableValidateBeforeCall( - organizationId, - areaId, - region, - routingTableId, - addRoutesToRoutingTablePayload, - null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Create new routes in a routing table. (asynchronously) Create new routes in an existing - * routing table of a network area. - * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @param addRoutesToRoutingTablePayload Request an addition of routes to a routing table. - * (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
201 Adding routes to routing table was successful. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
409 A conflict has occurred. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call addRoutesToRoutingTableAsync( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - @javax.annotation.Nonnull AddRoutesToRoutingTablePayload addRoutesToRoutingTablePayload, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - addRoutesToRoutingTableValidateBeforeCall( - organizationId, - areaId, - region, - routingTableId, - addRoutesToRoutingTablePayload, - _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - - /** - * Build call for addRoutingTableToArea - * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param region The STACKIT Region of the resources. (required) - * @param addRoutingTableToAreaPayload Request an addition of a routing table to an area. - * (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
201 Adding routing table was successful. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
409 A conflict has occurred. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call addRoutingTableToAreaCall( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull AddRoutingTableToAreaPayload addRoutingTableToAreaPayload, - final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = addRoutingTableToAreaPayload; - - // create path and map variables - String localVarPath = - "/v2alpha1/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables" - .replace( - "{" + "organizationId" + "}", - localVarApiClient.escapeString(organizationId.toString())) - .replace( - "{" + "areaId" + "}", - localVarApiClient.escapeString(areaId.toString())) - .replace( - "{" + "region" + "}", - localVarApiClient.escapeString(region.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/json"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "POST", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call addRoutingTableToAreaValidateBeforeCall( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull AddRoutingTableToAreaPayload addRoutingTableToAreaPayload, - final ApiCallback _callback) - throws ApiException { - // verify the required parameter 'organizationId' is set - if (organizationId == null) { - throw new ApiException( - "Missing the required parameter 'organizationId' when calling addRoutingTableToArea(Async)"); - } - - // verify the required parameter 'areaId' is set - if (areaId == null) { - throw new ApiException( - "Missing the required parameter 'areaId' when calling addRoutingTableToArea(Async)"); - } - - // verify the required parameter 'region' is set - if (region == null) { - throw new ApiException( - "Missing the required parameter 'region' when calling addRoutingTableToArea(Async)"); - } - - // verify the required parameter 'addRoutingTableToAreaPayload' is set - if (addRoutingTableToAreaPayload == null) { - throw new ApiException( - "Missing the required parameter 'addRoutingTableToAreaPayload' when calling addRoutingTableToArea(Async)"); - } - - return addRoutingTableToAreaCall( - organizationId, areaId, region, addRoutingTableToAreaPayload, _callback); - } - - /** - * Create new routing table in a network area. Create a new routing table in an existing network - * area. - * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param region The STACKIT Region of the resources. (required) - * @param addRoutingTableToAreaPayload Request an addition of a routing table to an area. - * (required) - * @return RoutingTable - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
201 Adding routing table was successful. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
409 A conflict has occurred. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public RoutingTable addRoutingTableToArea( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull AddRoutingTableToAreaPayload addRoutingTableToAreaPayload) - throws ApiException { - ApiResponse localVarResp = - addRoutingTableToAreaWithHttpInfo( - organizationId, areaId, region, addRoutingTableToAreaPayload); - return localVarResp.getData(); - } - - /** - * Create new routing table in a network area. Create a new routing table in an existing network - * area. - * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param region The STACKIT Region of the resources. (required) - * @param addRoutingTableToAreaPayload Request an addition of a routing table to an area. - * (required) - * @return ApiResponse<RoutingTable> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
201 Adding routing table was successful. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
409 A conflict has occurred. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public ApiResponse addRoutingTableToAreaWithHttpInfo( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull AddRoutingTableToAreaPayload addRoutingTableToAreaPayload) - throws ApiException { - okhttp3.Call localVarCall = - addRoutingTableToAreaValidateBeforeCall( - organizationId, areaId, region, addRoutingTableToAreaPayload, null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Create new routing table in a network area. (asynchronously) Create a new routing table in an - * existing network area. - * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param region The STACKIT Region of the resources. (required) - * @param addRoutingTableToAreaPayload Request an addition of a routing table to an area. - * (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
201 Adding routing table was successful. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
409 A conflict has occurred. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call addRoutingTableToAreaAsync( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull AddRoutingTableToAreaPayload addRoutingTableToAreaPayload, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - addRoutingTableToAreaValidateBeforeCall( - organizationId, areaId, region, addRoutingTableToAreaPayload, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - - /** - * Build call for addVPCRoutingTable - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @param addVPCRoutingTablePayload Request an addition of a routing table to a VPC. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
201 Adding routing table was successful. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
409 A conflict has occurred. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call addVPCRoutingTableCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull AddVPCRoutingTablePayload addVPCRoutingTablePayload, - final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = addVPCRoutingTablePayload; - - // create path and map variables - String localVarPath = - "/v2alpha1/projects/{projectId}/vpcs/{vpcId}/regions/{region}/routing-tables" - .replace( - "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())) - .replace( - "{" + "vpcId" + "}", - localVarApiClient.escapeString(vpcId.toString())) - .replace( - "{" + "region" + "}", - localVarApiClient.escapeString(region.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/json"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "POST", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call addVPCRoutingTableValidateBeforeCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull AddVPCRoutingTablePayload addVPCRoutingTablePayload, - final ApiCallback _callback) - throws ApiException { - // verify the required parameter 'projectId' is set - if (projectId == null) { - throw new ApiException( - "Missing the required parameter 'projectId' when calling addVPCRoutingTable(Async)"); - } - - // verify the required parameter 'vpcId' is set - if (vpcId == null) { - throw new ApiException( - "Missing the required parameter 'vpcId' when calling addVPCRoutingTable(Async)"); - } - - // verify the required parameter 'region' is set - if (region == null) { - throw new ApiException( - "Missing the required parameter 'region' when calling addVPCRoutingTable(Async)"); - } - - // verify the required parameter 'addVPCRoutingTablePayload' is set - if (addVPCRoutingTablePayload == null) { - throw new ApiException( - "Missing the required parameter 'addVPCRoutingTablePayload' when calling addVPCRoutingTable(Async)"); - } - - return addVPCRoutingTableCall( - projectId, vpcId, region, addVPCRoutingTablePayload, _callback); - } - - /** - * Create a new regional routing table in a VPC. Create a new routing table in an existing VPC - * for this region. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @param addVPCRoutingTablePayload Request an addition of a routing table to a VPC. (required) - * @return VPCRoutingTable - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
201 Adding routing table was successful. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
409 A conflict has occurred. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public VPCRoutingTable addVPCRoutingTable( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull AddVPCRoutingTablePayload addVPCRoutingTablePayload) - throws ApiException { - ApiResponse localVarResp = - addVPCRoutingTableWithHttpInfo(projectId, vpcId, region, addVPCRoutingTablePayload); - return localVarResp.getData(); - } - - /** - * Create a new regional routing table in a VPC. Create a new routing table in an existing VPC - * for this region. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @param addVPCRoutingTablePayload Request an addition of a routing table to a VPC. (required) - * @return ApiResponse<VPCRoutingTable> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
201 Adding routing table was successful. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
409 A conflict has occurred. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public ApiResponse addVPCRoutingTableWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull AddVPCRoutingTablePayload addVPCRoutingTablePayload) - throws ApiException { - okhttp3.Call localVarCall = - addVPCRoutingTableValidateBeforeCall( - projectId, vpcId, region, addVPCRoutingTablePayload, null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Create a new regional routing table in a VPC. (asynchronously) Create a new routing table in - * an existing VPC for this region. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @param addVPCRoutingTablePayload Request an addition of a routing table to a VPC. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
201 Adding routing table was successful. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
409 A conflict has occurred. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call addVPCRoutingTableAsync( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull AddVPCRoutingTablePayload addVPCRoutingTablePayload, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - addVPCRoutingTableValidateBeforeCall( - projectId, vpcId, region, addVPCRoutingTablePayload, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - - /** - * Build call for addVPCStaticRoute - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @param addVPCStaticRoutePayload Request to add a static route to a VPC. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
201 Adding static route was successful. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
409 A conflict has occurred. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call addVPCStaticRouteCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - @javax.annotation.Nonnull AddVPCStaticRoutePayload addVPCStaticRoutePayload, - final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = addVPCStaticRoutePayload; - - // create path and map variables - String localVarPath = - "/v2alpha1/projects/{projectId}/vpcs/{vpcId}/regions/{region}/routing-tables/{routingTableId}/static-routes" - .replace( - "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())) - .replace( - "{" + "vpcId" + "}", - localVarApiClient.escapeString(vpcId.toString())) - .replace( - "{" + "region" + "}", - localVarApiClient.escapeString(region.toString())) - .replace( - "{" + "routingTableId" + "}", - localVarApiClient.escapeString(routingTableId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/json"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "POST", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call addVPCStaticRouteValidateBeforeCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - @javax.annotation.Nonnull AddVPCStaticRoutePayload addVPCStaticRoutePayload, - final ApiCallback _callback) - throws ApiException { - // verify the required parameter 'projectId' is set - if (projectId == null) { - throw new ApiException( - "Missing the required parameter 'projectId' when calling addVPCStaticRoute(Async)"); - } - - // verify the required parameter 'vpcId' is set - if (vpcId == null) { - throw new ApiException( - "Missing the required parameter 'vpcId' when calling addVPCStaticRoute(Async)"); - } - - // verify the required parameter 'region' is set - if (region == null) { - throw new ApiException( - "Missing the required parameter 'region' when calling addVPCStaticRoute(Async)"); - } - - // verify the required parameter 'routingTableId' is set - if (routingTableId == null) { - throw new ApiException( - "Missing the required parameter 'routingTableId' when calling addVPCStaticRoute(Async)"); - } - - // verify the required parameter 'addVPCStaticRoutePayload' is set - if (addVPCStaticRoutePayload == null) { - throw new ApiException( - "Missing the required parameter 'addVPCStaticRoutePayload' when calling addVPCStaticRoute(Async)"); - } - - return addVPCStaticRouteCall( - projectId, vpcId, region, routingTableId, addVPCStaticRoutePayload, _callback); - } - - /** - * Create new regional static route. Create a new static route in the VPC for this region. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @param addVPCStaticRoutePayload Request to add a static route to a VPC. (required) - * @return Route - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
201 Adding static route was successful. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
409 A conflict has occurred. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public Route addVPCStaticRoute( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - @javax.annotation.Nonnull AddVPCStaticRoutePayload addVPCStaticRoutePayload) - throws ApiException { - ApiResponse localVarResp = - addVPCStaticRouteWithHttpInfo( - projectId, vpcId, region, routingTableId, addVPCStaticRoutePayload); - return localVarResp.getData(); - } - - /** - * Create new regional static route. Create a new static route in the VPC for this region. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @param addVPCStaticRoutePayload Request to add a static route to a VPC. (required) - * @return ApiResponse<Route> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
201 Adding static route was successful. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
409 A conflict has occurred. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public ApiResponse addVPCStaticRouteWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - @javax.annotation.Nonnull AddVPCStaticRoutePayload addVPCStaticRoutePayload) - throws ApiException { - okhttp3.Call localVarCall = - addVPCStaticRouteValidateBeforeCall( - projectId, vpcId, region, routingTableId, addVPCStaticRoutePayload, null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Create new regional static route. (asynchronously) Create a new static route in the VPC for - * this region. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @param addVPCStaticRoutePayload Request to add a static route to a VPC. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
201 Adding static route was successful. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
409 A conflict has occurred. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call addVPCStaticRouteAsync( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - @javax.annotation.Nonnull AddVPCStaticRoutePayload addVPCStaticRoutePayload, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - addVPCStaticRouteValidateBeforeCall( - projectId, - vpcId, - region, - routingTableId, - addVPCStaticRoutePayload, - _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - - /** - * Build call for createNetwork - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param region The STACKIT Region of the resources. (required) - * @param createNetworkPayload Request a network creation. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
202 Network create has been accepted. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
409 A conflict has occurred. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call createNetworkCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull CreateNetworkPayload createNetworkPayload, - final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = createNetworkPayload; - - // create path and map variables - String localVarPath = - "/v2alpha1/projects/{projectId}/regions/{region}/networks" - .replace( - "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())) - .replace( - "{" + "region" + "}", - localVarApiClient.escapeString(region.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/json"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "POST", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call createNetworkValidateBeforeCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull CreateNetworkPayload createNetworkPayload, - final ApiCallback _callback) - throws ApiException { - // verify the required parameter 'projectId' is set - if (projectId == null) { - throw new ApiException( - "Missing the required parameter 'projectId' when calling createNetwork(Async)"); - } - - // verify the required parameter 'region' is set - if (region == null) { - throw new ApiException( - "Missing the required parameter 'region' when calling createNetwork(Async)"); - } - - // verify the required parameter 'createNetworkPayload' is set - if (createNetworkPayload == null) { - throw new ApiException( - "Missing the required parameter 'createNetworkPayload' when calling createNetwork(Async)"); - } - - return createNetworkCall(projectId, region, createNetworkPayload, _callback); - } - - /** - * Create new network. Create a new network in a project. `nameservers` will be filled - * from `defaultNameservers` of the respective area if not specified. If the project - * has `internetAccess` enabled and this is the first network in the project this - * might incur cost. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param region The STACKIT Region of the resources. (required) - * @param createNetworkPayload Request a network creation. (required) - * @return Network - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
202 Network create has been accepted. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
409 A conflict has occurred. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public Network createNetwork( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull CreateNetworkPayload createNetworkPayload) - throws ApiException { - ApiResponse localVarResp = - createNetworkWithHttpInfo(projectId, region, createNetworkPayload); - return localVarResp.getData(); - } - - /** - * Create new network. Create a new network in a project. `nameservers` will be filled - * from `defaultNameservers` of the respective area if not specified. If the project - * has `internetAccess` enabled and this is the first network in the project this - * might incur cost. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param region The STACKIT Region of the resources. (required) - * @param createNetworkPayload Request a network creation. (required) - * @return ApiResponse<Network> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
202 Network create has been accepted. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
409 A conflict has occurred. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public ApiResponse createNetworkWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull CreateNetworkPayload createNetworkPayload) - throws ApiException { - okhttp3.Call localVarCall = - createNetworkValidateBeforeCall(projectId, region, createNetworkPayload, null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Create new network. (asynchronously) Create a new network in a project. - * `nameservers` will be filled from `defaultNameservers` of the respective - * area if not specified. If the project has `internetAccess` enabled and this is the - * first network in the project this might incur cost. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param region The STACKIT Region of the resources. (required) - * @param createNetworkPayload Request a network creation. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
202 Network create has been accepted. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
409 A conflict has occurred. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call createNetworkAsync( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull CreateNetworkPayload createNetworkPayload, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - createNetworkValidateBeforeCall(projectId, region, createNetworkPayload, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - - /** - * Build call for createVPC - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param createVPCPayload Request a VPC creation. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
201 VPC has been successfully created. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call createVPCCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull CreateVPCPayload createVPCPayload, - final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = createVPCPayload; - - // create path and map variables - String localVarPath = - "/v2alpha1/projects/{projectId}/vpcs" - .replace( - "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/json"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "POST", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call createVPCValidateBeforeCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull CreateVPCPayload createVPCPayload, - final ApiCallback _callback) - throws ApiException { - // verify the required parameter 'projectId' is set - if (projectId == null) { - throw new ApiException( - "Missing the required parameter 'projectId' when calling createVPC(Async)"); - } - - // verify the required parameter 'createVPCPayload' is set - if (createVPCPayload == null) { - throw new ApiException( - "Missing the required parameter 'createVPCPayload' when calling createVPC(Async)"); - } - - return createVPCCall(projectId, createVPCPayload, _callback); - } - - /** - * Create a new VPC. Create a new VPC in a project. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param createVPCPayload Request a VPC creation. (required) - * @return VPC - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
201 VPC has been successfully created. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public VPC createVPC( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull CreateVPCPayload createVPCPayload) - throws ApiException { - ApiResponse localVarResp = createVPCWithHttpInfo(projectId, createVPCPayload); - return localVarResp.getData(); - } - - /** - * Create a new VPC. Create a new VPC in a project. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param createVPCPayload Request a VPC creation. (required) - * @return ApiResponse<VPC> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
201 VPC has been successfully created. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public ApiResponse createVPCWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull CreateVPCPayload createVPCPayload) - throws ApiException { - okhttp3.Call localVarCall = createVPCValidateBeforeCall(projectId, createVPCPayload, null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Create a new VPC. (asynchronously) Create a new VPC in a project. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param createVPCPayload Request a VPC creation. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
201 VPC has been successfully created. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call createVPCAsync( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull CreateVPCPayload createVPCPayload, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - createVPCValidateBeforeCall(projectId, createVPCPayload, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - - /** - * Build call for createVPCNetworkRange - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @param createVPCNetworkRangePayload Request to add an additional network range to a VPC. - * (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
202 Create request for a network range has been accepted. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
409 A conflict has occurred. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call createVPCNetworkRangeCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull CreateVPCNetworkRangePayload createVPCNetworkRangePayload, - final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = createVPCNetworkRangePayload; - - // create path and map variables - String localVarPath = - "/v2alpha1/projects/{projectId}/vpcs/{vpcId}/regions/{region}/network-ranges" - .replace( - "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())) - .replace( - "{" + "vpcId" + "}", - localVarApiClient.escapeString(vpcId.toString())) - .replace( - "{" + "region" + "}", - localVarApiClient.escapeString(region.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/json"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "POST", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call createVPCNetworkRangeValidateBeforeCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull CreateVPCNetworkRangePayload createVPCNetworkRangePayload, - final ApiCallback _callback) - throws ApiException { - // verify the required parameter 'projectId' is set - if (projectId == null) { - throw new ApiException( - "Missing the required parameter 'projectId' when calling createVPCNetworkRange(Async)"); - } - - // verify the required parameter 'vpcId' is set - if (vpcId == null) { - throw new ApiException( - "Missing the required parameter 'vpcId' when calling createVPCNetworkRange(Async)"); - } - - // verify the required parameter 'region' is set - if (region == null) { - throw new ApiException( - "Missing the required parameter 'region' when calling createVPCNetworkRange(Async)"); - } - - // verify the required parameter 'createVPCNetworkRangePayload' is set - if (createVPCNetworkRangePayload == null) { - throw new ApiException( - "Missing the required parameter 'createVPCNetworkRangePayload' when calling createVPCNetworkRange(Async)"); - } - - return createVPCNetworkRangeCall( - projectId, vpcId, region, createVPCNetworkRangePayload, _callback); - } - - /** - * Create new regional network ranges in a VPC. Create a new network range in an existing VPC - * for this region. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @param createVPCNetworkRangePayload Request to add an additional network range to a VPC. - * (required) - * @return VPCNetworkRange - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
202 Create request for a network range has been accepted. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
409 A conflict has occurred. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public VPCNetworkRange createVPCNetworkRange( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull CreateVPCNetworkRangePayload createVPCNetworkRangePayload) - throws ApiException { - ApiResponse localVarResp = - createVPCNetworkRangeWithHttpInfo( - projectId, vpcId, region, createVPCNetworkRangePayload); - return localVarResp.getData(); - } - - /** - * Create new regional network ranges in a VPC. Create a new network range in an existing VPC - * for this region. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @param createVPCNetworkRangePayload Request to add an additional network range to a VPC. - * (required) - * @return ApiResponse<VPCNetworkRange> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
202 Create request for a network range has been accepted. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
409 A conflict has occurred. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public ApiResponse createVPCNetworkRangeWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull CreateVPCNetworkRangePayload createVPCNetworkRangePayload) - throws ApiException { - okhttp3.Call localVarCall = - createVPCNetworkRangeValidateBeforeCall( - projectId, vpcId, region, createVPCNetworkRangePayload, null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Create new regional network ranges in a VPC. (asynchronously) Create a new network range in - * an existing VPC for this region. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @param createVPCNetworkRangePayload Request to add an additional network range to a VPC. - * (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
202 Create request for a network range has been accepted. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
409 A conflict has occurred. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call createVPCNetworkRangeAsync( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull CreateVPCNetworkRangePayload createVPCNetworkRangePayload, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - createVPCNetworkRangeValidateBeforeCall( - projectId, vpcId, region, createVPCNetworkRangePayload, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - - /** - * Build call for createVPCRegion - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @param createVPCRegionPayload Request to add a new regional VPC configuration. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
202 Configure VPC in a new region was accepted. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
409 A conflict has occurred. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call createVPCRegionCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull CreateVPCRegionPayload createVPCRegionPayload, - final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = createVPCRegionPayload; - - // create path and map variables - String localVarPath = - "/v2alpha1/projects/{projectId}/vpcs/{vpcId}/regions/{region}" - .replace( - "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())) - .replace( - "{" + "vpcId" + "}", - localVarApiClient.escapeString(vpcId.toString())) - .replace( - "{" + "region" + "}", - localVarApiClient.escapeString(region.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/json"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "PUT", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call createVPCRegionValidateBeforeCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull CreateVPCRegionPayload createVPCRegionPayload, - final ApiCallback _callback) - throws ApiException { - // verify the required parameter 'projectId' is set - if (projectId == null) { - throw new ApiException( - "Missing the required parameter 'projectId' when calling createVPCRegion(Async)"); - } - - // verify the required parameter 'vpcId' is set - if (vpcId == null) { - throw new ApiException( - "Missing the required parameter 'vpcId' when calling createVPCRegion(Async)"); - } - - // verify the required parameter 'region' is set - if (region == null) { - throw new ApiException( - "Missing the required parameter 'region' when calling createVPCRegion(Async)"); - } - - // verify the required parameter 'createVPCRegionPayload' is set - if (createVPCRegionPayload == null) { - throw new ApiException( - "Missing the required parameter 'createVPCRegionPayload' when calling createVPCRegion(Async)"); - } - - return createVPCRegionCall(projectId, vpcId, region, createVPCRegionPayload, _callback); - } - - /** - * Create the regional configuration of a VPC. Create the configuration of a region for a VPC. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @param createVPCRegionPayload Request to add a new regional VPC configuration. (required) - * @return RegionalVPC - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
202 Configure VPC in a new region was accepted. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
409 A conflict has occurred. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public RegionalVPC createVPCRegion( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull CreateVPCRegionPayload createVPCRegionPayload) - throws ApiException { - ApiResponse localVarResp = - createVPCRegionWithHttpInfo(projectId, vpcId, region, createVPCRegionPayload); - return localVarResp.getData(); - } - - /** - * Create the regional configuration of a VPC. Create the configuration of a region for a VPC. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @param createVPCRegionPayload Request to add a new regional VPC configuration. (required) - * @return ApiResponse<RegionalVPC> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
202 Configure VPC in a new region was accepted. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
409 A conflict has occurred. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public ApiResponse createVPCRegionWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull CreateVPCRegionPayload createVPCRegionPayload) - throws ApiException { - okhttp3.Call localVarCall = - createVPCRegionValidateBeforeCall( - projectId, vpcId, region, createVPCRegionPayload, null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Create the regional configuration of a VPC. (asynchronously) Create the configuration of a - * region for a VPC. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @param createVPCRegionPayload Request to add a new regional VPC configuration. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
202 Configure VPC in a new region was accepted. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
409 A conflict has occurred. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call createVPCRegionAsync( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull CreateVPCRegionPayload createVPCRegionPayload, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - createVPCRegionValidateBeforeCall( - projectId, vpcId, region, createVPCRegionPayload, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - - /** - * Build call for deleteNetwork - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param region The STACKIT Region of the resources. (required) - * @param networkId The identifier (ID) of a STACKIT Network. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
202 Delete request for network has been accepted. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
409 A conflict has occurred. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call deleteNetworkCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID networkId, - final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = - "/v2alpha1/projects/{projectId}/regions/{region}/networks/{networkId}" - .replace( - "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())) - .replace( - "{" + "region" + "}", - localVarApiClient.escapeString(region.toString())) - .replace( - "{" + "networkId" + "}", - localVarApiClient.escapeString(networkId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "DELETE", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call deleteNetworkValidateBeforeCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID networkId, - final ApiCallback _callback) - throws ApiException { - // verify the required parameter 'projectId' is set - if (projectId == null) { - throw new ApiException( - "Missing the required parameter 'projectId' when calling deleteNetwork(Async)"); - } - - // verify the required parameter 'region' is set - if (region == null) { - throw new ApiException( - "Missing the required parameter 'region' when calling deleteNetwork(Async)"); - } - - // verify the required parameter 'networkId' is set - if (networkId == null) { - throw new ApiException( - "Missing the required parameter 'networkId' when calling deleteNetwork(Async)"); - } - - return deleteNetworkCall(projectId, region, networkId, _callback); - } - - /** - * Delete network. Delete a network. If the network is still in use, the deletion will fail. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param region The STACKIT Region of the resources. (required) - * @param networkId The identifier (ID) of a STACKIT Network. (required) - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
202 Delete request for network has been accepted. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
409 A conflict has occurred. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public void deleteNetwork( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID networkId) - throws ApiException { - deleteNetworkWithHttpInfo(projectId, region, networkId); - } - - /** - * Delete network. Delete a network. If the network is still in use, the deletion will fail. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param region The STACKIT Region of the resources. (required) - * @param networkId The identifier (ID) of a STACKIT Network. (required) - * @return ApiResponse<Void> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
202 Delete request for network has been accepted. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
409 A conflict has occurred. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public ApiResponse deleteNetworkWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID networkId) - throws ApiException { - okhttp3.Call localVarCall = - deleteNetworkValidateBeforeCall(projectId, region, networkId, null); - return localVarApiClient.execute(localVarCall); - } - - /** - * Delete network. (asynchronously) Delete a network. If the network is still in use, the - * deletion will fail. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param region The STACKIT Region of the resources. (required) - * @param networkId The identifier (ID) of a STACKIT Network. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
202 Delete request for network has been accepted. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
409 A conflict has occurred. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call deleteNetworkAsync( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID networkId, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - deleteNetworkValidateBeforeCall(projectId, region, networkId, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); - return localVarCall; - } - - /** - * Build call for deletePrefixList - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param region The STACKIT Region of the resources. (required) - * @param prefixListId The identifier (ID) of a STACKIT Prefix List. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
204 Delete request for prefix list has been accepted. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
409 A conflict has occurred. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call deletePrefixListCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID prefixListId, - final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = - "/v2alpha1/projects/{projectId}/regions/{region}/prefix-lists/{prefixListId}" - .replace( - "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())) - .replace( - "{" + "region" + "}", - localVarApiClient.escapeString(region.toString())) - .replace( - "{" + "prefixListId" + "}", - localVarApiClient.escapeString(prefixListId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "DELETE", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call deletePrefixListValidateBeforeCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID prefixListId, - final ApiCallback _callback) - throws ApiException { - // verify the required parameter 'projectId' is set - if (projectId == null) { - throw new ApiException( - "Missing the required parameter 'projectId' when calling deletePrefixList(Async)"); - } - - // verify the required parameter 'region' is set - if (region == null) { - throw new ApiException( - "Missing the required parameter 'region' when calling deletePrefixList(Async)"); - } - - // verify the required parameter 'prefixListId' is set - if (prefixListId == null) { - throw new ApiException( - "Missing the required parameter 'prefixListId' when calling deletePrefixList(Async)"); - } - - return deletePrefixListCall(projectId, region, prefixListId, _callback); - } - - /** - * Delete prefix list. Delete a prefix list. If the prefix list is still in use, the deletion - * will fail. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param region The STACKIT Region of the resources. (required) - * @param prefixListId The identifier (ID) of a STACKIT Prefix List. (required) - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
204 Delete request for prefix list has been accepted. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
409 A conflict has occurred. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public void deletePrefixList( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID prefixListId) - throws ApiException { - deletePrefixListWithHttpInfo(projectId, region, prefixListId); - } - - /** - * Delete prefix list. Delete a prefix list. If the prefix list is still in use, the deletion - * will fail. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param region The STACKIT Region of the resources. (required) - * @param prefixListId The identifier (ID) of a STACKIT Prefix List. (required) - * @return ApiResponse<Void> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
204 Delete request for prefix list has been accepted. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
409 A conflict has occurred. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public ApiResponse deletePrefixListWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID prefixListId) - throws ApiException { - okhttp3.Call localVarCall = - deletePrefixListValidateBeforeCall(projectId, region, prefixListId, null); - return localVarApiClient.execute(localVarCall); - } - - /** - * Delete prefix list. (asynchronously) Delete a prefix list. If the prefix list is still in - * use, the deletion will fail. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param region The STACKIT Region of the resources. (required) - * @param prefixListId The identifier (ID) of a STACKIT Prefix List. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
204 Delete request for prefix list has been accepted. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
409 A conflict has occurred. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call deletePrefixListAsync( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID prefixListId, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - deletePrefixListValidateBeforeCall(projectId, region, prefixListId, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); - return localVarCall; - } - - /** - * Build call for deleteRouteFromRoutingTable - * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @param routeId The identifier (ID) of a STACKIT Route. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
204 Delete request for the route has been accepted. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call deleteRouteFromRoutingTableCall( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - @javax.annotation.Nonnull UUID routeId, - final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = - "/v2alpha1/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables/{routingTableId}/routes/{routeId}" - .replace( - "{" + "organizationId" + "}", - localVarApiClient.escapeString(organizationId.toString())) - .replace( - "{" + "areaId" + "}", - localVarApiClient.escapeString(areaId.toString())) - .replace( - "{" + "region" + "}", - localVarApiClient.escapeString(region.toString())) - .replace( - "{" + "routingTableId" + "}", - localVarApiClient.escapeString(routingTableId.toString())) - .replace( - "{" + "routeId" + "}", - localVarApiClient.escapeString(routeId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "DELETE", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call deleteRouteFromRoutingTableValidateBeforeCall( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - @javax.annotation.Nonnull UUID routeId, - final ApiCallback _callback) - throws ApiException { - // verify the required parameter 'organizationId' is set - if (organizationId == null) { - throw new ApiException( - "Missing the required parameter 'organizationId' when calling deleteRouteFromRoutingTable(Async)"); - } - - // verify the required parameter 'areaId' is set - if (areaId == null) { - throw new ApiException( - "Missing the required parameter 'areaId' when calling deleteRouteFromRoutingTable(Async)"); - } - - // verify the required parameter 'region' is set - if (region == null) { - throw new ApiException( - "Missing the required parameter 'region' when calling deleteRouteFromRoutingTable(Async)"); - } - - // verify the required parameter 'routingTableId' is set - if (routingTableId == null) { - throw new ApiException( - "Missing the required parameter 'routingTableId' when calling deleteRouteFromRoutingTable(Async)"); - } - - // verify the required parameter 'routeId' is set - if (routeId == null) { - throw new ApiException( - "Missing the required parameter 'routeId' when calling deleteRouteFromRoutingTable(Async)"); - } - - return deleteRouteFromRoutingTableCall( - organizationId, areaId, region, routingTableId, routeId, _callback); - } - - /** - * Delete a route in a routing table. Delete a route in an existing routing table of a network - * area. - * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @param routeId The identifier (ID) of a STACKIT Route. (required) - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
204 Delete request for the route has been accepted. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public void deleteRouteFromRoutingTable( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - @javax.annotation.Nonnull UUID routeId) - throws ApiException { - deleteRouteFromRoutingTableWithHttpInfo( - organizationId, areaId, region, routingTableId, routeId); - } - - /** - * Delete a route in a routing table. Delete a route in an existing routing table of a network - * area. - * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @param routeId The identifier (ID) of a STACKIT Route. (required) - * @return ApiResponse<Void> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
204 Delete request for the route has been accepted. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public ApiResponse deleteRouteFromRoutingTableWithHttpInfo( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - @javax.annotation.Nonnull UUID routeId) - throws ApiException { - okhttp3.Call localVarCall = - deleteRouteFromRoutingTableValidateBeforeCall( - organizationId, areaId, region, routingTableId, routeId, null); - return localVarApiClient.execute(localVarCall); - } - - /** - * Delete a route in a routing table. (asynchronously) Delete a route in an existing routing - * table of a network area. - * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @param routeId The identifier (ID) of a STACKIT Route. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
204 Delete request for the route has been accepted. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call deleteRouteFromRoutingTableAsync( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - @javax.annotation.Nonnull UUID routeId, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - deleteRouteFromRoutingTableValidateBeforeCall( - organizationId, areaId, region, routingTableId, routeId, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); - return localVarCall; - } - - /** - * Build call for deleteRoutingTableFromArea - * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
204 Delete request for the routing table has been accepted. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call deleteRoutingTableFromAreaCall( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = - "/v2alpha1/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables/{routingTableId}" - .replace( - "{" + "organizationId" + "}", - localVarApiClient.escapeString(organizationId.toString())) - .replace( - "{" + "areaId" + "}", - localVarApiClient.escapeString(areaId.toString())) - .replace( - "{" + "region" + "}", - localVarApiClient.escapeString(region.toString())) - .replace( - "{" + "routingTableId" + "}", - localVarApiClient.escapeString(routingTableId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "DELETE", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call deleteRoutingTableFromAreaValidateBeforeCall( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - final ApiCallback _callback) - throws ApiException { - // verify the required parameter 'organizationId' is set - if (organizationId == null) { - throw new ApiException( - "Missing the required parameter 'organizationId' when calling deleteRoutingTableFromArea(Async)"); - } - - // verify the required parameter 'areaId' is set - if (areaId == null) { - throw new ApiException( - "Missing the required parameter 'areaId' when calling deleteRoutingTableFromArea(Async)"); - } - - // verify the required parameter 'region' is set - if (region == null) { - throw new ApiException( - "Missing the required parameter 'region' when calling deleteRoutingTableFromArea(Async)"); - } - - // verify the required parameter 'routingTableId' is set - if (routingTableId == null) { - throw new ApiException( - "Missing the required parameter 'routingTableId' when calling deleteRoutingTableFromArea(Async)"); - } - - return deleteRoutingTableFromAreaCall( - organizationId, areaId, region, routingTableId, _callback); - } - - /** - * Delete a routing table. Delete a routing table of a network area. - * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
204 Delete request for the routing table has been accepted. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public void deleteRoutingTableFromArea( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId) - throws ApiException { - deleteRoutingTableFromAreaWithHttpInfo(organizationId, areaId, region, routingTableId); - } - - /** - * Delete a routing table. Delete a routing table of a network area. - * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @return ApiResponse<Void> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
204 Delete request for the routing table has been accepted. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public ApiResponse deleteRoutingTableFromAreaWithHttpInfo( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId) - throws ApiException { - okhttp3.Call localVarCall = - deleteRoutingTableFromAreaValidateBeforeCall( - organizationId, areaId, region, routingTableId, null); - return localVarApiClient.execute(localVarCall); - } - - /** - * Delete a routing table. (asynchronously) Delete a routing table of a network area. - * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
204 Delete request for the routing table has been accepted. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call deleteRoutingTableFromAreaAsync( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - deleteRoutingTableFromAreaValidateBeforeCall( - organizationId, areaId, region, routingTableId, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); - return localVarCall; - } - - /** - * Build call for deleteVPC - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
204 VPC has been deleted. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
409 A conflict has occurred. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call deleteVPCCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = - "/v2alpha1/projects/{projectId}/vpcs/{vpcId}" - .replace( - "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())) - .replace( - "{" + "vpcId" + "}", - localVarApiClient.escapeString(vpcId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "DELETE", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call deleteVPCValidateBeforeCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - final ApiCallback _callback) - throws ApiException { - // verify the required parameter 'projectId' is set - if (projectId == null) { - throw new ApiException( - "Missing the required parameter 'projectId' when calling deleteVPC(Async)"); - } - - // verify the required parameter 'vpcId' is set - if (vpcId == null) { - throw new ApiException( - "Missing the required parameter 'vpcId' when calling deleteVPC(Async)"); - } - - return deleteVPCCall(projectId, vpcId, _callback); - } - - /** - * Delete a VPC. Delete an existing VPC in a project. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
204 VPC has been deleted. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
409 A conflict has occurred. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public void deleteVPC( - @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID vpcId) - throws ApiException { - deleteVPCWithHttpInfo(projectId, vpcId); - } - - /** - * Delete a VPC. Delete an existing VPC in a project. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @return ApiResponse<Void> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
204 VPC has been deleted. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
409 A conflict has occurred. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public ApiResponse deleteVPCWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID vpcId) - throws ApiException { - okhttp3.Call localVarCall = deleteVPCValidateBeforeCall(projectId, vpcId, null); - return localVarApiClient.execute(localVarCall); - } - - /** - * Delete a VPC. (asynchronously) Delete an existing VPC in a project. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
204 VPC has been deleted. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
409 A conflict has occurred. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call deleteVPCAsync( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = deleteVPCValidateBeforeCall(projectId, vpcId, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); - return localVarCall; - } - - /** - * Build call for deleteVPCNetworkRange - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @param networkRangeId The identifier (ID) of a STACKIT Network Range. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
202 Delete request for network range has been accepted. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
409 A conflict has occurred. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call deleteVPCNetworkRangeCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID networkRangeId, - final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = - "/v2alpha1/projects/{projectId}/vpcs/{vpcId}/regions/{region}/network-ranges/{networkRangeId}" - .replace( - "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())) - .replace( - "{" + "vpcId" + "}", - localVarApiClient.escapeString(vpcId.toString())) - .replace( - "{" + "region" + "}", - localVarApiClient.escapeString(region.toString())) - .replace( - "{" + "networkRangeId" + "}", - localVarApiClient.escapeString(networkRangeId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "DELETE", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call deleteVPCNetworkRangeValidateBeforeCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID networkRangeId, - final ApiCallback _callback) - throws ApiException { - // verify the required parameter 'projectId' is set - if (projectId == null) { - throw new ApiException( - "Missing the required parameter 'projectId' when calling deleteVPCNetworkRange(Async)"); - } - - // verify the required parameter 'vpcId' is set - if (vpcId == null) { - throw new ApiException( - "Missing the required parameter 'vpcId' when calling deleteVPCNetworkRange(Async)"); - } - - // verify the required parameter 'region' is set - if (region == null) { - throw new ApiException( - "Missing the required parameter 'region' when calling deleteVPCNetworkRange(Async)"); - } - - // verify the required parameter 'networkRangeId' is set - if (networkRangeId == null) { - throw new ApiException( - "Missing the required parameter 'networkRangeId' when calling deleteVPCNetworkRange(Async)"); - } - - return deleteVPCNetworkRangeCall(projectId, vpcId, region, networkRangeId, _callback); - } - - /** - * Delete a regional network range. Delete a network range of a VPC for this region, if the - * network range is not used anymore. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @param networkRangeId The identifier (ID) of a STACKIT Network Range. (required) - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
202 Delete request for network range has been accepted. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
409 A conflict has occurred. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public void deleteVPCNetworkRange( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID networkRangeId) - throws ApiException { - deleteVPCNetworkRangeWithHttpInfo(projectId, vpcId, region, networkRangeId); - } - - /** - * Delete a regional network range. Delete a network range of a VPC for this region, if the - * network range is not used anymore. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @param networkRangeId The identifier (ID) of a STACKIT Network Range. (required) - * @return ApiResponse<Void> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
202 Delete request for network range has been accepted. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
409 A conflict has occurred. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public ApiResponse deleteVPCNetworkRangeWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID networkRangeId) - throws ApiException { - okhttp3.Call localVarCall = - deleteVPCNetworkRangeValidateBeforeCall( - projectId, vpcId, region, networkRangeId, null); - return localVarApiClient.execute(localVarCall); - } - - /** - * Delete a regional network range. (asynchronously) Delete a network range of a VPC for this - * region, if the network range is not used anymore. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @param networkRangeId The identifier (ID) of a STACKIT Network Range. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
202 Delete request for network range has been accepted. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
409 A conflict has occurred. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call deleteVPCNetworkRangeAsync( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID networkRangeId, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - deleteVPCNetworkRangeValidateBeforeCall( - projectId, vpcId, region, networkRangeId, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); - return localVarCall; - } - - /** - * Build call for deleteVPCRegion - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
202 Delete request for the regional VPC has been accepted. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
409 A conflict has occurred. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call deleteVPCRegionCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = - "/v2alpha1/projects/{projectId}/vpcs/{vpcId}/regions/{region}" - .replace( - "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())) - .replace( - "{" + "vpcId" + "}", - localVarApiClient.escapeString(vpcId.toString())) - .replace( - "{" + "region" + "}", - localVarApiClient.escapeString(region.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "DELETE", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call deleteVPCRegionValidateBeforeCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - final ApiCallback _callback) - throws ApiException { - // verify the required parameter 'projectId' is set - if (projectId == null) { - throw new ApiException( - "Missing the required parameter 'projectId' when calling deleteVPCRegion(Async)"); - } - - // verify the required parameter 'vpcId' is set - if (vpcId == null) { - throw new ApiException( - "Missing the required parameter 'vpcId' when calling deleteVPCRegion(Async)"); - } - - // verify the required parameter 'region' is set - if (region == null) { - throw new ApiException( - "Missing the required parameter 'region' when calling deleteVPCRegion(Async)"); - } - - return deleteVPCRegionCall(projectId, vpcId, region, _callback); - } - - /** - * Delete the regional configuration of a VPC. Delete the current configuration of a region for - * a VPC. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
202 Delete request for the regional VPC has been accepted. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
409 A conflict has occurred. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public void deleteVPCRegion( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region) - throws ApiException { - deleteVPCRegionWithHttpInfo(projectId, vpcId, region); - } - - /** - * Delete the regional configuration of a VPC. Delete the current configuration of a region for - * a VPC. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @return ApiResponse<Void> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
202 Delete request for the regional VPC has been accepted. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
409 A conflict has occurred. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public ApiResponse deleteVPCRegionWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region) - throws ApiException { - okhttp3.Call localVarCall = - deleteVPCRegionValidateBeforeCall(projectId, vpcId, region, null); - return localVarApiClient.execute(localVarCall); - } - - /** - * Delete the regional configuration of a VPC. (asynchronously) Delete the current configuration - * of a region for a VPC. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
202 Delete request for the regional VPC has been accepted. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
409 A conflict has occurred. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call deleteVPCRegionAsync( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - deleteVPCRegionValidateBeforeCall(projectId, vpcId, region, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); - return localVarCall; - } - - /** - * Build call for deleteVPCRoutingTable - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
204 Routingtable has been deleted. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call deleteVPCRoutingTableCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = - "/v2alpha1/projects/{projectId}/vpcs/{vpcId}/regions/{region}/routing-tables/{routingTableId}" - .replace( - "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())) - .replace( - "{" + "vpcId" + "}", - localVarApiClient.escapeString(vpcId.toString())) - .replace( - "{" + "region" + "}", - localVarApiClient.escapeString(region.toString())) - .replace( - "{" + "routingTableId" + "}", - localVarApiClient.escapeString(routingTableId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "DELETE", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call deleteVPCRoutingTableValidateBeforeCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - final ApiCallback _callback) - throws ApiException { - // verify the required parameter 'projectId' is set - if (projectId == null) { - throw new ApiException( - "Missing the required parameter 'projectId' when calling deleteVPCRoutingTable(Async)"); - } - - // verify the required parameter 'vpcId' is set - if (vpcId == null) { - throw new ApiException( - "Missing the required parameter 'vpcId' when calling deleteVPCRoutingTable(Async)"); - } - - // verify the required parameter 'region' is set - if (region == null) { - throw new ApiException( - "Missing the required parameter 'region' when calling deleteVPCRoutingTable(Async)"); - } - - // verify the required parameter 'routingTableId' is set - if (routingTableId == null) { - throw new ApiException( - "Missing the required parameter 'routingTableId' when calling deleteVPCRoutingTable(Async)"); - } - - return deleteVPCRoutingTableCall(projectId, vpcId, region, routingTableId, _callback); - } - - /** - * Delete a regional routing table. Delete a routing table of a VPC for this region. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
204 Routingtable has been deleted. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public void deleteVPCRoutingTable( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId) - throws ApiException { - deleteVPCRoutingTableWithHttpInfo(projectId, vpcId, region, routingTableId); - } - - /** - * Delete a regional routing table. Delete a routing table of a VPC for this region. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @return ApiResponse<Void> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
204 Routingtable has been deleted. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public ApiResponse deleteVPCRoutingTableWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId) - throws ApiException { - okhttp3.Call localVarCall = - deleteVPCRoutingTableValidateBeforeCall( - projectId, vpcId, region, routingTableId, null); - return localVarApiClient.execute(localVarCall); - } - - /** - * Delete a regional routing table. (asynchronously) Delete a routing table of a VPC for this - * region. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
204 Routingtable has been deleted. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call deleteVPCRoutingTableAsync( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - deleteVPCRoutingTableValidateBeforeCall( - projectId, vpcId, region, routingTableId, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); - return localVarCall; - } - - /** - * Build call for deleteVPCStaticRoute - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @param routeId The identifier (ID) of a STACKIT Route. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
204 Delete request for the static route has been accepted. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call deleteVPCStaticRouteCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - @javax.annotation.Nonnull UUID routeId, - final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = - "/v2alpha1/projects/{projectId}/vpcs/{vpcId}/regions/{region}/routing-tables/{routingTableId}/static-routes/{routeId}" - .replace( - "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())) - .replace( - "{" + "vpcId" + "}", - localVarApiClient.escapeString(vpcId.toString())) - .replace( - "{" + "region" + "}", - localVarApiClient.escapeString(region.toString())) - .replace( - "{" + "routingTableId" + "}", - localVarApiClient.escapeString(routingTableId.toString())) - .replace( - "{" + "routeId" + "}", - localVarApiClient.escapeString(routeId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "DELETE", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call deleteVPCStaticRouteValidateBeforeCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - @javax.annotation.Nonnull UUID routeId, - final ApiCallback _callback) - throws ApiException { - // verify the required parameter 'projectId' is set - if (projectId == null) { - throw new ApiException( - "Missing the required parameter 'projectId' when calling deleteVPCStaticRoute(Async)"); - } - - // verify the required parameter 'vpcId' is set - if (vpcId == null) { - throw new ApiException( - "Missing the required parameter 'vpcId' when calling deleteVPCStaticRoute(Async)"); - } - - // verify the required parameter 'region' is set - if (region == null) { - throw new ApiException( - "Missing the required parameter 'region' when calling deleteVPCStaticRoute(Async)"); - } - - // verify the required parameter 'routingTableId' is set - if (routingTableId == null) { - throw new ApiException( - "Missing the required parameter 'routingTableId' when calling deleteVPCStaticRoute(Async)"); - } - - // verify the required parameter 'routeId' is set - if (routeId == null) { - throw new ApiException( - "Missing the required parameter 'routeId' when calling deleteVPCStaticRoute(Async)"); - } - - return deleteVPCStaticRouteCall( - projectId, vpcId, region, routingTableId, routeId, _callback); - } - - /** - * Delete a regional static route. Delete a static route of a VPC for this region. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @param routeId The identifier (ID) of a STACKIT Route. (required) - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
204 Delete request for the static route has been accepted. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public void deleteVPCStaticRoute( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - @javax.annotation.Nonnull UUID routeId) - throws ApiException { - deleteVPCStaticRouteWithHttpInfo(projectId, vpcId, region, routingTableId, routeId); - } - - /** - * Delete a regional static route. Delete a static route of a VPC for this region. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @param routeId The identifier (ID) of a STACKIT Route. (required) - * @return ApiResponse<Void> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
204 Delete request for the static route has been accepted. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public ApiResponse deleteVPCStaticRouteWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - @javax.annotation.Nonnull UUID routeId) - throws ApiException { - okhttp3.Call localVarCall = - deleteVPCStaticRouteValidateBeforeCall( - projectId, vpcId, region, routingTableId, routeId, null); - return localVarApiClient.execute(localVarCall); - } - - /** - * Delete a regional static route. (asynchronously) Delete a static route of a VPC for this - * region. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @param routeId The identifier (ID) of a STACKIT Route. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
204 Delete request for the static route has been accepted. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call deleteVPCStaticRouteAsync( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - @javax.annotation.Nonnull UUID routeId, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - deleteVPCStaticRouteValidateBeforeCall( - projectId, vpcId, region, routingTableId, routeId, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); - return localVarCall; - } - - /** - * Build call for getNetwork - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param region The STACKIT Region of the resources. (required) - * @param networkId The identifier (ID) of a STACKIT Network. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Show network details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call getNetworkCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID networkId, - final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = - "/v2alpha1/projects/{projectId}/regions/{region}/networks/{networkId}" - .replace( - "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())) - .replace( - "{" + "region" + "}", - localVarApiClient.escapeString(region.toString())) - .replace( - "{" + "networkId" + "}", - localVarApiClient.escapeString(networkId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getNetworkValidateBeforeCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID networkId, - final ApiCallback _callback) - throws ApiException { - // verify the required parameter 'projectId' is set - if (projectId == null) { - throw new ApiException( - "Missing the required parameter 'projectId' when calling getNetwork(Async)"); - } - - // verify the required parameter 'region' is set - if (region == null) { - throw new ApiException( - "Missing the required parameter 'region' when calling getNetwork(Async)"); - } - - // verify the required parameter 'networkId' is set - if (networkId == null) { - throw new ApiException( - "Missing the required parameter 'networkId' when calling getNetwork(Async)"); - } - - return getNetworkCall(projectId, region, networkId, _callback); - } - - /** - * Get network details. Get details about a network of a project. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param region The STACKIT Region of the resources. (required) - * @param networkId The identifier (ID) of a STACKIT Network. (required) - * @return Network - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Show network details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public Network getNetwork( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID networkId) - throws ApiException { - ApiResponse localVarResp = getNetworkWithHttpInfo(projectId, region, networkId); - return localVarResp.getData(); - } - - /** - * Get network details. Get details about a network of a project. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param region The STACKIT Region of the resources. (required) - * @param networkId The identifier (ID) of a STACKIT Network. (required) - * @return ApiResponse<Network> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Show network details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public ApiResponse getNetworkWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID networkId) - throws ApiException { - okhttp3.Call localVarCall = - getNetworkValidateBeforeCall(projectId, region, networkId, null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get network details. (asynchronously) Get details about a network of a project. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param region The STACKIT Region of the resources. (required) - * @param networkId The identifier (ID) of a STACKIT Network. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Show network details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call getNetworkAsync( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID networkId, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - getNetworkValidateBeforeCall(projectId, region, networkId, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - - /** - * Build call for getPrefixList - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param region The STACKIT Region of the resources. (required) - * @param prefixListId The identifier (ID) of a STACKIT Prefix List. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Show prefix list details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call getPrefixListCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID prefixListId, - final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = - "/v2alpha1/projects/{projectId}/regions/{region}/prefix-lists/{prefixListId}" - .replace( - "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())) - .replace( - "{" + "region" + "}", - localVarApiClient.escapeString(region.toString())) - .replace( - "{" + "prefixListId" + "}", - localVarApiClient.escapeString(prefixListId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getPrefixListValidateBeforeCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID prefixListId, - final ApiCallback _callback) - throws ApiException { - // verify the required parameter 'projectId' is set - if (projectId == null) { - throw new ApiException( - "Missing the required parameter 'projectId' when calling getPrefixList(Async)"); - } - - // verify the required parameter 'region' is set - if (region == null) { - throw new ApiException( - "Missing the required parameter 'region' when calling getPrefixList(Async)"); - } - - // verify the required parameter 'prefixListId' is set - if (prefixListId == null) { - throw new ApiException( - "Missing the required parameter 'prefixListId' when calling getPrefixList(Async)"); - } - - return getPrefixListCall(projectId, region, prefixListId, _callback); - } - - /** - * Get prefix list details. Get details about a prefix list of a project. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param region The STACKIT Region of the resources. (required) - * @param prefixListId The identifier (ID) of a STACKIT Prefix List. (required) - * @return PrefixList - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Show prefix list details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public PrefixList getPrefixList( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID prefixListId) - throws ApiException { - ApiResponse localVarResp = - getPrefixListWithHttpInfo(projectId, region, prefixListId); - return localVarResp.getData(); - } - - /** - * Get prefix list details. Get details about a prefix list of a project. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param region The STACKIT Region of the resources. (required) - * @param prefixListId The identifier (ID) of a STACKIT Prefix List. (required) - * @return ApiResponse<PrefixList> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Show prefix list details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public ApiResponse getPrefixListWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID prefixListId) - throws ApiException { - okhttp3.Call localVarCall = - getPrefixListValidateBeforeCall(projectId, region, prefixListId, null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get prefix list details. (asynchronously) Get details about a prefix list of a project. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param region The STACKIT Region of the resources. (required) - * @param prefixListId The identifier (ID) of a STACKIT Prefix List. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Show prefix list details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call getPrefixListAsync( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID prefixListId, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - getPrefixListValidateBeforeCall(projectId, region, prefixListId, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - - /** - * Build call for getPrefixListEntries - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param region The STACKIT Region of the resources. (required) - * @param prefixListId The identifier (ID) of a STACKIT Prefix List. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Get prefix list entries was successful. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call getPrefixListEntriesCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID prefixListId, - final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = - "/v2alpha1/projects/{projectId}/regions/{region}/prefix-lists/{prefixListId}/entries" - .replace( - "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())) - .replace( - "{" + "region" + "}", - localVarApiClient.escapeString(region.toString())) - .replace( - "{" + "prefixListId" + "}", - localVarApiClient.escapeString(prefixListId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getPrefixListEntriesValidateBeforeCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID prefixListId, - final ApiCallback _callback) - throws ApiException { - // verify the required parameter 'projectId' is set - if (projectId == null) { - throw new ApiException( - "Missing the required parameter 'projectId' when calling getPrefixListEntries(Async)"); - } - - // verify the required parameter 'region' is set - if (region == null) { - throw new ApiException( - "Missing the required parameter 'region' when calling getPrefixListEntries(Async)"); - } - - // verify the required parameter 'prefixListId' is set - if (prefixListId == null) { - throw new ApiException( - "Missing the required parameter 'prefixListId' when calling getPrefixListEntries(Async)"); - } - - return getPrefixListEntriesCall(projectId, region, prefixListId, _callback); - } - - /** - * Get prefix list entries. Get the list of all CIDR entries in a prefix list. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param region The STACKIT Region of the resources. (required) - * @param prefixListId The identifier (ID) of a STACKIT Prefix List. (required) - * @return PrefixEntries - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Get prefix list entries was successful. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public PrefixEntries getPrefixListEntries( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID prefixListId) - throws ApiException { - ApiResponse localVarResp = - getPrefixListEntriesWithHttpInfo(projectId, region, prefixListId); - return localVarResp.getData(); - } - - /** - * Get prefix list entries. Get the list of all CIDR entries in a prefix list. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param region The STACKIT Region of the resources. (required) - * @param prefixListId The identifier (ID) of a STACKIT Prefix List. (required) - * @return ApiResponse<PrefixEntries> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Get prefix list entries was successful. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public ApiResponse getPrefixListEntriesWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID prefixListId) - throws ApiException { - okhttp3.Call localVarCall = - getPrefixListEntriesValidateBeforeCall(projectId, region, prefixListId, null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get prefix list entries. (asynchronously) Get the list of all CIDR entries in a prefix list. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param region The STACKIT Region of the resources. (required) - * @param prefixListId The identifier (ID) of a STACKIT Prefix List. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Get prefix list entries was successful. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call getPrefixListEntriesAsync( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID prefixListId, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - getPrefixListEntriesValidateBeforeCall(projectId, region, prefixListId, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - - /** - * Build call for getRouteOfRoutingTable - * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @param routeId The identifier (ID) of a STACKIT Route. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Show the details of a route in a routing table. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call getRouteOfRoutingTableCall( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - @javax.annotation.Nonnull UUID routeId, - final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = - "/v2alpha1/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables/{routingTableId}/routes/{routeId}" - .replace( - "{" + "organizationId" + "}", - localVarApiClient.escapeString(organizationId.toString())) - .replace( - "{" + "areaId" + "}", - localVarApiClient.escapeString(areaId.toString())) - .replace( - "{" + "region" + "}", - localVarApiClient.escapeString(region.toString())) - .replace( - "{" + "routingTableId" + "}", - localVarApiClient.escapeString(routingTableId.toString())) - .replace( - "{" + "routeId" + "}", - localVarApiClient.escapeString(routeId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getRouteOfRoutingTableValidateBeforeCall( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - @javax.annotation.Nonnull UUID routeId, - final ApiCallback _callback) - throws ApiException { - // verify the required parameter 'organizationId' is set - if (organizationId == null) { - throw new ApiException( - "Missing the required parameter 'organizationId' when calling getRouteOfRoutingTable(Async)"); - } - - // verify the required parameter 'areaId' is set - if (areaId == null) { - throw new ApiException( - "Missing the required parameter 'areaId' when calling getRouteOfRoutingTable(Async)"); - } - - // verify the required parameter 'region' is set - if (region == null) { - throw new ApiException( - "Missing the required parameter 'region' when calling getRouteOfRoutingTable(Async)"); - } - - // verify the required parameter 'routingTableId' is set - if (routingTableId == null) { - throw new ApiException( - "Missing the required parameter 'routingTableId' when calling getRouteOfRoutingTable(Async)"); - } - - // verify the required parameter 'routeId' is set - if (routeId == null) { - throw new ApiException( - "Missing the required parameter 'routeId' when calling getRouteOfRoutingTable(Async)"); - } - - return getRouteOfRoutingTableCall( - organizationId, areaId, region, routingTableId, routeId, _callback); - } - - /** - * Get details about a route of a routing table. Get details about a route defined in a routing - * table of a network area. - * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @param routeId The identifier (ID) of a STACKIT Route. (required) - * @return Route - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Show the details of a route in a routing table. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public Route getRouteOfRoutingTable( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - @javax.annotation.Nonnull UUID routeId) - throws ApiException { - ApiResponse localVarResp = - getRouteOfRoutingTableWithHttpInfo( - organizationId, areaId, region, routingTableId, routeId); - return localVarResp.getData(); - } - - /** - * Get details about a route of a routing table. Get details about a route defined in a routing - * table of a network area. - * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @param routeId The identifier (ID) of a STACKIT Route. (required) - * @return ApiResponse<Route> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Show the details of a route in a routing table. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public ApiResponse getRouteOfRoutingTableWithHttpInfo( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - @javax.annotation.Nonnull UUID routeId) - throws ApiException { - okhttp3.Call localVarCall = - getRouteOfRoutingTableValidateBeforeCall( - organizationId, areaId, region, routingTableId, routeId, null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get details about a route of a routing table. (asynchronously) Get details about a route - * defined in a routing table of a network area. - * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @param routeId The identifier (ID) of a STACKIT Route. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Show the details of a route in a routing table. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call getRouteOfRoutingTableAsync( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - @javax.annotation.Nonnull UUID routeId, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - getRouteOfRoutingTableValidateBeforeCall( - organizationId, areaId, region, routingTableId, routeId, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - - /** - * Build call for getRoutingTableOfArea - * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Show routing table details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call getRoutingTableOfAreaCall( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = - "/v2alpha1/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables/{routingTableId}" - .replace( - "{" + "organizationId" + "}", - localVarApiClient.escapeString(organizationId.toString())) - .replace( - "{" + "areaId" + "}", - localVarApiClient.escapeString(areaId.toString())) - .replace( - "{" + "region" + "}", - localVarApiClient.escapeString(region.toString())) - .replace( - "{" + "routingTableId" + "}", - localVarApiClient.escapeString(routingTableId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getRoutingTableOfAreaValidateBeforeCall( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - final ApiCallback _callback) - throws ApiException { - // verify the required parameter 'organizationId' is set - if (organizationId == null) { - throw new ApiException( - "Missing the required parameter 'organizationId' when calling getRoutingTableOfArea(Async)"); - } - - // verify the required parameter 'areaId' is set - if (areaId == null) { - throw new ApiException( - "Missing the required parameter 'areaId' when calling getRoutingTableOfArea(Async)"); - } - - // verify the required parameter 'region' is set - if (region == null) { - throw new ApiException( - "Missing the required parameter 'region' when calling getRoutingTableOfArea(Async)"); - } - - // verify the required parameter 'routingTableId' is set - if (routingTableId == null) { - throw new ApiException( - "Missing the required parameter 'routingTableId' when calling getRoutingTableOfArea(Async)"); - } - - return getRoutingTableOfAreaCall(organizationId, areaId, region, routingTableId, _callback); - } - - /** - * Get details about a routing table. Get details about a routing table defined in a network - * area. - * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @return RoutingTable - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Show routing table details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public RoutingTable getRoutingTableOfArea( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId) - throws ApiException { - ApiResponse localVarResp = - getRoutingTableOfAreaWithHttpInfo(organizationId, areaId, region, routingTableId); - return localVarResp.getData(); - } - - /** - * Get details about a routing table. Get details about a routing table defined in a network - * area. - * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @return ApiResponse<RoutingTable> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Show routing table details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public ApiResponse getRoutingTableOfAreaWithHttpInfo( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId) - throws ApiException { - okhttp3.Call localVarCall = - getRoutingTableOfAreaValidateBeforeCall( - organizationId, areaId, region, routingTableId, null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get details about a routing table. (asynchronously) Get details about a routing table defined - * in a network area. - * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Show routing table details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call getRoutingTableOfAreaAsync( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - getRoutingTableOfAreaValidateBeforeCall( - organizationId, areaId, region, routingTableId, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - - /** - * Build call for getVPC - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Show VPC details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call getVPCCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = - "/v2alpha1/projects/{projectId}/vpcs/{vpcId}" - .replace( - "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())) - .replace( - "{" + "vpcId" + "}", - localVarApiClient.escapeString(vpcId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getVPCValidateBeforeCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - final ApiCallback _callback) - throws ApiException { - // verify the required parameter 'projectId' is set - if (projectId == null) { - throw new ApiException( - "Missing the required parameter 'projectId' when calling getVPC(Async)"); - } - - // verify the required parameter 'vpcId' is set - if (vpcId == null) { - throw new ApiException( - "Missing the required parameter 'vpcId' when calling getVPC(Async)"); - } - - return getVPCCall(projectId, vpcId, _callback); - } - - /** - * Get details about a VPC. Get details about a VPC in a project. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @return VPC - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Show VPC details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public VPC getVPC( - @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID vpcId) - throws ApiException { - ApiResponse localVarResp = getVPCWithHttpInfo(projectId, vpcId); - return localVarResp.getData(); - } - - /** - * Get details about a VPC. Get details about a VPC in a project. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @return ApiResponse<VPC> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Show VPC details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public ApiResponse getVPCWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID vpcId) - throws ApiException { - okhttp3.Call localVarCall = getVPCValidateBeforeCall(projectId, vpcId, null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get details about a VPC. (asynchronously) Get details about a VPC in a project. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Show VPC details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call getVPCAsync( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = getVPCValidateBeforeCall(projectId, vpcId, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - - /** - * Build call for getVPCNetworkRange - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @param networkRangeId The identifier (ID) of a STACKIT Network Range. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Show network range details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call getVPCNetworkRangeCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID networkRangeId, - final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = - "/v2alpha1/projects/{projectId}/vpcs/{vpcId}/regions/{region}/network-ranges/{networkRangeId}" - .replace( - "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())) - .replace( - "{" + "vpcId" + "}", - localVarApiClient.escapeString(vpcId.toString())) - .replace( - "{" + "region" + "}", - localVarApiClient.escapeString(region.toString())) - .replace( - "{" + "networkRangeId" + "}", - localVarApiClient.escapeString(networkRangeId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getVPCNetworkRangeValidateBeforeCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID networkRangeId, - final ApiCallback _callback) - throws ApiException { - // verify the required parameter 'projectId' is set - if (projectId == null) { - throw new ApiException( - "Missing the required parameter 'projectId' when calling getVPCNetworkRange(Async)"); - } - - // verify the required parameter 'vpcId' is set - if (vpcId == null) { - throw new ApiException( - "Missing the required parameter 'vpcId' when calling getVPCNetworkRange(Async)"); - } - - // verify the required parameter 'region' is set - if (region == null) { - throw new ApiException( - "Missing the required parameter 'region' when calling getVPCNetworkRange(Async)"); - } - - // verify the required parameter 'networkRangeId' is set - if (networkRangeId == null) { - throw new ApiException( - "Missing the required parameter 'networkRangeId' when calling getVPCNetworkRange(Async)"); - } - - return getVPCNetworkRangeCall(projectId, vpcId, region, networkRangeId, _callback); - } - - /** - * Get details about a regional network range. Get details about a network range in a VPC for - * this region. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @param networkRangeId The identifier (ID) of a STACKIT Network Range. (required) - * @return VPCNetworkRange - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Show network range details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public VPCNetworkRange getVPCNetworkRange( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID networkRangeId) - throws ApiException { - ApiResponse localVarResp = - getVPCNetworkRangeWithHttpInfo(projectId, vpcId, region, networkRangeId); - return localVarResp.getData(); - } - - /** - * Get details about a regional network range. Get details about a network range in a VPC for - * this region. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @param networkRangeId The identifier (ID) of a STACKIT Network Range. (required) - * @return ApiResponse<VPCNetworkRange> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Show network range details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public ApiResponse getVPCNetworkRangeWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID networkRangeId) - throws ApiException { - okhttp3.Call localVarCall = - getVPCNetworkRangeValidateBeforeCall( - projectId, vpcId, region, networkRangeId, null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get details about a regional network range. (asynchronously) Get details about a network - * range in a VPC for this region. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @param networkRangeId The identifier (ID) of a STACKIT Network Range. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Show network range details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call getVPCNetworkRangeAsync( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID networkRangeId, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - getVPCNetworkRangeValidateBeforeCall( - projectId, vpcId, region, networkRangeId, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - - /** - * Build call for getVPCRegion - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Show the regional VPC configuration. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call getVPCRegionCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = - "/v2alpha1/projects/{projectId}/vpcs/{vpcId}/regions/{region}" - .replace( - "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())) - .replace( - "{" + "vpcId" + "}", - localVarApiClient.escapeString(vpcId.toString())) - .replace( - "{" + "region" + "}", - localVarApiClient.escapeString(region.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getVPCRegionValidateBeforeCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - final ApiCallback _callback) - throws ApiException { - // verify the required parameter 'projectId' is set - if (projectId == null) { - throw new ApiException( - "Missing the required parameter 'projectId' when calling getVPCRegion(Async)"); - } - - // verify the required parameter 'vpcId' is set - if (vpcId == null) { - throw new ApiException( - "Missing the required parameter 'vpcId' when calling getVPCRegion(Async)"); - } - - // verify the required parameter 'region' is set - if (region == null) { - throw new ApiException( - "Missing the required parameter 'region' when calling getVPCRegion(Async)"); - } - - return getVPCRegionCall(projectId, vpcId, region, _callback); - } - - /** - * Get the regional configuration of a VPC. Get the current configuration of a region for a VPC. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @return RegionalVPC - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Show the regional VPC configuration. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public RegionalVPC getVPCRegion( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region) - throws ApiException { - ApiResponse localVarResp = getVPCRegionWithHttpInfo(projectId, vpcId, region); - return localVarResp.getData(); - } - - /** - * Get the regional configuration of a VPC. Get the current configuration of a region for a VPC. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @return ApiResponse<RegionalVPC> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Show the regional VPC configuration. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public ApiResponse getVPCRegionWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region) - throws ApiException { - okhttp3.Call localVarCall = getVPCRegionValidateBeforeCall(projectId, vpcId, region, null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get the regional configuration of a VPC. (asynchronously) Get the current configuration of a - * region for a VPC. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Show the regional VPC configuration. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call getVPCRegionAsync( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - getVPCRegionValidateBeforeCall(projectId, vpcId, region, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - - /** - * Build call for getVPCRoutingTable - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Show routing table details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call getVPCRoutingTableCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = - "/v2alpha1/projects/{projectId}/vpcs/{vpcId}/regions/{region}/routing-tables/{routingTableId}" - .replace( - "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())) - .replace( - "{" + "vpcId" + "}", - localVarApiClient.escapeString(vpcId.toString())) - .replace( - "{" + "region" + "}", - localVarApiClient.escapeString(region.toString())) - .replace( - "{" + "routingTableId" + "}", - localVarApiClient.escapeString(routingTableId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getVPCRoutingTableValidateBeforeCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - final ApiCallback _callback) - throws ApiException { - // verify the required parameter 'projectId' is set - if (projectId == null) { - throw new ApiException( - "Missing the required parameter 'projectId' when calling getVPCRoutingTable(Async)"); - } - - // verify the required parameter 'vpcId' is set - if (vpcId == null) { - throw new ApiException( - "Missing the required parameter 'vpcId' when calling getVPCRoutingTable(Async)"); - } - - // verify the required parameter 'region' is set - if (region == null) { - throw new ApiException( - "Missing the required parameter 'region' when calling getVPCRoutingTable(Async)"); - } - - // verify the required parameter 'routingTableId' is set - if (routingTableId == null) { - throw new ApiException( - "Missing the required parameter 'routingTableId' when calling getVPCRoutingTable(Async)"); - } - - return getVPCRoutingTableCall(projectId, vpcId, region, routingTableId, _callback); - } - - /** - * Get details about a regional routing table. Get details about a routing table of a VPC for - * this region. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @return VPCRoutingTable - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Show routing table details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public VPCRoutingTable getVPCRoutingTable( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId) - throws ApiException { - ApiResponse localVarResp = - getVPCRoutingTableWithHttpInfo(projectId, vpcId, region, routingTableId); - return localVarResp.getData(); - } - - /** - * Get details about a regional routing table. Get details about a routing table of a VPC for - * this region. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @return ApiResponse<VPCRoutingTable> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Show routing table details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public ApiResponse getVPCRoutingTableWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId) - throws ApiException { - okhttp3.Call localVarCall = - getVPCRoutingTableValidateBeforeCall( - projectId, vpcId, region, routingTableId, null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get details about a regional routing table. (asynchronously) Get details about a routing - * table of a VPC for this region. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Show routing table details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call getVPCRoutingTableAsync( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - getVPCRoutingTableValidateBeforeCall( - projectId, vpcId, region, routingTableId, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - - /** - * Build call for getVPCStaticRoute - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @param routeId The identifier (ID) of a STACKIT Route. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Show static route details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call getVPCStaticRouteCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - @javax.annotation.Nonnull UUID routeId, - final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = - "/v2alpha1/projects/{projectId}/vpcs/{vpcId}/regions/{region}/routing-tables/{routingTableId}/static-routes/{routeId}" - .replace( - "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())) - .replace( - "{" + "vpcId" + "}", - localVarApiClient.escapeString(vpcId.toString())) - .replace( - "{" + "region" + "}", - localVarApiClient.escapeString(region.toString())) - .replace( - "{" + "routingTableId" + "}", - localVarApiClient.escapeString(routingTableId.toString())) - .replace( - "{" + "routeId" + "}", - localVarApiClient.escapeString(routeId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getVPCStaticRouteValidateBeforeCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - @javax.annotation.Nonnull UUID routeId, - final ApiCallback _callback) - throws ApiException { - // verify the required parameter 'projectId' is set - if (projectId == null) { - throw new ApiException( - "Missing the required parameter 'projectId' when calling getVPCStaticRoute(Async)"); - } - - // verify the required parameter 'vpcId' is set - if (vpcId == null) { - throw new ApiException( - "Missing the required parameter 'vpcId' when calling getVPCStaticRoute(Async)"); - } - - // verify the required parameter 'region' is set - if (region == null) { - throw new ApiException( - "Missing the required parameter 'region' when calling getVPCStaticRoute(Async)"); - } - - // verify the required parameter 'routingTableId' is set - if (routingTableId == null) { - throw new ApiException( - "Missing the required parameter 'routingTableId' when calling getVPCStaticRoute(Async)"); - } - - // verify the required parameter 'routeId' is set - if (routeId == null) { - throw new ApiException( - "Missing the required parameter 'routeId' when calling getVPCStaticRoute(Async)"); - } - - return getVPCStaticRouteCall(projectId, vpcId, region, routingTableId, routeId, _callback); - } - - /** - * Get details about a regional static route. Get details about a static route of a VPC for this - * region. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @param routeId The identifier (ID) of a STACKIT Route. (required) - * @return Route - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Show static route details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public Route getVPCStaticRoute( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - @javax.annotation.Nonnull UUID routeId) - throws ApiException { - ApiResponse localVarResp = - getVPCStaticRouteWithHttpInfo(projectId, vpcId, region, routingTableId, routeId); - return localVarResp.getData(); - } - - /** - * Get details about a regional static route. Get details about a static route of a VPC for this - * region. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @param routeId The identifier (ID) of a STACKIT Route. (required) - * @return ApiResponse<Route> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Show static route details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public ApiResponse getVPCStaticRouteWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - @javax.annotation.Nonnull UUID routeId) - throws ApiException { - okhttp3.Call localVarCall = - getVPCStaticRouteValidateBeforeCall( - projectId, vpcId, region, routingTableId, routeId, null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get details about a regional static route. (asynchronously) Get details about a static route - * of a VPC for this region. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @param routeId The identifier (ID) of a STACKIT Route. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Show static route details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call getVPCStaticRouteAsync( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - @javax.annotation.Nonnull UUID routeId, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - getVPCStaticRouteValidateBeforeCall( - projectId, vpcId, region, routingTableId, routeId, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - - /** - * Build call for listAllRoutesOfRoutingTable - * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @param filter Filter resources by fields. A subset of expr-lang is supported. See - * https://expr-lang.org/docs/language-definition for usage details. (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 List all routes of a routing table including system, dynamic, service and static routes. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call listAllRoutesOfRoutingTableCall( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - @javax.annotation.Nullable String filter, - final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = - "/v2alpha1/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables/{routingTableId}/all-routes" - .replace( - "{" + "organizationId" + "}", - localVarApiClient.escapeString(organizationId.toString())) - .replace( - "{" + "areaId" + "}", - localVarApiClient.escapeString(areaId.toString())) - .replace( - "{" + "region" + "}", - localVarApiClient.escapeString(region.toString())) - .replace( - "{" + "routingTableId" + "}", - localVarApiClient.escapeString(routingTableId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (filter != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("filter", filter)); - } - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call listAllRoutesOfRoutingTableValidateBeforeCall( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - @javax.annotation.Nullable String filter, - final ApiCallback _callback) - throws ApiException { - // verify the required parameter 'organizationId' is set - if (organizationId == null) { - throw new ApiException( - "Missing the required parameter 'organizationId' when calling listAllRoutesOfRoutingTable(Async)"); - } - - // verify the required parameter 'areaId' is set - if (areaId == null) { - throw new ApiException( - "Missing the required parameter 'areaId' when calling listAllRoutesOfRoutingTable(Async)"); - } - - // verify the required parameter 'region' is set - if (region == null) { - throw new ApiException( - "Missing the required parameter 'region' when calling listAllRoutesOfRoutingTable(Async)"); - } - - // verify the required parameter 'routingTableId' is set - if (routingTableId == null) { - throw new ApiException( - "Missing the required parameter 'routingTableId' when calling listAllRoutesOfRoutingTable(Async)"); - } - - return listAllRoutesOfRoutingTableCall( - organizationId, areaId, region, routingTableId, filter, _callback); - } - - /** - * List all routes of a routing table. Get a list of all routes in a routing table including - * system, dynamic, service and static routes. - * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @param filter Filter resources by fields. A subset of expr-lang is supported. See - * https://expr-lang.org/docs/language-definition for usage details. (optional) - * @return AllRouteListResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 List all routes of a routing table including system, dynamic, service and static routes. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public AllRouteListResponse listAllRoutesOfRoutingTable( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - @javax.annotation.Nullable String filter) - throws ApiException { - ApiResponse localVarResp = - listAllRoutesOfRoutingTableWithHttpInfo( - organizationId, areaId, region, routingTableId, filter); - return localVarResp.getData(); - } - - /** - * List all routes of a routing table. Get a list of all routes in a routing table including - * system, dynamic, service and static routes. - * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @param filter Filter resources by fields. A subset of expr-lang is supported. See - * https://expr-lang.org/docs/language-definition for usage details. (optional) - * @return ApiResponse<AllRouteListResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 List all routes of a routing table including system, dynamic, service and static routes. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public ApiResponse listAllRoutesOfRoutingTableWithHttpInfo( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - @javax.annotation.Nullable String filter) - throws ApiException { - okhttp3.Call localVarCall = - listAllRoutesOfRoutingTableValidateBeforeCall( - organizationId, areaId, region, routingTableId, filter, null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * List all routes of a routing table. (asynchronously) Get a list of all routes in a routing - * table including system, dynamic, service and static routes. - * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @param filter Filter resources by fields. A subset of expr-lang is supported. See - * https://expr-lang.org/docs/language-definition for usage details. (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 List all routes of a routing table including system, dynamic, service and static routes. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call listAllRoutesOfRoutingTableAsync( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - @javax.annotation.Nullable String filter, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - listAllRoutesOfRoutingTableValidateBeforeCall( - organizationId, areaId, region, routingTableId, filter, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - - /** - * Build call for listNetworks - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param region The STACKIT Region of the resources. (required) - * @param labelSelector Filter resources by labels. (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 List all networks of a project. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call listNetworksCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nullable String labelSelector, - final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = - "/v2alpha1/projects/{projectId}/regions/{region}/networks" - .replace( - "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())) - .replace( - "{" + "region" + "}", - localVarApiClient.escapeString(region.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (labelSelector != null) { - localVarQueryParams.addAll( - localVarApiClient.parameterToPair("label_selector", labelSelector)); - } - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call listNetworksValidateBeforeCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nullable String labelSelector, - final ApiCallback _callback) - throws ApiException { - // verify the required parameter 'projectId' is set - if (projectId == null) { - throw new ApiException( - "Missing the required parameter 'projectId' when calling listNetworks(Async)"); - } - - // verify the required parameter 'region' is set - if (region == null) { - throw new ApiException( - "Missing the required parameter 'region' when calling listNetworks(Async)"); - } - - return listNetworksCall(projectId, region, labelSelector, _callback); - } - - /** - * List all networks inside a project. Get a list of all networks inside a project. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param region The STACKIT Region of the resources. (required) - * @param labelSelector Filter resources by labels. (optional) - * @return NetworkListResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 List all networks of a project. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public NetworkListResponse listNetworks( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nullable String labelSelector) - throws ApiException { - ApiResponse localVarResp = - listNetworksWithHttpInfo(projectId, region, labelSelector); - return localVarResp.getData(); - } - - /** - * List all networks inside a project. Get a list of all networks inside a project. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param region The STACKIT Region of the resources. (required) - * @param labelSelector Filter resources by labels. (optional) - * @return ApiResponse<NetworkListResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 List all networks of a project. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public ApiResponse listNetworksWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nullable String labelSelector) - throws ApiException { - okhttp3.Call localVarCall = - listNetworksValidateBeforeCall(projectId, region, labelSelector, null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * List all networks inside a project. (asynchronously) Get a list of all networks inside a - * project. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param region The STACKIT Region of the resources. (required) - * @param labelSelector Filter resources by labels. (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 List all networks of a project. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call listNetworksAsync( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nullable String labelSelector, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - listNetworksValidateBeforeCall(projectId, region, labelSelector, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - - /** - * Build call for listNetworksOfRoutingTable - * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 List all routing table networks. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call listNetworksOfRoutingTableCall( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = - "/v2alpha1/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables/{routingTableId}/networks" - .replace( - "{" + "organizationId" + "}", - localVarApiClient.escapeString(organizationId.toString())) - .replace( - "{" + "areaId" + "}", - localVarApiClient.escapeString(areaId.toString())) - .replace( - "{" + "region" + "}", - localVarApiClient.escapeString(region.toString())) - .replace( - "{" + "routingTableId" + "}", - localVarApiClient.escapeString(routingTableId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call listNetworksOfRoutingTableValidateBeforeCall( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - final ApiCallback _callback) - throws ApiException { - // verify the required parameter 'organizationId' is set - if (organizationId == null) { - throw new ApiException( - "Missing the required parameter 'organizationId' when calling listNetworksOfRoutingTable(Async)"); - } - - // verify the required parameter 'areaId' is set - if (areaId == null) { - throw new ApiException( - "Missing the required parameter 'areaId' when calling listNetworksOfRoutingTable(Async)"); - } - - // verify the required parameter 'region' is set - if (region == null) { - throw new ApiException( - "Missing the required parameter 'region' when calling listNetworksOfRoutingTable(Async)"); - } - - // verify the required parameter 'routingTableId' is set - if (routingTableId == null) { - throw new ApiException( - "Missing the required parameter 'routingTableId' when calling listNetworksOfRoutingTable(Async)"); - } - - return listNetworksOfRoutingTableCall( - organizationId, areaId, region, routingTableId, _callback); - } - - /** - * List all networks in a routing table. Get a list of all networks in a routing table of a - * network area. - * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @return NetworkListResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 List all routing table networks. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public NetworkListResponse listNetworksOfRoutingTable( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId) - throws ApiException { - ApiResponse localVarResp = - listNetworksOfRoutingTableWithHttpInfo( - organizationId, areaId, region, routingTableId); - return localVarResp.getData(); - } - - /** - * List all networks in a routing table. Get a list of all networks in a routing table of a - * network area. - * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @return ApiResponse<NetworkListResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 List all routing table networks. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public ApiResponse listNetworksOfRoutingTableWithHttpInfo( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId) - throws ApiException { - okhttp3.Call localVarCall = - listNetworksOfRoutingTableValidateBeforeCall( - organizationId, areaId, region, routingTableId, null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * List all networks in a routing table. (asynchronously) Get a list of all networks in a - * routing table of a network area. - * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 List all routing table networks. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call listNetworksOfRoutingTableAsync( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - listNetworksOfRoutingTableValidateBeforeCall( - organizationId, areaId, region, routingTableId, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - - /** - * Build call for listPrefixLists - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param region The STACKIT Region of the resources. (required) - * @param labelSelector Filter resources by labels. (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 List all prefix lists of a project. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call listPrefixListsCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nullable String labelSelector, - final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = - "/v2alpha1/projects/{projectId}/regions/{region}/prefix-lists" - .replace( - "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())) - .replace( - "{" + "region" + "}", - localVarApiClient.escapeString(region.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (labelSelector != null) { - localVarQueryParams.addAll( - localVarApiClient.parameterToPair("label_selector", labelSelector)); - } - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call listPrefixListsValidateBeforeCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nullable String labelSelector, - final ApiCallback _callback) - throws ApiException { - // verify the required parameter 'projectId' is set - if (projectId == null) { - throw new ApiException( - "Missing the required parameter 'projectId' when calling listPrefixLists(Async)"); - } - - // verify the required parameter 'region' is set - if (region == null) { - throw new ApiException( - "Missing the required parameter 'region' when calling listPrefixLists(Async)"); - } - - return listPrefixListsCall(projectId, region, labelSelector, _callback); - } - - /** - * List all prefix lists inside a project. Get a list of all prefix lists inside a project. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param region The STACKIT Region of the resources. (required) - * @param labelSelector Filter resources by labels. (optional) - * @return PrefixListListResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 List all prefix lists of a project. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public PrefixListListResponse listPrefixLists( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nullable String labelSelector) - throws ApiException { - ApiResponse localVarResp = - listPrefixListsWithHttpInfo(projectId, region, labelSelector); - return localVarResp.getData(); - } - - /** - * List all prefix lists inside a project. Get a list of all prefix lists inside a project. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param region The STACKIT Region of the resources. (required) - * @param labelSelector Filter resources by labels. (optional) - * @return ApiResponse<PrefixListListResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 List all prefix lists of a project. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public ApiResponse listPrefixListsWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nullable String labelSelector) - throws ApiException { - okhttp3.Call localVarCall = - listPrefixListsValidateBeforeCall(projectId, region, labelSelector, null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * List all prefix lists inside a project. (asynchronously) Get a list of all prefix lists - * inside a project. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param region The STACKIT Region of the resources. (required) - * @param labelSelector Filter resources by labels. (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 List all prefix lists of a project. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call listPrefixListsAsync( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nullable String labelSelector, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - listPrefixListsValidateBeforeCall(projectId, region, labelSelector, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - - /** - * Build call for listRoutesOfRoutingTable - * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @param labelSelector Filter resources by labels. (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 List all routing table routes. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call listRoutesOfRoutingTableCall( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - @javax.annotation.Nullable String labelSelector, - final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = - "/v2alpha1/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables/{routingTableId}/routes" - .replace( - "{" + "organizationId" + "}", - localVarApiClient.escapeString(organizationId.toString())) - .replace( - "{" + "areaId" + "}", - localVarApiClient.escapeString(areaId.toString())) - .replace( - "{" + "region" + "}", - localVarApiClient.escapeString(region.toString())) - .replace( - "{" + "routingTableId" + "}", - localVarApiClient.escapeString(routingTableId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (labelSelector != null) { - localVarQueryParams.addAll( - localVarApiClient.parameterToPair("label_selector", labelSelector)); - } - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call listRoutesOfRoutingTableValidateBeforeCall( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - @javax.annotation.Nullable String labelSelector, - final ApiCallback _callback) - throws ApiException { - // verify the required parameter 'organizationId' is set - if (organizationId == null) { - throw new ApiException( - "Missing the required parameter 'organizationId' when calling listRoutesOfRoutingTable(Async)"); - } - - // verify the required parameter 'areaId' is set - if (areaId == null) { - throw new ApiException( - "Missing the required parameter 'areaId' when calling listRoutesOfRoutingTable(Async)"); - } - - // verify the required parameter 'region' is set - if (region == null) { - throw new ApiException( - "Missing the required parameter 'region' when calling listRoutesOfRoutingTable(Async)"); - } - - // verify the required parameter 'routingTableId' is set - if (routingTableId == null) { - throw new ApiException( - "Missing the required parameter 'routingTableId' when calling listRoutesOfRoutingTable(Async)"); - } - - return listRoutesOfRoutingTableCall( - organizationId, areaId, region, routingTableId, labelSelector, _callback); - } - - /** - * List all routes in a routing table. Get a list of all routes in a routing table of a network - * area. - * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @param labelSelector Filter resources by labels. (optional) - * @return RouteListResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 List all routing table routes. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public RouteListResponse listRoutesOfRoutingTable( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - @javax.annotation.Nullable String labelSelector) - throws ApiException { - ApiResponse localVarResp = - listRoutesOfRoutingTableWithHttpInfo( - organizationId, areaId, region, routingTableId, labelSelector); - return localVarResp.getData(); - } - - /** - * List all routes in a routing table. Get a list of all routes in a routing table of a network - * area. - * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @param labelSelector Filter resources by labels. (optional) - * @return ApiResponse<RouteListResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 List all routing table routes. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public ApiResponse listRoutesOfRoutingTableWithHttpInfo( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - @javax.annotation.Nullable String labelSelector) - throws ApiException { - okhttp3.Call localVarCall = - listRoutesOfRoutingTableValidateBeforeCall( - organizationId, areaId, region, routingTableId, labelSelector, null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * List all routes in a routing table. (asynchronously) Get a list of all routes in a routing - * table of a network area. - * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @param labelSelector Filter resources by labels. (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 List all routing table routes. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call listRoutesOfRoutingTableAsync( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - @javax.annotation.Nullable String labelSelector, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - listRoutesOfRoutingTableValidateBeforeCall( - organizationId, areaId, region, routingTableId, labelSelector, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - - /** - * Build call for listRoutingTablesOfArea - * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param region The STACKIT Region of the resources. (required) - * @param labelSelector Filter resources by labels. (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 List all routing tables. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call listRoutingTablesOfAreaCall( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nullable String labelSelector, - final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = - "/v2alpha1/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables" - .replace( - "{" + "organizationId" + "}", - localVarApiClient.escapeString(organizationId.toString())) - .replace( - "{" + "areaId" + "}", - localVarApiClient.escapeString(areaId.toString())) - .replace( - "{" + "region" + "}", - localVarApiClient.escapeString(region.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (labelSelector != null) { - localVarQueryParams.addAll( - localVarApiClient.parameterToPair("label_selector", labelSelector)); - } - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call listRoutingTablesOfAreaValidateBeforeCall( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nullable String labelSelector, - final ApiCallback _callback) - throws ApiException { - // verify the required parameter 'organizationId' is set - if (organizationId == null) { - throw new ApiException( - "Missing the required parameter 'organizationId' when calling listRoutingTablesOfArea(Async)"); - } - - // verify the required parameter 'areaId' is set - if (areaId == null) { - throw new ApiException( - "Missing the required parameter 'areaId' when calling listRoutingTablesOfArea(Async)"); - } - - // verify the required parameter 'region' is set - if (region == null) { - throw new ApiException( - "Missing the required parameter 'region' when calling listRoutingTablesOfArea(Async)"); - } - - return listRoutingTablesOfAreaCall( - organizationId, areaId, region, labelSelector, _callback); - } - - /** - * List all routing tables in a network area. Get a list of all routing tables in a network - * area. - * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param region The STACKIT Region of the resources. (required) - * @param labelSelector Filter resources by labels. (optional) - * @return RoutingTableListResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 List all routing tables. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public RoutingTableListResponse listRoutingTablesOfArea( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nullable String labelSelector) - throws ApiException { - ApiResponse localVarResp = - listRoutingTablesOfAreaWithHttpInfo(organizationId, areaId, region, labelSelector); - return localVarResp.getData(); - } - - /** - * List all routing tables in a network area. Get a list of all routing tables in a network - * area. - * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param region The STACKIT Region of the resources. (required) - * @param labelSelector Filter resources by labels. (optional) - * @return ApiResponse<RoutingTableListResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 List all routing tables. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public ApiResponse listRoutingTablesOfAreaWithHttpInfo( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nullable String labelSelector) - throws ApiException { - okhttp3.Call localVarCall = - listRoutingTablesOfAreaValidateBeforeCall( - organizationId, areaId, region, labelSelector, null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * List all routing tables in a network area. (asynchronously) Get a list of all routing tables - * in a network area. - * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param region The STACKIT Region of the resources. (required) - * @param labelSelector Filter resources by labels. (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 List all routing tables. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call listRoutingTablesOfAreaAsync( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nullable String labelSelector, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - listRoutingTablesOfAreaValidateBeforeCall( - organizationId, areaId, region, labelSelector, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - - /** - * Build call for listVPCNetworkRanges - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @param labelSelector Filter resources by labels. (optional) - * @param filter Filter resources by fields. A subset of expr-lang is supported. See - * https://expr-lang.org/docs/language-definition for usage details. (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 List all network ranges. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call listVPCNetworkRangesCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nullable String labelSelector, - @javax.annotation.Nullable String filter, - final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = - "/v2alpha1/projects/{projectId}/vpcs/{vpcId}/regions/{region}/network-ranges" - .replace( - "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())) - .replace( - "{" + "vpcId" + "}", - localVarApiClient.escapeString(vpcId.toString())) - .replace( - "{" + "region" + "}", - localVarApiClient.escapeString(region.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (labelSelector != null) { - localVarQueryParams.addAll( - localVarApiClient.parameterToPair("label_selector", labelSelector)); - } - - if (filter != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("filter", filter)); - } - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call listVPCNetworkRangesValidateBeforeCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nullable String labelSelector, - @javax.annotation.Nullable String filter, - final ApiCallback _callback) - throws ApiException { - // verify the required parameter 'projectId' is set - if (projectId == null) { - throw new ApiException( - "Missing the required parameter 'projectId' when calling listVPCNetworkRanges(Async)"); - } - - // verify the required parameter 'vpcId' is set - if (vpcId == null) { - throw new ApiException( - "Missing the required parameter 'vpcId' when calling listVPCNetworkRanges(Async)"); - } - - // verify the required parameter 'region' is set - if (region == null) { - throw new ApiException( - "Missing the required parameter 'region' when calling listVPCNetworkRanges(Async)"); - } - - return listVPCNetworkRangesCall(projectId, vpcId, region, labelSelector, filter, _callback); - } - - /** - * List all regional network ranges in a VPC. Get a list of all network ranges in a VPC for this - * region. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @param labelSelector Filter resources by labels. (optional) - * @param filter Filter resources by fields. A subset of expr-lang is supported. See - * https://expr-lang.org/docs/language-definition for usage details. (optional) - * @return VPCNetworkRangeList - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 List all network ranges. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public VPCNetworkRangeList listVPCNetworkRanges( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nullable String labelSelector, - @javax.annotation.Nullable String filter) - throws ApiException { - ApiResponse localVarResp = - listVPCNetworkRangesWithHttpInfo(projectId, vpcId, region, labelSelector, filter); - return localVarResp.getData(); - } - - /** - * List all regional network ranges in a VPC. Get a list of all network ranges in a VPC for this - * region. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @param labelSelector Filter resources by labels. (optional) - * @param filter Filter resources by fields. A subset of expr-lang is supported. See - * https://expr-lang.org/docs/language-definition for usage details. (optional) - * @return ApiResponse<VPCNetworkRangeList> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 List all network ranges. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public ApiResponse listVPCNetworkRangesWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nullable String labelSelector, - @javax.annotation.Nullable String filter) - throws ApiException { - okhttp3.Call localVarCall = - listVPCNetworkRangesValidateBeforeCall( - projectId, vpcId, region, labelSelector, filter, null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * List all regional network ranges in a VPC. (asynchronously) Get a list of all network ranges - * in a VPC for this region. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @param labelSelector Filter resources by labels. (optional) - * @param filter Filter resources by fields. A subset of expr-lang is supported. See - * https://expr-lang.org/docs/language-definition for usage details. (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 List all network ranges. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call listVPCNetworkRangesAsync( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nullable String labelSelector, - @javax.annotation.Nullable String filter, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - listVPCNetworkRangesValidateBeforeCall( - projectId, vpcId, region, labelSelector, filter, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - - /** - * Build call for listVPCRegions - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 List all configured VPC regions. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call listVPCRegionsCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = - "/v2alpha1/projects/{projectId}/vpcs/{vpcId}/regions" - .replace( - "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())) - .replace( - "{" + "vpcId" + "}", - localVarApiClient.escapeString(vpcId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call listVPCRegionsValidateBeforeCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - final ApiCallback _callback) - throws ApiException { - // verify the required parameter 'projectId' is set - if (projectId == null) { - throw new ApiException( - "Missing the required parameter 'projectId' when calling listVPCRegions(Async)"); - } - - // verify the required parameter 'vpcId' is set - if (vpcId == null) { - throw new ApiException( - "Missing the required parameter 'vpcId' when calling listVPCRegions(Async)"); - } - - return listVPCRegionsCall(projectId, vpcId, _callback); - } - - /** - * List all configured regions in a VPC. Get a list of all configured regions in a VPC. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @return RegionalVPCList - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 List all configured VPC regions. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public RegionalVPCList listVPCRegions( - @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID vpcId) - throws ApiException { - ApiResponse localVarResp = listVPCRegionsWithHttpInfo(projectId, vpcId); - return localVarResp.getData(); - } - - /** - * List all configured regions in a VPC. Get a list of all configured regions in a VPC. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @return ApiResponse<RegionalVPCList> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 List all configured VPC regions. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public ApiResponse listVPCRegionsWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID vpcId) - throws ApiException { - okhttp3.Call localVarCall = listVPCRegionsValidateBeforeCall(projectId, vpcId, null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * List all configured regions in a VPC. (asynchronously) Get a list of all configured regions - * in a VPC. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 List all configured VPC regions. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call listVPCRegionsAsync( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = listVPCRegionsValidateBeforeCall(projectId, vpcId, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - - /** - * Build call for listVPCRoutingTables - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @param labelSelector Filter resources by labels. (optional) - * @param filter Filter resources by fields. A subset of expr-lang is supported. See - * https://expr-lang.org/docs/language-definition for usage details. (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 List all routing tables. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call listVPCRoutingTablesCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nullable String labelSelector, - @javax.annotation.Nullable String filter, - final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = - "/v2alpha1/projects/{projectId}/vpcs/{vpcId}/regions/{region}/routing-tables" - .replace( - "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())) - .replace( - "{" + "vpcId" + "}", - localVarApiClient.escapeString(vpcId.toString())) - .replace( - "{" + "region" + "}", - localVarApiClient.escapeString(region.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (labelSelector != null) { - localVarQueryParams.addAll( - localVarApiClient.parameterToPair("label_selector", labelSelector)); - } - - if (filter != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("filter", filter)); - } - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call listVPCRoutingTablesValidateBeforeCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nullable String labelSelector, - @javax.annotation.Nullable String filter, - final ApiCallback _callback) - throws ApiException { - // verify the required parameter 'projectId' is set - if (projectId == null) { - throw new ApiException( - "Missing the required parameter 'projectId' when calling listVPCRoutingTables(Async)"); - } - - // verify the required parameter 'vpcId' is set - if (vpcId == null) { - throw new ApiException( - "Missing the required parameter 'vpcId' when calling listVPCRoutingTables(Async)"); - } - - // verify the required parameter 'region' is set - if (region == null) { - throw new ApiException( - "Missing the required parameter 'region' when calling listVPCRoutingTables(Async)"); - } - - return listVPCRoutingTablesCall(projectId, vpcId, region, labelSelector, filter, _callback); - } - - /** - * List all regional routing tables in a VPC. Get a list of all routing tables in a VPC for this - * region. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @param labelSelector Filter resources by labels. (optional) - * @param filter Filter resources by fields. A subset of expr-lang is supported. See - * https://expr-lang.org/docs/language-definition for usage details. (optional) - * @return VPCRoutingTableList - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 List all routing tables. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public VPCRoutingTableList listVPCRoutingTables( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nullable String labelSelector, - @javax.annotation.Nullable String filter) - throws ApiException { - ApiResponse localVarResp = - listVPCRoutingTablesWithHttpInfo(projectId, vpcId, region, labelSelector, filter); - return localVarResp.getData(); - } - - /** - * List all regional routing tables in a VPC. Get a list of all routing tables in a VPC for this - * region. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @param labelSelector Filter resources by labels. (optional) - * @param filter Filter resources by fields. A subset of expr-lang is supported. See - * https://expr-lang.org/docs/language-definition for usage details. (optional) - * @return ApiResponse<VPCRoutingTableList> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 List all routing tables. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public ApiResponse listVPCRoutingTablesWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nullable String labelSelector, - @javax.annotation.Nullable String filter) - throws ApiException { - okhttp3.Call localVarCall = - listVPCRoutingTablesValidateBeforeCall( - projectId, vpcId, region, labelSelector, filter, null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * List all regional routing tables in a VPC. (asynchronously) Get a list of all routing tables - * in a VPC for this region. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @param labelSelector Filter resources by labels. (optional) - * @param filter Filter resources by fields. A subset of expr-lang is supported. See - * https://expr-lang.org/docs/language-definition for usage details. (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 List all routing tables. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call listVPCRoutingTablesAsync( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nullable String labelSelector, - @javax.annotation.Nullable String filter, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - listVPCRoutingTablesValidateBeforeCall( - projectId, vpcId, region, labelSelector, filter, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - - /** - * Build call for listVPCStaticRoutes - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @param labelSelector Filter resources by labels. (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 List all static routes. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call listVPCStaticRoutesCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - @javax.annotation.Nullable String labelSelector, - final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = - "/v2alpha1/projects/{projectId}/vpcs/{vpcId}/regions/{region}/routing-tables/{routingTableId}/static-routes" - .replace( - "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())) - .replace( - "{" + "vpcId" + "}", - localVarApiClient.escapeString(vpcId.toString())) - .replace( - "{" + "region" + "}", - localVarApiClient.escapeString(region.toString())) - .replace( - "{" + "routingTableId" + "}", - localVarApiClient.escapeString(routingTableId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (labelSelector != null) { - localVarQueryParams.addAll( - localVarApiClient.parameterToPair("label_selector", labelSelector)); - } - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call listVPCStaticRoutesValidateBeforeCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - @javax.annotation.Nullable String labelSelector, - final ApiCallback _callback) - throws ApiException { - // verify the required parameter 'projectId' is set - if (projectId == null) { - throw new ApiException( - "Missing the required parameter 'projectId' when calling listVPCStaticRoutes(Async)"); - } - - // verify the required parameter 'vpcId' is set - if (vpcId == null) { - throw new ApiException( - "Missing the required parameter 'vpcId' when calling listVPCStaticRoutes(Async)"); - } - - // verify the required parameter 'region' is set - if (region == null) { - throw new ApiException( - "Missing the required parameter 'region' when calling listVPCStaticRoutes(Async)"); - } - - // verify the required parameter 'routingTableId' is set - if (routingTableId == null) { - throw new ApiException( - "Missing the required parameter 'routingTableId' when calling listVPCStaticRoutes(Async)"); - } - - return listVPCStaticRoutesCall( - projectId, vpcId, region, routingTableId, labelSelector, _callback); - } - - /** - * List all regional static routes in a VPC. Get a list of all static routes of a VPC for this - * region. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @param labelSelector Filter resources by labels. (optional) - * @return RouteListResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 List all static routes. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public RouteListResponse listVPCStaticRoutes( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - @javax.annotation.Nullable String labelSelector) - throws ApiException { - ApiResponse localVarResp = - listVPCStaticRoutesWithHttpInfo( - projectId, vpcId, region, routingTableId, labelSelector); - return localVarResp.getData(); - } - - /** - * List all regional static routes in a VPC. Get a list of all static routes of a VPC for this - * region. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @param labelSelector Filter resources by labels. (optional) - * @return ApiResponse<RouteListResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 List all static routes. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public ApiResponse listVPCStaticRoutesWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - @javax.annotation.Nullable String labelSelector) - throws ApiException { - okhttp3.Call localVarCall = - listVPCStaticRoutesValidateBeforeCall( - projectId, vpcId, region, routingTableId, labelSelector, null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * List all regional static routes in a VPC. (asynchronously) Get a list of all static routes of - * a VPC for this region. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @param labelSelector Filter resources by labels. (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 List all static routes. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call listVPCStaticRoutesAsync( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - @javax.annotation.Nullable String labelSelector, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - listVPCStaticRoutesValidateBeforeCall( - projectId, vpcId, region, routingTableId, labelSelector, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - - /** - * Build call for listVPCs - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param labelSelector Filter resources by labels. (optional) - * @param filter Filter resources by fields. A subset of expr-lang is supported. See - * https://expr-lang.org/docs/language-definition for usage details. (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Get a list of all VPCs. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call listVPCsCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nullable String labelSelector, - @javax.annotation.Nullable String filter, - final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = - "/v2alpha1/projects/{projectId}/vpcs" - .replace( - "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (labelSelector != null) { - localVarQueryParams.addAll( - localVarApiClient.parameterToPair("label_selector", labelSelector)); - } - - if (filter != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("filter", filter)); - } - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call listVPCsValidateBeforeCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nullable String labelSelector, - @javax.annotation.Nullable String filter, - final ApiCallback _callback) - throws ApiException { - // verify the required parameter 'projectId' is set - if (projectId == null) { - throw new ApiException( - "Missing the required parameter 'projectId' when calling listVPCs(Async)"); - } - - return listVPCsCall(projectId, labelSelector, filter, _callback); - } - - /** - * List project VPCs. List all visible VPCs of this project. To list shared VPCs from other - * projects of the organization use the `List all shared VPCs` endpoint. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param labelSelector Filter resources by labels. (optional) - * @param filter Filter resources by fields. A subset of expr-lang is supported. See - * https://expr-lang.org/docs/language-definition for usage details. (optional) - * @return VPCList - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Get a list of all VPCs. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public VPCList listVPCs( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nullable String labelSelector, - @javax.annotation.Nullable String filter) - throws ApiException { - ApiResponse localVarResp = listVPCsWithHttpInfo(projectId, labelSelector, filter); - return localVarResp.getData(); - } - - /** - * List project VPCs. List all visible VPCs of this project. To list shared VPCs from other - * projects of the organization use the `List all shared VPCs` endpoint. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param labelSelector Filter resources by labels. (optional) - * @param filter Filter resources by fields. A subset of expr-lang is supported. See - * https://expr-lang.org/docs/language-definition for usage details. (optional) - * @return ApiResponse<VPCList> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Get a list of all VPCs. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public ApiResponse listVPCsWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nullable String labelSelector, - @javax.annotation.Nullable String filter) - throws ApiException { - okhttp3.Call localVarCall = - listVPCsValidateBeforeCall(projectId, labelSelector, filter, null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * List project VPCs. (asynchronously) List all visible VPCs of this project. To list shared - * VPCs from other projects of the organization use the `List all shared VPCs` - * endpoint. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param labelSelector Filter resources by labels. (optional) - * @param filter Filter resources by fields. A subset of expr-lang is supported. See - * https://expr-lang.org/docs/language-definition for usage details. (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Get a list of all VPCs. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call listVPCsAsync( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nullable String labelSelector, - @javax.annotation.Nullable String filter, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - listVPCsValidateBeforeCall(projectId, labelSelector, filter, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - - /** - * Build call for partialUpdateNetwork - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param region The STACKIT Region of the resources. (required) - * @param networkId The identifier (ID) of a STACKIT Network. (required) - * @param partialUpdateNetworkPayload Request an update of a network. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
202 An update was accepted. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call partialUpdateNetworkCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID networkId, - @javax.annotation.Nonnull PartialUpdateNetworkPayload partialUpdateNetworkPayload, - final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = partialUpdateNetworkPayload; - - // create path and map variables - String localVarPath = - "/v2alpha1/projects/{projectId}/regions/{region}/networks/{networkId}" - .replace( - "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())) - .replace( - "{" + "region" + "}", - localVarApiClient.escapeString(region.toString())) - .replace( - "{" + "networkId" + "}", - localVarApiClient.escapeString(networkId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/json"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "PATCH", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call partialUpdateNetworkValidateBeforeCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID networkId, - @javax.annotation.Nonnull PartialUpdateNetworkPayload partialUpdateNetworkPayload, - final ApiCallback _callback) - throws ApiException { - // verify the required parameter 'projectId' is set - if (projectId == null) { - throw new ApiException( - "Missing the required parameter 'projectId' when calling partialUpdateNetwork(Async)"); - } - - // verify the required parameter 'region' is set - if (region == null) { - throw new ApiException( - "Missing the required parameter 'region' when calling partialUpdateNetwork(Async)"); - } - - // verify the required parameter 'networkId' is set - if (networkId == null) { - throw new ApiException( - "Missing the required parameter 'networkId' when calling partialUpdateNetwork(Async)"); - } - - // verify the required parameter 'partialUpdateNetworkPayload' is set - if (partialUpdateNetworkPayload == null) { - throw new ApiException( - "Missing the required parameter 'partialUpdateNetworkPayload' when calling partialUpdateNetwork(Async)"); - } - - return partialUpdateNetworkCall( - projectId, region, networkId, partialUpdateNetworkPayload, _callback); - } - - /** - * Update network settings. Update the settings of a network inside a project. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param region The STACKIT Region of the resources. (required) - * @param networkId The identifier (ID) of a STACKIT Network. (required) - * @param partialUpdateNetworkPayload Request an update of a network. (required) - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
202 An update was accepted. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public void partialUpdateNetwork( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID networkId, - @javax.annotation.Nonnull PartialUpdateNetworkPayload partialUpdateNetworkPayload) - throws ApiException { - partialUpdateNetworkWithHttpInfo(projectId, region, networkId, partialUpdateNetworkPayload); - } - - /** - * Update network settings. Update the settings of a network inside a project. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param region The STACKIT Region of the resources. (required) - * @param networkId The identifier (ID) of a STACKIT Network. (required) - * @param partialUpdateNetworkPayload Request an update of a network. (required) - * @return ApiResponse<Void> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
202 An update was accepted. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public ApiResponse partialUpdateNetworkWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID networkId, - @javax.annotation.Nonnull PartialUpdateNetworkPayload partialUpdateNetworkPayload) - throws ApiException { - okhttp3.Call localVarCall = - partialUpdateNetworkValidateBeforeCall( - projectId, region, networkId, partialUpdateNetworkPayload, null); - return localVarApiClient.execute(localVarCall); - } - - /** - * Update network settings. (asynchronously) Update the settings of a network inside a project. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param region The STACKIT Region of the resources. (required) - * @param networkId The identifier (ID) of a STACKIT Network. (required) - * @param partialUpdateNetworkPayload Request an update of a network. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
202 An update was accepted. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call partialUpdateNetworkAsync( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID networkId, - @javax.annotation.Nonnull PartialUpdateNetworkPayload partialUpdateNetworkPayload, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - partialUpdateNetworkValidateBeforeCall( - projectId, region, networkId, partialUpdateNetworkPayload, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); - return localVarCall; - } - - /** - * Build call for partialUpdateVPC - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param partialUpdateVPCPayload Request to update a VPC. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 VPC has been updated. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call partialUpdateVPCCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull PartialUpdateVPCPayload partialUpdateVPCPayload, - final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = partialUpdateVPCPayload; - - // create path and map variables - String localVarPath = - "/v2alpha1/projects/{projectId}/vpcs/{vpcId}" - .replace( - "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())) - .replace( - "{" + "vpcId" + "}", - localVarApiClient.escapeString(vpcId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/json"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "PATCH", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call partialUpdateVPCValidateBeforeCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull PartialUpdateVPCPayload partialUpdateVPCPayload, - final ApiCallback _callback) - throws ApiException { - // verify the required parameter 'projectId' is set - if (projectId == null) { - throw new ApiException( - "Missing the required parameter 'projectId' when calling partialUpdateVPC(Async)"); - } - - // verify the required parameter 'vpcId' is set - if (vpcId == null) { - throw new ApiException( - "Missing the required parameter 'vpcId' when calling partialUpdateVPC(Async)"); - } - - // verify the required parameter 'partialUpdateVPCPayload' is set - if (partialUpdateVPCPayload == null) { - throw new ApiException( - "Missing the required parameter 'partialUpdateVPCPayload' when calling partialUpdateVPC(Async)"); - } - - return partialUpdateVPCCall(projectId, vpcId, partialUpdateVPCPayload, _callback); - } - - /** - * Update VPC settings. Update the settings of a VPC. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param partialUpdateVPCPayload Request to update a VPC. (required) - * @return VPC - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 VPC has been updated. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public VPC partialUpdateVPC( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull PartialUpdateVPCPayload partialUpdateVPCPayload) - throws ApiException { - ApiResponse localVarResp = - partialUpdateVPCWithHttpInfo(projectId, vpcId, partialUpdateVPCPayload); - return localVarResp.getData(); - } - - /** - * Update VPC settings. Update the settings of a VPC. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param partialUpdateVPCPayload Request to update a VPC. (required) - * @return ApiResponse<VPC> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 VPC has been updated. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public ApiResponse partialUpdateVPCWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull PartialUpdateVPCPayload partialUpdateVPCPayload) - throws ApiException { - okhttp3.Call localVarCall = - partialUpdateVPCValidateBeforeCall(projectId, vpcId, partialUpdateVPCPayload, null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Update VPC settings. (asynchronously) Update the settings of a VPC. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param partialUpdateVPCPayload Request to update a VPC. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 VPC has been updated. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call partialUpdateVPCAsync( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull PartialUpdateVPCPayload partialUpdateVPCPayload, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - partialUpdateVPCValidateBeforeCall( - projectId, vpcId, partialUpdateVPCPayload, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - - /** - * Build call for retypeVolume - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param region The STACKIT Region of the resources. (required) - * @param volumeId The identifier (ID) of a STACKIT Volume. (required) - * @param retypeVolumePayload Request a volume retype. (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
202 Volume retype request accepted. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
409 A conflict has occurred. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call retypeVolumeCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID volumeId, - @javax.annotation.Nullable RetypeVolumePayload retypeVolumePayload, - final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = retypeVolumePayload; - - // create path and map variables - String localVarPath = - "/v2alpha1/projects/{projectId}/regions/{region}/volumes/{volumeId}/retype" - .replace( - "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())) - .replace( - "{" + "region" + "}", - localVarApiClient.escapeString(region.toString())) - .replace( - "{" + "volumeId" + "}", - localVarApiClient.escapeString(volumeId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/json"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "POST", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call retypeVolumeValidateBeforeCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID volumeId, - @javax.annotation.Nullable RetypeVolumePayload retypeVolumePayload, - final ApiCallback _callback) - throws ApiException { - // verify the required parameter 'projectId' is set - if (projectId == null) { - throw new ApiException( - "Missing the required parameter 'projectId' when calling retypeVolume(Async)"); - } - - // verify the required parameter 'region' is set - if (region == null) { - throw new ApiException( - "Missing the required parameter 'region' when calling retypeVolume(Async)"); - } - - // verify the required parameter 'volumeId' is set - if (volumeId == null) { - throw new ApiException( - "Missing the required parameter 'volumeId' when calling retypeVolume(Async)"); - } - - return retypeVolumeCall(projectId, region, volumeId, retypeVolumePayload, _callback); - } - - /** - * Update the performanceClass of a volume. Update the performanceClass of a block device - * volume. This request can only be performend once in 7 days if the requested performanceClass - * is slower compared to the current one. Upgrades to faster performanceClasses are always - * allowed. This operation is async can take a few minutes to complete. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param region The STACKIT Region of the resources. (required) - * @param volumeId The identifier (ID) of a STACKIT Volume. (required) - * @param retypeVolumePayload Request a volume retype. (optional) - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
202 Volume retype request accepted. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
409 A conflict has occurred. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public void retypeVolume( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID volumeId, - @javax.annotation.Nullable RetypeVolumePayload retypeVolumePayload) - throws ApiException { - retypeVolumeWithHttpInfo(projectId, region, volumeId, retypeVolumePayload); - } - - /** - * Update the performanceClass of a volume. Update the performanceClass of a block device - * volume. This request can only be performend once in 7 days if the requested performanceClass - * is slower compared to the current one. Upgrades to faster performanceClasses are always - * allowed. This operation is async can take a few minutes to complete. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param region The STACKIT Region of the resources. (required) - * @param volumeId The identifier (ID) of a STACKIT Volume. (required) - * @param retypeVolumePayload Request a volume retype. (optional) - * @return ApiResponse<Void> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
202 Volume retype request accepted. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
409 A conflict has occurred. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public ApiResponse retypeVolumeWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID volumeId, - @javax.annotation.Nullable RetypeVolumePayload retypeVolumePayload) - throws ApiException { - okhttp3.Call localVarCall = - retypeVolumeValidateBeforeCall( - projectId, region, volumeId, retypeVolumePayload, null); - return localVarApiClient.execute(localVarCall); - } - - /** - * Update the performanceClass of a volume. (asynchronously) Update the performanceClass of a - * block device volume. This request can only be performend once in 7 days if the requested - * performanceClass is slower compared to the current one. Upgrades to faster performanceClasses - * are always allowed. This operation is async can take a few minutes to complete. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param region The STACKIT Region of the resources. (required) - * @param volumeId The identifier (ID) of a STACKIT Volume. (required) - * @param retypeVolumePayload Request a volume retype. (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
202 Volume retype request accepted. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
409 A conflict has occurred. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call retypeVolumeAsync( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID volumeId, - @javax.annotation.Nullable RetypeVolumePayload retypeVolumePayload, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - retypeVolumeValidateBeforeCall( - projectId, region, volumeId, retypeVolumePayload, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); - return localVarCall; - } - - /** - * Build call for updateRouteOfRoutingTable - * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @param routeId The identifier (ID) of a STACKIT Route. (required) - * @param updateRouteOfRoutingTablePayload Request an update of a route in a routing table. - * (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Update request for route successful. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call updateRouteOfRoutingTableCall( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - @javax.annotation.Nonnull UUID routeId, - @javax.annotation.Nonnull - UpdateRouteOfRoutingTablePayload updateRouteOfRoutingTablePayload, - final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = updateRouteOfRoutingTablePayload; - - // create path and map variables - String localVarPath = - "/v2alpha1/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables/{routingTableId}/routes/{routeId}" - .replace( - "{" + "organizationId" + "}", - localVarApiClient.escapeString(organizationId.toString())) - .replace( - "{" + "areaId" + "}", - localVarApiClient.escapeString(areaId.toString())) - .replace( - "{" + "region" + "}", - localVarApiClient.escapeString(region.toString())) - .replace( - "{" + "routingTableId" + "}", - localVarApiClient.escapeString(routingTableId.toString())) - .replace( - "{" + "routeId" + "}", - localVarApiClient.escapeString(routeId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/json"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "PATCH", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call updateRouteOfRoutingTableValidateBeforeCall( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - @javax.annotation.Nonnull UUID routeId, - @javax.annotation.Nonnull - UpdateRouteOfRoutingTablePayload updateRouteOfRoutingTablePayload, - final ApiCallback _callback) - throws ApiException { - // verify the required parameter 'organizationId' is set - if (organizationId == null) { - throw new ApiException( - "Missing the required parameter 'organizationId' when calling updateRouteOfRoutingTable(Async)"); - } - - // verify the required parameter 'areaId' is set - if (areaId == null) { - throw new ApiException( - "Missing the required parameter 'areaId' when calling updateRouteOfRoutingTable(Async)"); - } - - // verify the required parameter 'region' is set - if (region == null) { - throw new ApiException( - "Missing the required parameter 'region' when calling updateRouteOfRoutingTable(Async)"); - } - - // verify the required parameter 'routingTableId' is set - if (routingTableId == null) { - throw new ApiException( - "Missing the required parameter 'routingTableId' when calling updateRouteOfRoutingTable(Async)"); - } - - // verify the required parameter 'routeId' is set - if (routeId == null) { - throw new ApiException( - "Missing the required parameter 'routeId' when calling updateRouteOfRoutingTable(Async)"); - } - - // verify the required parameter 'updateRouteOfRoutingTablePayload' is set - if (updateRouteOfRoutingTablePayload == null) { - throw new ApiException( - "Missing the required parameter 'updateRouteOfRoutingTablePayload' when calling updateRouteOfRoutingTable(Async)"); - } - - return updateRouteOfRoutingTableCall( - organizationId, - areaId, - region, - routingTableId, - routeId, - updateRouteOfRoutingTablePayload, - _callback); - } - - /** - * Update a route of a routing table. Update a route defined in a routing table of a network - * area. - * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @param routeId The identifier (ID) of a STACKIT Route. (required) - * @param updateRouteOfRoutingTablePayload Request an update of a route in a routing table. - * (required) - * @return Route - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Update request for route successful. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public Route updateRouteOfRoutingTable( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - @javax.annotation.Nonnull UUID routeId, - @javax.annotation.Nonnull - UpdateRouteOfRoutingTablePayload updateRouteOfRoutingTablePayload) - throws ApiException { - ApiResponse localVarResp = - updateRouteOfRoutingTableWithHttpInfo( - organizationId, - areaId, - region, - routingTableId, - routeId, - updateRouteOfRoutingTablePayload); - return localVarResp.getData(); - } - - /** - * Update a route of a routing table. Update a route defined in a routing table of a network - * area. - * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @param routeId The identifier (ID) of a STACKIT Route. (required) - * @param updateRouteOfRoutingTablePayload Request an update of a route in a routing table. - * (required) - * @return ApiResponse<Route> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Update request for route successful. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public ApiResponse updateRouteOfRoutingTableWithHttpInfo( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - @javax.annotation.Nonnull UUID routeId, - @javax.annotation.Nonnull - UpdateRouteOfRoutingTablePayload updateRouteOfRoutingTablePayload) - throws ApiException { - okhttp3.Call localVarCall = - updateRouteOfRoutingTableValidateBeforeCall( - organizationId, - areaId, - region, - routingTableId, - routeId, - updateRouteOfRoutingTablePayload, - null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Update a route of a routing table. (asynchronously) Update a route defined in a routing table - * of a network area. - * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @param routeId The identifier (ID) of a STACKIT Route. (required) - * @param updateRouteOfRoutingTablePayload Request an update of a route in a routing table. - * (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Update request for route successful. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call updateRouteOfRoutingTableAsync( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - @javax.annotation.Nonnull UUID routeId, - @javax.annotation.Nonnull - UpdateRouteOfRoutingTablePayload updateRouteOfRoutingTablePayload, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - updateRouteOfRoutingTableValidateBeforeCall( - organizationId, - areaId, - region, - routingTableId, - routeId, - updateRouteOfRoutingTablePayload, - _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - - /** - * Build call for updateRoutingTableOfArea - * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @param updateRoutingTableOfAreaPayload Request an update of a routing table. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Update request for routing table successful. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call updateRoutingTableOfAreaCall( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - @javax.annotation.Nonnull - UpdateRoutingTableOfAreaPayload updateRoutingTableOfAreaPayload, - final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = updateRoutingTableOfAreaPayload; - - // create path and map variables - String localVarPath = - "/v2alpha1/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables/{routingTableId}" - .replace( - "{" + "organizationId" + "}", - localVarApiClient.escapeString(organizationId.toString())) - .replace( - "{" + "areaId" + "}", - localVarApiClient.escapeString(areaId.toString())) - .replace( - "{" + "region" + "}", - localVarApiClient.escapeString(region.toString())) - .replace( - "{" + "routingTableId" + "}", - localVarApiClient.escapeString(routingTableId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/json"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "PATCH", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call updateRoutingTableOfAreaValidateBeforeCall( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - @javax.annotation.Nonnull - UpdateRoutingTableOfAreaPayload updateRoutingTableOfAreaPayload, - final ApiCallback _callback) - throws ApiException { - // verify the required parameter 'organizationId' is set - if (organizationId == null) { - throw new ApiException( - "Missing the required parameter 'organizationId' when calling updateRoutingTableOfArea(Async)"); - } - - // verify the required parameter 'areaId' is set - if (areaId == null) { - throw new ApiException( - "Missing the required parameter 'areaId' when calling updateRoutingTableOfArea(Async)"); - } - - // verify the required parameter 'region' is set - if (region == null) { - throw new ApiException( - "Missing the required parameter 'region' when calling updateRoutingTableOfArea(Async)"); - } - - // verify the required parameter 'routingTableId' is set - if (routingTableId == null) { - throw new ApiException( - "Missing the required parameter 'routingTableId' when calling updateRoutingTableOfArea(Async)"); - } - - // verify the required parameter 'updateRoutingTableOfAreaPayload' is set - if (updateRoutingTableOfAreaPayload == null) { - throw new ApiException( - "Missing the required parameter 'updateRoutingTableOfAreaPayload' when calling updateRoutingTableOfArea(Async)"); - } - - return updateRoutingTableOfAreaCall( - organizationId, - areaId, - region, - routingTableId, - updateRoutingTableOfAreaPayload, - _callback); - } - - /** - * Update a routing table. Update a routing table defined in a network area. - * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @param updateRoutingTableOfAreaPayload Request an update of a routing table. (required) - * @return RoutingTable - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Update request for routing table successful. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public RoutingTable updateRoutingTableOfArea( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - @javax.annotation.Nonnull - UpdateRoutingTableOfAreaPayload updateRoutingTableOfAreaPayload) - throws ApiException { - ApiResponse localVarResp = - updateRoutingTableOfAreaWithHttpInfo( - organizationId, - areaId, - region, - routingTableId, - updateRoutingTableOfAreaPayload); - return localVarResp.getData(); - } - - /** - * Update a routing table. Update a routing table defined in a network area. - * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @param updateRoutingTableOfAreaPayload Request an update of a routing table. (required) - * @return ApiResponse<RoutingTable> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Update request for routing table successful. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public ApiResponse updateRoutingTableOfAreaWithHttpInfo( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - @javax.annotation.Nonnull - UpdateRoutingTableOfAreaPayload updateRoutingTableOfAreaPayload) - throws ApiException { - okhttp3.Call localVarCall = - updateRoutingTableOfAreaValidateBeforeCall( - organizationId, - areaId, - region, - routingTableId, - updateRoutingTableOfAreaPayload, - null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Update a routing table. (asynchronously) Update a routing table defined in a network area. - * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @param updateRoutingTableOfAreaPayload Request an update of a routing table. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Update request for routing table successful. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call updateRoutingTableOfAreaAsync( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - @javax.annotation.Nonnull - UpdateRoutingTableOfAreaPayload updateRoutingTableOfAreaPayload, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - updateRoutingTableOfAreaValidateBeforeCall( - organizationId, - areaId, - region, - routingTableId, - updateRoutingTableOfAreaPayload, - _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - - /** - * Build call for updateVPCNetworkRange - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @param networkRangeId The identifier (ID) of a STACKIT Network Range. (required) - * @param updateVPCNetworkRangePayload Request an update of a network range. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Network Range has been updated. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
409 A conflict has occurred. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call updateVPCNetworkRangeCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID networkRangeId, - @javax.annotation.Nonnull UpdateVPCNetworkRangePayload updateVPCNetworkRangePayload, - final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = updateVPCNetworkRangePayload; - - // create path and map variables - String localVarPath = - "/v2alpha1/projects/{projectId}/vpcs/{vpcId}/regions/{region}/network-ranges/{networkRangeId}" - .replace( - "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())) - .replace( - "{" + "vpcId" + "}", - localVarApiClient.escapeString(vpcId.toString())) - .replace( - "{" + "region" + "}", - localVarApiClient.escapeString(region.toString())) - .replace( - "{" + "networkRangeId" + "}", - localVarApiClient.escapeString(networkRangeId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/json"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "PATCH", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call updateVPCNetworkRangeValidateBeforeCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID networkRangeId, - @javax.annotation.Nonnull UpdateVPCNetworkRangePayload updateVPCNetworkRangePayload, - final ApiCallback _callback) - throws ApiException { - // verify the required parameter 'projectId' is set - if (projectId == null) { - throw new ApiException( - "Missing the required parameter 'projectId' when calling updateVPCNetworkRange(Async)"); - } - - // verify the required parameter 'vpcId' is set - if (vpcId == null) { - throw new ApiException( - "Missing the required parameter 'vpcId' when calling updateVPCNetworkRange(Async)"); - } - - // verify the required parameter 'region' is set - if (region == null) { - throw new ApiException( - "Missing the required parameter 'region' when calling updateVPCNetworkRange(Async)"); - } - - // verify the required parameter 'networkRangeId' is set - if (networkRangeId == null) { - throw new ApiException( - "Missing the required parameter 'networkRangeId' when calling updateVPCNetworkRange(Async)"); - } - - // verify the required parameter 'updateVPCNetworkRangePayload' is set - if (updateVPCNetworkRangePayload == null) { - throw new ApiException( - "Missing the required parameter 'updateVPCNetworkRangePayload' when calling updateVPCNetworkRange(Async)"); - } - - return updateVPCNetworkRangeCall( - projectId, vpcId, region, networkRangeId, updateVPCNetworkRangePayload, _callback); - } - - /** - * Update a regional network range. Update a network range of a VPC for this region. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @param networkRangeId The identifier (ID) of a STACKIT Network Range. (required) - * @param updateVPCNetworkRangePayload Request an update of a network range. (required) - * @return VPCNetworkRange - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Network Range has been updated. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
409 A conflict has occurred. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public VPCNetworkRange updateVPCNetworkRange( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID networkRangeId, - @javax.annotation.Nonnull UpdateVPCNetworkRangePayload updateVPCNetworkRangePayload) - throws ApiException { - ApiResponse localVarResp = - updateVPCNetworkRangeWithHttpInfo( - projectId, vpcId, region, networkRangeId, updateVPCNetworkRangePayload); - return localVarResp.getData(); - } - - /** - * Update a regional network range. Update a network range of a VPC for this region. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @param networkRangeId The identifier (ID) of a STACKIT Network Range. (required) - * @param updateVPCNetworkRangePayload Request an update of a network range. (required) - * @return ApiResponse<VPCNetworkRange> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Network Range has been updated. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
409 A conflict has occurred. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public ApiResponse updateVPCNetworkRangeWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID networkRangeId, - @javax.annotation.Nonnull UpdateVPCNetworkRangePayload updateVPCNetworkRangePayload) - throws ApiException { - okhttp3.Call localVarCall = - updateVPCNetworkRangeValidateBeforeCall( - projectId, - vpcId, - region, - networkRangeId, - updateVPCNetworkRangePayload, - null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Update a regional network range. (asynchronously) Update a network range of a VPC for this - * region. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @param networkRangeId The identifier (ID) of a STACKIT Network Range. (required) - * @param updateVPCNetworkRangePayload Request an update of a network range. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Network Range has been updated. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
409 A conflict has occurred. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call updateVPCNetworkRangeAsync( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID networkRangeId, - @javax.annotation.Nonnull UpdateVPCNetworkRangePayload updateVPCNetworkRangePayload, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - updateVPCNetworkRangeValidateBeforeCall( - projectId, - vpcId, - region, - networkRangeId, - updateVPCNetworkRangePayload, - _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - - /** - * Build call for updateVPCRegion - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @param updateVPCRegionPayload Request an update of the regional VPC configuration. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Regional VPC configuration has been updated. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
409 A conflict has occurred. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call updateVPCRegionCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UpdateVPCRegionPayload updateVPCRegionPayload, - final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = updateVPCRegionPayload; - - // create path and map variables - String localVarPath = - "/v2alpha1/projects/{projectId}/vpcs/{vpcId}/regions/{region}" - .replace( - "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())) - .replace( - "{" + "vpcId" + "}", - localVarApiClient.escapeString(vpcId.toString())) - .replace( - "{" + "region" + "}", - localVarApiClient.escapeString(region.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/json"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "PATCH", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call updateVPCRegionValidateBeforeCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UpdateVPCRegionPayload updateVPCRegionPayload, - final ApiCallback _callback) - throws ApiException { - // verify the required parameter 'projectId' is set - if (projectId == null) { - throw new ApiException( - "Missing the required parameter 'projectId' when calling updateVPCRegion(Async)"); - } - - // verify the required parameter 'vpcId' is set - if (vpcId == null) { - throw new ApiException( - "Missing the required parameter 'vpcId' when calling updateVPCRegion(Async)"); - } - - // verify the required parameter 'region' is set - if (region == null) { - throw new ApiException( - "Missing the required parameter 'region' when calling updateVPCRegion(Async)"); - } - - // verify the required parameter 'updateVPCRegionPayload' is set - if (updateVPCRegionPayload == null) { - throw new ApiException( - "Missing the required parameter 'updateVPCRegionPayload' when calling updateVPCRegion(Async)"); - } - - return updateVPCRegionCall(projectId, vpcId, region, updateVPCRegionPayload, _callback); - } - - /** - * Update the regional configuration of a VPC. Update the current configuration of a region for - * a VPC. **Example:** Update nameservers. **Request Body:** ```json { - * \"ipv4\": { \"defaultNameservers\": [ \"10.1.2.10\", - * \"10.1.2.11\" ], } } ``` **Result:** * - * `ipv4.defaultNameservers`: **Updated** as a new value was provided. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @param updateVPCRegionPayload Request an update of the regional VPC configuration. (required) - * @return RegionalVPC - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Regional VPC configuration has been updated. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
409 A conflict has occurred. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public RegionalVPC updateVPCRegion( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UpdateVPCRegionPayload updateVPCRegionPayload) - throws ApiException { - ApiResponse localVarResp = - updateVPCRegionWithHttpInfo(projectId, vpcId, region, updateVPCRegionPayload); - return localVarResp.getData(); - } - - /** - * Update the regional configuration of a VPC. Update the current configuration of a region for - * a VPC. **Example:** Update nameservers. **Request Body:** ```json { - * \"ipv4\": { \"defaultNameservers\": [ \"10.1.2.10\", - * \"10.1.2.11\" ], } } ``` **Result:** * - * `ipv4.defaultNameservers`: **Updated** as a new value was provided. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @param updateVPCRegionPayload Request an update of the regional VPC configuration. (required) - * @return ApiResponse<RegionalVPC> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Regional VPC configuration has been updated. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
409 A conflict has occurred. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public ApiResponse updateVPCRegionWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UpdateVPCRegionPayload updateVPCRegionPayload) - throws ApiException { - okhttp3.Call localVarCall = - updateVPCRegionValidateBeforeCall( - projectId, vpcId, region, updateVPCRegionPayload, null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Update the regional configuration of a VPC. (asynchronously) Update the current configuration - * of a region for a VPC. **Example:** Update nameservers. **Request Body:** - * ```json { \"ipv4\": { \"defaultNameservers\": [ - * \"10.1.2.10\", \"10.1.2.11\" ], } } ``` **Result:** * - * `ipv4.defaultNameservers`: **Updated** as a new value was provided. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @param updateVPCRegionPayload Request an update of the regional VPC configuration. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Regional VPC configuration has been updated. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
409 A conflict has occurred. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call updateVPCRegionAsync( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UpdateVPCRegionPayload updateVPCRegionPayload, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - updateVPCRegionValidateBeforeCall( - projectId, vpcId, region, updateVPCRegionPayload, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - - /** - * Build call for updateVPCRoutingTable - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @param updateVPCRoutingTablePayload Request an update of a routing table. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Update request for routing table successful. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call updateVPCRoutingTableCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - @javax.annotation.Nonnull UpdateVPCRoutingTablePayload updateVPCRoutingTablePayload, - final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = updateVPCRoutingTablePayload; - - // create path and map variables - String localVarPath = - "/v2alpha1/projects/{projectId}/vpcs/{vpcId}/regions/{region}/routing-tables/{routingTableId}" - .replace( - "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())) - .replace( - "{" + "vpcId" + "}", - localVarApiClient.escapeString(vpcId.toString())) - .replace( - "{" + "region" + "}", - localVarApiClient.escapeString(region.toString())) - .replace( - "{" + "routingTableId" + "}", - localVarApiClient.escapeString(routingTableId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/json"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "PATCH", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call updateVPCRoutingTableValidateBeforeCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - @javax.annotation.Nonnull UpdateVPCRoutingTablePayload updateVPCRoutingTablePayload, - final ApiCallback _callback) - throws ApiException { - // verify the required parameter 'projectId' is set - if (projectId == null) { - throw new ApiException( - "Missing the required parameter 'projectId' when calling updateVPCRoutingTable(Async)"); - } - - // verify the required parameter 'vpcId' is set - if (vpcId == null) { - throw new ApiException( - "Missing the required parameter 'vpcId' when calling updateVPCRoutingTable(Async)"); - } - - // verify the required parameter 'region' is set - if (region == null) { - throw new ApiException( - "Missing the required parameter 'region' when calling updateVPCRoutingTable(Async)"); - } - - // verify the required parameter 'routingTableId' is set - if (routingTableId == null) { - throw new ApiException( - "Missing the required parameter 'routingTableId' when calling updateVPCRoutingTable(Async)"); - } - - // verify the required parameter 'updateVPCRoutingTablePayload' is set - if (updateVPCRoutingTablePayload == null) { - throw new ApiException( - "Missing the required parameter 'updateVPCRoutingTablePayload' when calling updateVPCRoutingTable(Async)"); - } - - return updateVPCRoutingTableCall( - projectId, vpcId, region, routingTableId, updateVPCRoutingTablePayload, _callback); - } - - /** - * Update a regional routing table. Update a routing table of a VPC for this region. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @param updateVPCRoutingTablePayload Request an update of a routing table. (required) - * @return VPCRoutingTable - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Update request for routing table successful. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public VPCRoutingTable updateVPCRoutingTable( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - @javax.annotation.Nonnull UpdateVPCRoutingTablePayload updateVPCRoutingTablePayload) - throws ApiException { - ApiResponse localVarResp = - updateVPCRoutingTableWithHttpInfo( - projectId, vpcId, region, routingTableId, updateVPCRoutingTablePayload); - return localVarResp.getData(); - } - - /** - * Update a regional routing table. Update a routing table of a VPC for this region. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @param updateVPCRoutingTablePayload Request an update of a routing table. (required) - * @return ApiResponse<VPCRoutingTable> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Update request for routing table successful. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public ApiResponse updateVPCRoutingTableWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - @javax.annotation.Nonnull UpdateVPCRoutingTablePayload updateVPCRoutingTablePayload) - throws ApiException { - okhttp3.Call localVarCall = - updateVPCRoutingTableValidateBeforeCall( - projectId, - vpcId, - region, - routingTableId, - updateVPCRoutingTablePayload, - null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Update a regional routing table. (asynchronously) Update a routing table of a VPC for this - * region. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @param updateVPCRoutingTablePayload Request an update of a routing table. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Update request for routing table successful. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call updateVPCRoutingTableAsync( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - @javax.annotation.Nonnull UpdateVPCRoutingTablePayload updateVPCRoutingTablePayload, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - updateVPCRoutingTableValidateBeforeCall( - projectId, - vpcId, - region, - routingTableId, - updateVPCRoutingTablePayload, - _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - - /** - * Build call for updateVPCStaticRoute - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @param routeId The identifier (ID) of a STACKIT Route. (required) - * @param updateVPCStaticRoutePayload Request an update of a static route. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Update request for static route successful. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call updateVPCStaticRouteCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - @javax.annotation.Nonnull UUID routeId, - @javax.annotation.Nonnull UpdateVPCStaticRoutePayload updateVPCStaticRoutePayload, - final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = updateVPCStaticRoutePayload; - - // create path and map variables - String localVarPath = - "/v2alpha1/projects/{projectId}/vpcs/{vpcId}/regions/{region}/routing-tables/{routingTableId}/static-routes/{routeId}" - .replace( - "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())) - .replace( - "{" + "vpcId" + "}", - localVarApiClient.escapeString(vpcId.toString())) - .replace( - "{" + "region" + "}", - localVarApiClient.escapeString(region.toString())) - .replace( - "{" + "routingTableId" + "}", - localVarApiClient.escapeString(routingTableId.toString())) - .replace( - "{" + "routeId" + "}", - localVarApiClient.escapeString(routeId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/json"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "PATCH", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call updateVPCStaticRouteValidateBeforeCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - @javax.annotation.Nonnull UUID routeId, - @javax.annotation.Nonnull UpdateVPCStaticRoutePayload updateVPCStaticRoutePayload, - final ApiCallback _callback) - throws ApiException { - // verify the required parameter 'projectId' is set - if (projectId == null) { - throw new ApiException( - "Missing the required parameter 'projectId' when calling updateVPCStaticRoute(Async)"); - } - - // verify the required parameter 'vpcId' is set - if (vpcId == null) { - throw new ApiException( - "Missing the required parameter 'vpcId' when calling updateVPCStaticRoute(Async)"); - } - - // verify the required parameter 'region' is set - if (region == null) { - throw new ApiException( - "Missing the required parameter 'region' when calling updateVPCStaticRoute(Async)"); - } - - // verify the required parameter 'routingTableId' is set - if (routingTableId == null) { - throw new ApiException( - "Missing the required parameter 'routingTableId' when calling updateVPCStaticRoute(Async)"); - } - - // verify the required parameter 'routeId' is set - if (routeId == null) { - throw new ApiException( - "Missing the required parameter 'routeId' when calling updateVPCStaticRoute(Async)"); - } - - // verify the required parameter 'updateVPCStaticRoutePayload' is set - if (updateVPCStaticRoutePayload == null) { - throw new ApiException( - "Missing the required parameter 'updateVPCStaticRoutePayload' when calling updateVPCStaticRoute(Async)"); - } - - return updateVPCStaticRouteCall( - projectId, - vpcId, - region, - routingTableId, - routeId, - updateVPCStaticRoutePayload, - _callback); - } - - /** - * Update a regional static route. Update a static route of a VPC for this region. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @param routeId The identifier (ID) of a STACKIT Route. (required) - * @param updateVPCStaticRoutePayload Request an update of a static route. (required) - * @return Route - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Update request for static route successful. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public Route updateVPCStaticRoute( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - @javax.annotation.Nonnull UUID routeId, - @javax.annotation.Nonnull UpdateVPCStaticRoutePayload updateVPCStaticRoutePayload) - throws ApiException { - ApiResponse localVarResp = - updateVPCStaticRouteWithHttpInfo( - projectId, - vpcId, - region, - routingTableId, - routeId, - updateVPCStaticRoutePayload); - return localVarResp.getData(); - } - - /** - * Update a regional static route. Update a static route of a VPC for this region. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @param routeId The identifier (ID) of a STACKIT Route. (required) - * @param updateVPCStaticRoutePayload Request an update of a static route. (required) - * @return ApiResponse<Route> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Update request for static route successful. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public ApiResponse updateVPCStaticRouteWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - @javax.annotation.Nonnull UUID routeId, - @javax.annotation.Nonnull UpdateVPCStaticRoutePayload updateVPCStaticRoutePayload) - throws ApiException { - okhttp3.Call localVarCall = - updateVPCStaticRouteValidateBeforeCall( - projectId, - vpcId, - region, - routingTableId, - routeId, - updateVPCStaticRoutePayload, - null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Update a regional static route. (asynchronously) Update a static route of a VPC for this - * region. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) - * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @param routeId The identifier (ID) of a STACKIT Route. (required) - * @param updateVPCStaticRoutePayload Request an update of a static route. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Update request for static route successful. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
- */ - public okhttp3.Call updateVPCStaticRouteAsync( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - @javax.annotation.Nonnull UUID routeId, - @javax.annotation.Nonnull UpdateVPCStaticRoutePayload updateVPCStaticRoutePayload, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - updateVPCStaticRouteValidateBeforeCall( - projectId, - vpcId, - region, - routingTableId, - routeId, - updateVPCStaticRoutePayload, - _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/api/IaasApi.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/api/IaasApi.java deleted file mode 100644 index 08a84ffb..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/api/IaasApi.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.api; - -import cloud.stackit.sdk.core.config.CoreConfiguration; -import java.io.IOException; -import okhttp3.OkHttpClient; - -public class IaasApi extends DefaultApi { - /** - * Basic constructor for IaasApi - * - *

For production use consider using the constructor with the OkHttpClient parameter. - * - * @throws IOException - */ - public IaasApi() throws IOException { - super(); - } - - /** - * Basic Constructor for IaasApi - * - *

For production use consider using the constructor with the OkHttpClient parameter. - * - * @param configuration your STACKIT SDK CoreConfiguration - * @throws IOException - */ - public IaasApi(CoreConfiguration configuration) throws IOException { - super(configuration); - } - - /** - * Constructor for IaasApi - * - * @param httpClient OkHttpClient object - * @throws IOException - */ - public IaasApi(OkHttpClient httpClient) throws IOException { - super(httpClient); - } - - /** - * Constructor for IaasApi - * - * @param httpClient OkHttpClient object - * @param configuration your STACKIT SDK CoreConfiguration - * @throws IOException - */ - public IaasApi(OkHttpClient httpClient, CoreConfiguration configuration) throws IOException { - super(httpClient, configuration); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AbstractOpenApiSchema.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AbstractOpenApiSchema.java deleted file mode 100644 index c59ab9dd..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AbstractOpenApiSchema.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.model; - -import java.util.Map; -import java.util.Objects; - -/** Abstract class for oneOf,anyOf schemas defined in OpenAPI spec */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public abstract class AbstractOpenApiSchema { - - // store the actual instance of the schema/object - private Object instance; - - // is nullable - private Boolean isNullable; - - // schema type (e.g. oneOf, anyOf) - private final String schemaType; - - public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { - this.schemaType = schemaType; - this.isNullable = isNullable; - } - - /** - * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object - * - * @return an instance of the actual schema/object - */ - public abstract Map> getSchemas(); - - /** - * Get the actual instance - * - * @return an instance of the actual schema/object - */ - // @JsonValue - public Object getActualInstance() { - return instance; - } - - /** - * Set the actual instance - * - * @param instance the actual instance of the schema/object - */ - public void setActualInstance(Object instance) { - this.instance = instance; - } - - /** - * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf - * schema as well - * - * @return an instance of the actual schema/object - */ - public Object getActualInstanceRecursively() { - return getActualInstanceRecursively(this); - } - - private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { - if (object.getActualInstance() == null) { - return null; - } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { - return getActualInstanceRecursively((AbstractOpenApiSchema) object.getActualInstance()); - } else { - return object.getActualInstance(); - } - } - - /** - * Get the schema type (e.g. anyOf, oneOf) - * - * @return the schema type - */ - public String getSchemaType() { - return schemaType; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ").append(getClass()).append(" {\n"); - sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); - sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); - sb.append(" schemaType: ").append(toIndentedString(schemaType)).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 boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; - return Objects.equals(this.instance, a.instance) - && Objects.equals(this.isNullable, a.isNullable) - && Objects.equals(this.schemaType, a.schemaType); - } - - @Override - public int hashCode() { - return Objects.hash(instance, isNullable, schemaType); - } - - /** - * Is nullable - * - * @return true if it's nullable - */ - public Boolean isNullable() { - if (Boolean.TRUE.equals(isNullable)) { - return Boolean.TRUE; - } else { - return Boolean.FALSE; - } - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AddRoutesToRoutingTablePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AddRoutesToRoutingTablePayload.java deleted file mode 100644 index 7a437137..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AddRoutesToRoutingTablePayload.java +++ /dev/null @@ -1,332 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.model; - -import cloud.stackit.sdk.iaas.v2alpha1api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** Object represents a request to add network routes. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class AddRoutesToRoutingTablePayload { - public static final String SERIALIZED_NAME_ITEMS = "items"; - - @SerializedName(SERIALIZED_NAME_ITEMS) - @javax.annotation.Nonnull - private List items = new ArrayList<>(); - - public AddRoutesToRoutingTablePayload() {} - - public AddRoutesToRoutingTablePayload items(@javax.annotation.Nonnull List items) { - this.items = items; - return this; - } - - public AddRoutesToRoutingTablePayload addItemsItem(Route itemsItem) { - if (this.items == null) { - this.items = new ArrayList<>(); - } - this.items.add(itemsItem); - return this; - } - - /** - * A list of routes. - * - * @return items - */ - @javax.annotation.Nonnull - public List getItems() { - return items; - } - - public void setItems(@javax.annotation.Nonnull List items) { - this.items = items; - } - - /** - * 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. - * - * @param key name of the property - * @param value value of the property - * @return the AddRoutesToRoutingTablePayload instance itself - */ - public AddRoutesToRoutingTablePayload 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. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - 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; - } - AddRoutesToRoutingTablePayload addRoutesToRoutingTablePayload = - (AddRoutesToRoutingTablePayload) o; - return Objects.equals(this.items, addRoutesToRoutingTablePayload.items) - && Objects.equals( - this.additionalProperties, - addRoutesToRoutingTablePayload.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(items, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AddRoutesToRoutingTablePayload {\n"); - sb.append(" items: ").append(toIndentedString(items)).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(Arrays.asList("items")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("items")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * AddRoutesToRoutingTablePayload - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AddRoutesToRoutingTablePayload.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field(s) %s in AddRoutesToRoutingTablePayload is not found in the empty JSON string", - AddRoutesToRoutingTablePayload.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AddRoutesToRoutingTablePayload.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field `%s` is not found in the JSON string: %s", - requiredField, - jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - Route.validateJsonElement(jsonArrayitems.get(i)); - } - ; - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AddRoutesToRoutingTablePayload.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AddRoutesToRoutingTablePayload' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(AddRoutesToRoutingTablePayload.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, AddRoutesToRoutingTablePayload value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional 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 { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public AddRoutesToRoutingTablePayload read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - AddRoutesToRoutingTablePayload 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( - java.util.Locale.ROOT, - "The field `%s` has unknown primitive type. Value: %s", - entry.getKey(), - entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - }.nullSafe(); - } - } - - /** - * Create an instance of AddRoutesToRoutingTablePayload given an JSON string - * - * @param jsonString JSON string - * @return An instance of AddRoutesToRoutingTablePayload - * @throws IOException if the JSON string is invalid with respect to - * AddRoutesToRoutingTablePayload - */ - public static AddRoutesToRoutingTablePayload fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AddRoutesToRoutingTablePayload.class); - } - - /** - * Convert an instance of AddRoutesToRoutingTablePayload to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AddRoutingTableToAreaPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AddRoutingTableToAreaPayload.java deleted file mode 100644 index e3af711f..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AddRoutingTableToAreaPayload.java +++ /dev/null @@ -1,547 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.model; - -import cloud.stackit.sdk.iaas.v2alpha1api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.UUID; - -/** - * An object representing a routing table. Filterable Fields: `dynamicRoutes`, - * `systemRoutes`. - */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class AddRoutingTableToAreaPayload { - public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; - - @SerializedName(SERIALIZED_NAME_CREATED_AT) - @javax.annotation.Nullable private OffsetDateTime createdAt; - - public static final String SERIALIZED_NAME_DEFAULT = "default"; - - @SerializedName(SERIALIZED_NAME_DEFAULT) - @javax.annotation.Nullable private Boolean _default = true; - - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - @javax.annotation.Nullable private String description; - - public static final String SERIALIZED_NAME_DYNAMIC_ROUTES = "dynamicRoutes"; - - @SerializedName(SERIALIZED_NAME_DYNAMIC_ROUTES) - @javax.annotation.Nullable private Boolean dynamicRoutes = true; - - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - @javax.annotation.Nullable private UUID id; - - public static final String SERIALIZED_NAME_LABELS = "labels"; - - @SerializedName(SERIALIZED_NAME_LABELS) - @javax.annotation.Nullable private Object labels; - - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - @javax.annotation.Nonnull - private String name; - - public static final String SERIALIZED_NAME_SYSTEM_ROUTES = "systemRoutes"; - - @SerializedName(SERIALIZED_NAME_SYSTEM_ROUTES) - @javax.annotation.Nullable private Boolean systemRoutes = true; - - public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; - - @SerializedName(SERIALIZED_NAME_UPDATED_AT) - @javax.annotation.Nullable private OffsetDateTime updatedAt; - - public AddRoutingTableToAreaPayload() {} - - public AddRoutingTableToAreaPayload( - OffsetDateTime createdAt, Boolean _default, UUID id, OffsetDateTime updatedAt) { - this(); - this.createdAt = createdAt; - this._default = _default; - this.id = id; - this.updatedAt = updatedAt; - } - - /** - * Date-time when resource was created. - * - * @return createdAt - */ - @javax.annotation.Nullable public OffsetDateTime getCreatedAt() { - return createdAt; - } - - /** - * This is the default routing table. It can't be deleted and is used if the user does not - * specify it otherwise. - * - * @return _default - */ - @javax.annotation.Nullable public Boolean getDefault() { - return _default; - } - - public AddRoutingTableToAreaPayload description(@javax.annotation.Nullable String description) { - this.description = description; - return this; - } - - /** - * Description Object. Allows string up to 255 Characters. - * - * @return description - */ - @javax.annotation.Nullable public String getDescription() { - return description; - } - - public void setDescription(@javax.annotation.Nullable String description) { - this.description = description; - } - - public AddRoutingTableToAreaPayload dynamicRoutes( - @javax.annotation.Nullable Boolean dynamicRoutes) { - this.dynamicRoutes = dynamicRoutes; - return this; - } - - /** - * A config setting for a routing table which allows propagation of dynamic routes to this - * routing table. - * - * @return dynamicRoutes - */ - @javax.annotation.Nullable public Boolean getDynamicRoutes() { - return dynamicRoutes; - } - - public void setDynamicRoutes(@javax.annotation.Nullable Boolean dynamicRoutes) { - this.dynamicRoutes = dynamicRoutes; - } - - /** - * Universally Unique Identifier (UUID). - * - * @return id - */ - @javax.annotation.Nullable public UUID getId() { - return id; - } - - public AddRoutingTableToAreaPayload labels(@javax.annotation.Nullable Object labels) { - this.labels = labels; - return this; - } - - /** - * Object that represents the labels as key-value pairs of a resource. Key constraints: - May - * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must - * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain - * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), - * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 - * and 63 characters. - Must begin and end with an alphanumerical character - * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), - * dots (`.`), and alphanumerics in between. - Keys starting with the prefix - * `stackit-` or having a domain prefix of `stackit.cloud` (including its - * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value - * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not - * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May - * contain dashes (`-`), underscores (`_`), dots (`.`), and - * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are - * excluded from this count. Providing a `null` value for a key will remove that key. - * - * @return labels - */ - @javax.annotation.Nullable public Object getLabels() { - return labels; - } - - public void setLabels(@javax.annotation.Nullable Object labels) { - this.labels = labels; - } - - public AddRoutingTableToAreaPayload name(@javax.annotation.Nonnull String name) { - this.name = name; - return this; - } - - /** - * The name for a General Object. Matches Names and also UUIDs. - * - * @return name - */ - @javax.annotation.Nonnull - public String getName() { - return name; - } - - public void setName(@javax.annotation.Nonnull String name) { - this.name = name; - } - - public AddRoutingTableToAreaPayload systemRoutes( - @javax.annotation.Nullable Boolean systemRoutes) { - this.systemRoutes = systemRoutes; - return this; - } - - /** - * A config setting for a routing table which allows installation of automatic system routes for - * connectivity between projects in the same SNA. - * - * @return systemRoutes - */ - @javax.annotation.Nullable public Boolean getSystemRoutes() { - return systemRoutes; - } - - public void setSystemRoutes(@javax.annotation.Nullable Boolean systemRoutes) { - this.systemRoutes = systemRoutes; - } - - /** - * Date-time when resource was last updated. - * - * @return updatedAt - */ - @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { - return updatedAt; - } - - /** - * 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. - * - * @param key name of the property - * @param value value of the property - * @return the AddRoutingTableToAreaPayload instance itself - */ - public AddRoutingTableToAreaPayload 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. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - 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; - } - AddRoutingTableToAreaPayload addRoutingTableToAreaPayload = - (AddRoutingTableToAreaPayload) o; - return Objects.equals(this.createdAt, addRoutingTableToAreaPayload.createdAt) - && Objects.equals(this._default, addRoutingTableToAreaPayload._default) - && Objects.equals(this.description, addRoutingTableToAreaPayload.description) - && Objects.equals(this.dynamicRoutes, addRoutingTableToAreaPayload.dynamicRoutes) - && Objects.equals(this.id, addRoutingTableToAreaPayload.id) - && Objects.equals(this.labels, addRoutingTableToAreaPayload.labels) - && Objects.equals(this.name, addRoutingTableToAreaPayload.name) - && Objects.equals(this.systemRoutes, addRoutingTableToAreaPayload.systemRoutes) - && Objects.equals(this.updatedAt, addRoutingTableToAreaPayload.updatedAt) - && Objects.equals( - this.additionalProperties, - addRoutingTableToAreaPayload.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash( - createdAt, - _default, - description, - dynamicRoutes, - id, - labels, - name, - systemRoutes, - updatedAt, - additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AddRoutingTableToAreaPayload {\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" _default: ").append(toIndentedString(_default)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" dynamicRoutes: ").append(toIndentedString(dynamicRoutes)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" systemRoutes: ").append(toIndentedString(systemRoutes)).append("\n"); - sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).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( - Arrays.asList( - "createdAt", - "default", - "description", - "dynamicRoutes", - "id", - "labels", - "name", - "systemRoutes", - "updatedAt")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("name")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * AddRoutingTableToAreaPayload - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AddRoutingTableToAreaPayload.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field(s) %s in AddRoutingTableToAreaPayload is not found in the empty JSON string", - AddRoutingTableToAreaPayload.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AddRoutingTableToAreaPayload.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field `%s` is not found in the JSON string: %s", - requiredField, - jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) - && !jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `description` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("description").toString())); - } - if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) - && !jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `id` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("id").toString())); - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "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 (!AddRoutingTableToAreaPayload.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AddRoutingTableToAreaPayload' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(AddRoutingTableToAreaPayload.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, AddRoutingTableToAreaPayload value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional 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 { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public AddRoutingTableToAreaPayload read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - AddRoutingTableToAreaPayload 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( - java.util.Locale.ROOT, - "The field `%s` has unknown primitive type. Value: %s", - entry.getKey(), - entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - }.nullSafe(); - } - } - - /** - * Create an instance of AddRoutingTableToAreaPayload given an JSON string - * - * @param jsonString JSON string - * @return An instance of AddRoutingTableToAreaPayload - * @throws IOException if the JSON string is invalid with respect to - * AddRoutingTableToAreaPayload - */ - public static AddRoutingTableToAreaPayload fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AddRoutingTableToAreaPayload.class); - } - - /** - * Convert an instance of AddRoutingTableToAreaPayload to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AddVPCRoutingTablePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AddVPCRoutingTablePayload.java deleted file mode 100644 index 5aa0e304..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AddVPCRoutingTablePayload.java +++ /dev/null @@ -1,519 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.model; - -import cloud.stackit.sdk.iaas.v2alpha1api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.UUID; - -/** - * An object representing a VPC routing table. Filterable Fields: `createdAt`, - * `dynamicRoutes`, `name`, `systemRoutes`, `updatedAt`. - */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class AddVPCRoutingTablePayload { - public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; - - @SerializedName(SERIALIZED_NAME_CREATED_AT) - @javax.annotation.Nullable private OffsetDateTime createdAt; - - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - @javax.annotation.Nullable private String description; - - public static final String SERIALIZED_NAME_DYNAMIC_ROUTES = "dynamicRoutes"; - - @SerializedName(SERIALIZED_NAME_DYNAMIC_ROUTES) - @javax.annotation.Nullable private Boolean dynamicRoutes = true; - - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - @javax.annotation.Nullable private UUID id; - - public static final String SERIALIZED_NAME_LABELS = "labels"; - - @SerializedName(SERIALIZED_NAME_LABELS) - @javax.annotation.Nullable private Object labels; - - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - @javax.annotation.Nonnull - private String name; - - public static final String SERIALIZED_NAME_SYSTEM_ROUTES = "systemRoutes"; - - @SerializedName(SERIALIZED_NAME_SYSTEM_ROUTES) - @javax.annotation.Nullable private Boolean systemRoutes = true; - - public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; - - @SerializedName(SERIALIZED_NAME_UPDATED_AT) - @javax.annotation.Nullable private OffsetDateTime updatedAt; - - public AddVPCRoutingTablePayload() {} - - public AddVPCRoutingTablePayload(OffsetDateTime createdAt, UUID id, OffsetDateTime updatedAt) { - this(); - this.createdAt = createdAt; - this.id = id; - this.updatedAt = updatedAt; - } - - /** - * Date-time when resource was created. - * - * @return createdAt - */ - @javax.annotation.Nullable public OffsetDateTime getCreatedAt() { - return createdAt; - } - - public AddVPCRoutingTablePayload description(@javax.annotation.Nullable String description) { - this.description = description; - return this; - } - - /** - * Description Object. Allows string up to 255 Characters. - * - * @return description - */ - @javax.annotation.Nullable public String getDescription() { - return description; - } - - public void setDescription(@javax.annotation.Nullable String description) { - this.description = description; - } - - public AddVPCRoutingTablePayload dynamicRoutes( - @javax.annotation.Nullable Boolean dynamicRoutes) { - this.dynamicRoutes = dynamicRoutes; - return this; - } - - /** - * A config setting for a routing table which allows propagation of dynamic routes to this - * routing table. - * - * @return dynamicRoutes - */ - @javax.annotation.Nullable public Boolean getDynamicRoutes() { - return dynamicRoutes; - } - - public void setDynamicRoutes(@javax.annotation.Nullable Boolean dynamicRoutes) { - this.dynamicRoutes = dynamicRoutes; - } - - /** - * Universally Unique Identifier (UUID). - * - * @return id - */ - @javax.annotation.Nullable public UUID getId() { - return id; - } - - public AddVPCRoutingTablePayload labels(@javax.annotation.Nullable Object labels) { - this.labels = labels; - return this; - } - - /** - * Object that represents the labels as key-value pairs of a resource. Key constraints: - May - * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must - * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain - * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), - * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 - * and 63 characters. - Must begin and end with an alphanumerical character - * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), - * dots (`.`), and alphanumerics in between. - Keys starting with the prefix - * `stackit-` or having a domain prefix of `stackit.cloud` (including its - * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value - * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not - * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May - * contain dashes (`-`), underscores (`_`), dots (`.`), and - * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are - * excluded from this count. Providing a `null` value for a key will remove that key. - * - * @return labels - */ - @javax.annotation.Nullable public Object getLabels() { - return labels; - } - - public void setLabels(@javax.annotation.Nullable Object labels) { - this.labels = labels; - } - - public AddVPCRoutingTablePayload name(@javax.annotation.Nonnull String name) { - this.name = name; - return this; - } - - /** - * The name for a General Object. Matches Names and also UUIDs. - * - * @return name - */ - @javax.annotation.Nonnull - public String getName() { - return name; - } - - public void setName(@javax.annotation.Nonnull String name) { - this.name = name; - } - - public AddVPCRoutingTablePayload systemRoutes(@javax.annotation.Nullable Boolean systemRoutes) { - this.systemRoutes = systemRoutes; - return this; - } - - /** - * A config setting for a routing table which allows installation of automatic system routes for - * connectivity between projects in the same SNA. - * - * @return systemRoutes - */ - @javax.annotation.Nullable public Boolean getSystemRoutes() { - return systemRoutes; - } - - public void setSystemRoutes(@javax.annotation.Nullable Boolean systemRoutes) { - this.systemRoutes = systemRoutes; - } - - /** - * Date-time when resource was last updated. - * - * @return updatedAt - */ - @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { - return updatedAt; - } - - /** - * 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. - * - * @param key name of the property - * @param value value of the property - * @return the AddVPCRoutingTablePayload instance itself - */ - public AddVPCRoutingTablePayload 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. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - 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; - } - AddVPCRoutingTablePayload addVPCRoutingTablePayload = (AddVPCRoutingTablePayload) o; - return Objects.equals(this.createdAt, addVPCRoutingTablePayload.createdAt) - && Objects.equals(this.description, addVPCRoutingTablePayload.description) - && Objects.equals(this.dynamicRoutes, addVPCRoutingTablePayload.dynamicRoutes) - && Objects.equals(this.id, addVPCRoutingTablePayload.id) - && Objects.equals(this.labels, addVPCRoutingTablePayload.labels) - && Objects.equals(this.name, addVPCRoutingTablePayload.name) - && Objects.equals(this.systemRoutes, addVPCRoutingTablePayload.systemRoutes) - && Objects.equals(this.updatedAt, addVPCRoutingTablePayload.updatedAt) - && Objects.equals( - this.additionalProperties, addVPCRoutingTablePayload.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash( - createdAt, - description, - dynamicRoutes, - id, - labels, - name, - systemRoutes, - updatedAt, - additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AddVPCRoutingTablePayload {\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" dynamicRoutes: ").append(toIndentedString(dynamicRoutes)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" systemRoutes: ").append(toIndentedString(systemRoutes)).append("\n"); - sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).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( - Arrays.asList( - "createdAt", - "description", - "dynamicRoutes", - "id", - "labels", - "name", - "systemRoutes", - "updatedAt")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("name")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AddVPCRoutingTablePayload - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AddVPCRoutingTablePayload.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field(s) %s in AddVPCRoutingTablePayload is not found in the empty JSON string", - AddVPCRoutingTablePayload.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AddVPCRoutingTablePayload.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field `%s` is not found in the JSON string: %s", - requiredField, - jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) - && !jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `description` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("description").toString())); - } - if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) - && !jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `id` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("id").toString())); - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "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 (!AddVPCRoutingTablePayload.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AddVPCRoutingTablePayload' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(AddVPCRoutingTablePayload.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, AddVPCRoutingTablePayload value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional 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 { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public AddVPCRoutingTablePayload read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - AddVPCRoutingTablePayload 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( - java.util.Locale.ROOT, - "The field `%s` has unknown primitive type. Value: %s", - entry.getKey(), - entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - }.nullSafe(); - } - } - - /** - * Create an instance of AddVPCRoutingTablePayload given an JSON string - * - * @param jsonString JSON string - * @return An instance of AddVPCRoutingTablePayload - * @throws IOException if the JSON string is invalid with respect to AddVPCRoutingTablePayload - */ - public static AddVPCRoutingTablePayload fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AddVPCRoutingTablePayload.class); - } - - /** - * Convert an instance of AddVPCRoutingTablePayload to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AddVPCStaticRoutePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AddVPCStaticRoutePayload.java deleted file mode 100644 index f0c09ec1..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AddVPCStaticRoutePayload.java +++ /dev/null @@ -1,447 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.model; - -import cloud.stackit.sdk.iaas.v2alpha1api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.UUID; - -/** Object represents a network route. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class AddVPCStaticRoutePayload { - public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; - - @SerializedName(SERIALIZED_NAME_CREATED_AT) - @javax.annotation.Nullable private OffsetDateTime createdAt; - - public static final String SERIALIZED_NAME_DESTINATION = "destination"; - - @SerializedName(SERIALIZED_NAME_DESTINATION) - @javax.annotation.Nonnull - private AddVPCStaticRoutePayloadDestination destination; - - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - @javax.annotation.Nullable private UUID id; - - public static final String SERIALIZED_NAME_LABELS = "labels"; - - @SerializedName(SERIALIZED_NAME_LABELS) - @javax.annotation.Nullable private Object labels; - - public static final String SERIALIZED_NAME_NEXTHOP = "nexthop"; - - @SerializedName(SERIALIZED_NAME_NEXTHOP) - @javax.annotation.Nonnull - private AddVPCStaticRoutePayloadNexthop nexthop; - - public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; - - @SerializedName(SERIALIZED_NAME_UPDATED_AT) - @javax.annotation.Nullable private OffsetDateTime updatedAt; - - public AddVPCStaticRoutePayload() {} - - public AddVPCStaticRoutePayload(OffsetDateTime createdAt, UUID id, OffsetDateTime updatedAt) { - this(); - this.createdAt = createdAt; - this.id = id; - this.updatedAt = updatedAt; - } - - /** - * Date-time when resource was created. - * - * @return createdAt - */ - @javax.annotation.Nullable public OffsetDateTime getCreatedAt() { - return createdAt; - } - - public AddVPCStaticRoutePayload destination( - @javax.annotation.Nonnull AddVPCStaticRoutePayloadDestination destination) { - this.destination = destination; - return this; - } - - /** - * Get destination - * - * @return destination - */ - @javax.annotation.Nonnull - public AddVPCStaticRoutePayloadDestination getDestination() { - return destination; - } - - public void setDestination( - @javax.annotation.Nonnull AddVPCStaticRoutePayloadDestination destination) { - this.destination = destination; - } - - /** - * Universally Unique Identifier (UUID). - * - * @return id - */ - @javax.annotation.Nullable public UUID getId() { - return id; - } - - public AddVPCStaticRoutePayload labels(@javax.annotation.Nullable Object labels) { - this.labels = labels; - return this; - } - - /** - * Object that represents the labels as key-value pairs of a resource. Key constraints: - May - * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must - * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain - * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), - * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 - * and 63 characters. - Must begin and end with an alphanumerical character - * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), - * dots (`.`), and alphanumerics in between. - Keys starting with the prefix - * `stackit-` or having a domain prefix of `stackit.cloud` (including its - * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value - * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not - * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May - * contain dashes (`-`), underscores (`_`), dots (`.`), and - * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are - * excluded from this count. Providing a `null` value for a key will remove that key. - * - * @return labels - */ - @javax.annotation.Nullable public Object getLabels() { - return labels; - } - - public void setLabels(@javax.annotation.Nullable Object labels) { - this.labels = labels; - } - - public AddVPCStaticRoutePayload nexthop( - @javax.annotation.Nonnull AddVPCStaticRoutePayloadNexthop nexthop) { - this.nexthop = nexthop; - return this; - } - - /** - * Get nexthop - * - * @return nexthop - */ - @javax.annotation.Nonnull - public AddVPCStaticRoutePayloadNexthop getNexthop() { - return nexthop; - } - - public void setNexthop(@javax.annotation.Nonnull AddVPCStaticRoutePayloadNexthop nexthop) { - this.nexthop = nexthop; - } - - /** - * Date-time when resource was last updated. - * - * @return updatedAt - */ - @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { - return updatedAt; - } - - /** - * 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. - * - * @param key name of the property - * @param value value of the property - * @return the AddVPCStaticRoutePayload instance itself - */ - public AddVPCStaticRoutePayload 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. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - 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; - } - AddVPCStaticRoutePayload addVPCStaticRoutePayload = (AddVPCStaticRoutePayload) o; - return Objects.equals(this.createdAt, addVPCStaticRoutePayload.createdAt) - && Objects.equals(this.destination, addVPCStaticRoutePayload.destination) - && Objects.equals(this.id, addVPCStaticRoutePayload.id) - && Objects.equals(this.labels, addVPCStaticRoutePayload.labels) - && Objects.equals(this.nexthop, addVPCStaticRoutePayload.nexthop) - && Objects.equals(this.updatedAt, addVPCStaticRoutePayload.updatedAt) - && Objects.equals( - this.additionalProperties, addVPCStaticRoutePayload.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash( - createdAt, destination, id, labels, nexthop, updatedAt, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AddVPCStaticRoutePayload {\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" destination: ").append(toIndentedString(destination)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); - sb.append(" nexthop: ").append(toIndentedString(nexthop)).append("\n"); - sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).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( - Arrays.asList( - "createdAt", - "destination", - "id", - "labels", - "nexthop", - "updatedAt")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("destination", "nexthop")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AddVPCStaticRoutePayload - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AddVPCStaticRoutePayload.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field(s) %s in AddVPCStaticRoutePayload is not found in the empty JSON string", - AddVPCStaticRoutePayload.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AddVPCStaticRoutePayload.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field `%s` is not found in the JSON string: %s", - requiredField, - jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the required field `destination` - AddVPCStaticRoutePayloadDestination.validateJsonElement(jsonObj.get("destination")); - if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) - && !jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `id` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("id").toString())); - } - // validate the required field `nexthop` - AddVPCStaticRoutePayloadNexthop.validateJsonElement(jsonObj.get("nexthop")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AddVPCStaticRoutePayload.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AddVPCStaticRoutePayload' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(AddVPCStaticRoutePayload.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, AddVPCStaticRoutePayload value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional 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 { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public AddVPCStaticRoutePayload read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - AddVPCStaticRoutePayload 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( - java.util.Locale.ROOT, - "The field `%s` has unknown primitive type. Value: %s", - entry.getKey(), - entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - }.nullSafe(); - } - } - - /** - * Create an instance of AddVPCStaticRoutePayload given an JSON string - * - * @param jsonString JSON string - * @return An instance of AddVPCStaticRoutePayload - * @throws IOException if the JSON string is invalid with respect to AddVPCStaticRoutePayload - */ - public static AddVPCStaticRoutePayload fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AddVPCStaticRoutePayload.class); - } - - /** - * Convert an instance of AddVPCStaticRoutePayload to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AddVPCStaticRoutePayloadDestination.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AddVPCStaticRoutePayloadDestination.java deleted file mode 100644 index 9a322de6..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AddVPCStaticRoutePayloadDestination.java +++ /dev/null @@ -1,295 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.model; - -import cloud.stackit.sdk.iaas.v2alpha1api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Map; -import java.util.logging.Level; -import java.util.logging.Logger; - -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class AddVPCStaticRoutePayloadDestination extends AbstractOpenApiSchema { - private static final Logger log = - Logger.getLogger(AddVPCStaticRoutePayloadDestination.class.getName()); - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AddVPCStaticRoutePayloadDestination.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AddVPCStaticRoutePayloadDestination' and - // its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter adapterDestinationCIDRv4 = - gson.getDelegateAdapter(this, TypeToken.get(DestinationCIDRv4.class)); - final TypeAdapter adapterDestinationCIDRv6 = - gson.getDelegateAdapter(this, TypeToken.get(DestinationCIDRv6.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, AddVPCStaticRoutePayloadDestination value) - throws IOException { - if (value == null || value.getActualInstance() == null) { - elementAdapter.write(out, null); - return; - } - - // check if the actual instance is of the type `DestinationCIDRv4` - if (value.getActualInstance() instanceof DestinationCIDRv4) { - JsonElement element = - adapterDestinationCIDRv4.toJsonTree( - (DestinationCIDRv4) value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - // check if the actual instance is of the type `DestinationCIDRv6` - if (value.getActualInstance() instanceof DestinationCIDRv6) { - JsonElement element = - adapterDestinationCIDRv6.toJsonTree( - (DestinationCIDRv6) value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - throw new IOException( - "Failed to serialize as the type doesn't match oneOf schemas: DestinationCIDRv4, DestinationCIDRv6"); - } - - @Override - public AddVPCStaticRoutePayloadDestination read(JsonReader in) - throws IOException { - Object deserialized = null; - JsonElement jsonElement = elementAdapter.read(in); - - int match = 0; - ArrayList errorMessages = new ArrayList<>(); - TypeAdapter actualAdapter = elementAdapter; - - // deserialize DestinationCIDRv4 - try { - // validate the JSON object to see if any exception is thrown - DestinationCIDRv4.validateJsonElement(jsonElement); - actualAdapter = adapterDestinationCIDRv4; - match++; - log.log( - Level.FINER, - "Input data matches schema 'DestinationCIDRv4'"); - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - java.util.Locale.ROOT, - "Deserialization for DestinationCIDRv4 failed with `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema 'DestinationCIDRv4'", - e); - } - // deserialize DestinationCIDRv6 - try { - // validate the JSON object to see if any exception is thrown - DestinationCIDRv6.validateJsonElement(jsonElement); - actualAdapter = adapterDestinationCIDRv6; - match++; - log.log( - Level.FINER, - "Input data matches schema 'DestinationCIDRv6'"); - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - java.util.Locale.ROOT, - "Deserialization for DestinationCIDRv6 failed with `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema 'DestinationCIDRv6'", - e); - } - - if (match == 1) { - AddVPCStaticRoutePayloadDestination ret = - new AddVPCStaticRoutePayloadDestination(); - ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); - return ret; - } - - throw new IOException( - String.format( - java.util.Locale.ROOT, - "Failed deserialization for AddVPCStaticRoutePayloadDestination: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", - match, - errorMessages, - jsonElement.toString())); - } - }.nullSafe(); - } - } - - // store a list of schema names defined in oneOf - public static final Map> schemas = new HashMap>(); - - public AddVPCStaticRoutePayloadDestination() { - super("oneOf", Boolean.FALSE); - } - - public AddVPCStaticRoutePayloadDestination(Object o) { - super("oneOf", Boolean.FALSE); - setActualInstance(o); - } - - static { - schemas.put("DestinationCIDRv4", DestinationCIDRv4.class); - schemas.put("DestinationCIDRv6", DestinationCIDRv6.class); - } - - @Override - public Map> getSchemas() { - return AddVPCStaticRoutePayloadDestination.schemas; - } - - /** - * Set the instance that matches the oneOf child schema, check the instance parameter is valid - * against the oneOf child schemas: DestinationCIDRv4, DestinationCIDRv6 - * - *

It could be an instance of the 'oneOf' schemas. - */ - @Override - public void setActualInstance(Object instance) { - if (instance instanceof DestinationCIDRv4) { - super.setActualInstance(instance); - return; - } - - if (instance instanceof DestinationCIDRv6) { - super.setActualInstance(instance); - return; - } - - throw new RuntimeException( - "Invalid instance type. Must be DestinationCIDRv4, DestinationCIDRv6"); - } - - /** - * Get the actual instance, which can be the following: DestinationCIDRv4, DestinationCIDRv6 - * - * @return The actual instance (DestinationCIDRv4, DestinationCIDRv6) - */ - @SuppressWarnings("unchecked") - @Override - public Object getActualInstance() { - return super.getActualInstance(); - } - - /** - * Get the actual instance of `DestinationCIDRv4`. If the actual instance is not - * `DestinationCIDRv4`, the ClassCastException will be thrown. - * - * @return The actual instance of `DestinationCIDRv4` - * @throws ClassCastException if the instance is not `DestinationCIDRv4` - */ - public DestinationCIDRv4 getDestinationCIDRv4() throws ClassCastException { - return (DestinationCIDRv4) super.getActualInstance(); - } - - /** - * Get the actual instance of `DestinationCIDRv6`. If the actual instance is not - * `DestinationCIDRv6`, the ClassCastException will be thrown. - * - * @return The actual instance of `DestinationCIDRv6` - * @throws ClassCastException if the instance is not `DestinationCIDRv6` - */ - public DestinationCIDRv6 getDestinationCIDRv6() throws ClassCastException { - return (DestinationCIDRv6) super.getActualInstance(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * AddVPCStaticRoutePayloadDestination - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - // validate oneOf schemas one by one - int validCount = 0; - ArrayList errorMessages = new ArrayList<>(); - // validate the json string with DestinationCIDRv4 - try { - DestinationCIDRv4.validateJsonElement(jsonElement); - validCount++; - } catch (Exception e) { - errorMessages.add( - String.format( - java.util.Locale.ROOT, - "Deserialization for DestinationCIDRv4 failed with `%s`.", - e.getMessage())); - // continue to the next one - } - // validate the json string with DestinationCIDRv6 - try { - DestinationCIDRv6.validateJsonElement(jsonElement); - validCount++; - } catch (Exception e) { - errorMessages.add( - String.format( - java.util.Locale.ROOT, - "Deserialization for DestinationCIDRv6 failed with `%s`.", - e.getMessage())); - // continue to the next one - } - if (validCount != 1) { - throw new IOException( - String.format( - java.util.Locale.ROOT, - "The JSON string is invalid for AddVPCStaticRoutePayloadDestination with oneOf schemas: DestinationCIDRv4, DestinationCIDRv6. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", - validCount, - errorMessages, - jsonElement.toString())); - } - } - - /** - * Create an instance of AddVPCStaticRoutePayloadDestination given an JSON string - * - * @param jsonString JSON string - * @return An instance of AddVPCStaticRoutePayloadDestination - * @throws IOException if the JSON string is invalid with respect to - * AddVPCStaticRoutePayloadDestination - */ - public static AddVPCStaticRoutePayloadDestination fromJson(String jsonString) - throws IOException { - return JSON.getGson().fromJson(jsonString, AddVPCStaticRoutePayloadDestination.class); - } - - /** - * Convert an instance of AddVPCStaticRoutePayloadDestination to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AddVPCStaticRoutePayloadNexthop.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AddVPCStaticRoutePayloadNexthop.java deleted file mode 100644 index 0339446a..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AddVPCStaticRoutePayloadNexthop.java +++ /dev/null @@ -1,409 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.model; - -import cloud.stackit.sdk.iaas.v2alpha1api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Map; -import java.util.logging.Level; -import java.util.logging.Logger; - -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class AddVPCStaticRoutePayloadNexthop extends AbstractOpenApiSchema { - private static final Logger log = - Logger.getLogger(AddVPCStaticRoutePayloadNexthop.class.getName()); - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AddVPCStaticRoutePayloadNexthop.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AddVPCStaticRoutePayloadNexthop' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter adapterNexthopIPv4 = - gson.getDelegateAdapter(this, TypeToken.get(NexthopIPv4.class)); - final TypeAdapter adapterNexthopIPv6 = - gson.getDelegateAdapter(this, TypeToken.get(NexthopIPv6.class)); - final TypeAdapter adapterNexthopInternet = - gson.getDelegateAdapter(this, TypeToken.get(NexthopInternet.class)); - final TypeAdapter adapterNexthopBlackhole = - gson.getDelegateAdapter(this, TypeToken.get(NexthopBlackhole.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, AddVPCStaticRoutePayloadNexthop value) - throws IOException { - if (value == null || value.getActualInstance() == null) { - elementAdapter.write(out, null); - return; - } - - // check if the actual instance is of the type `NexthopIPv4` - if (value.getActualInstance() instanceof NexthopIPv4) { - JsonElement element = - adapterNexthopIPv4.toJsonTree( - (NexthopIPv4) value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - // check if the actual instance is of the type `NexthopIPv6` - if (value.getActualInstance() instanceof NexthopIPv6) { - JsonElement element = - adapterNexthopIPv6.toJsonTree( - (NexthopIPv6) value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - // check if the actual instance is of the type `NexthopInternet` - if (value.getActualInstance() instanceof NexthopInternet) { - JsonElement element = - adapterNexthopInternet.toJsonTree( - (NexthopInternet) value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - // check if the actual instance is of the type `NexthopBlackhole` - if (value.getActualInstance() instanceof NexthopBlackhole) { - JsonElement element = - adapterNexthopBlackhole.toJsonTree( - (NexthopBlackhole) value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - throw new IOException( - "Failed to serialize as the type doesn't match oneOf schemas: NexthopBlackhole, NexthopIPv4, NexthopIPv6, NexthopInternet"); - } - - @Override - public AddVPCStaticRoutePayloadNexthop read(JsonReader in) - throws IOException { - Object deserialized = null; - JsonElement jsonElement = elementAdapter.read(in); - - int match = 0; - ArrayList errorMessages = new ArrayList<>(); - TypeAdapter actualAdapter = elementAdapter; - - // deserialize NexthopIPv4 - try { - // validate the JSON object to see if any exception is thrown - NexthopIPv4.validateJsonElement(jsonElement); - actualAdapter = adapterNexthopIPv4; - match++; - log.log(Level.FINER, "Input data matches schema 'NexthopIPv4'"); - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - java.util.Locale.ROOT, - "Deserialization for NexthopIPv4 failed with `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema 'NexthopIPv4'", - e); - } - // deserialize NexthopIPv6 - try { - // validate the JSON object to see if any exception is thrown - NexthopIPv6.validateJsonElement(jsonElement); - actualAdapter = adapterNexthopIPv6; - match++; - log.log(Level.FINER, "Input data matches schema 'NexthopIPv6'"); - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - java.util.Locale.ROOT, - "Deserialization for NexthopIPv6 failed with `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema 'NexthopIPv6'", - e); - } - // deserialize NexthopInternet - try { - // validate the JSON object to see if any exception is thrown - NexthopInternet.validateJsonElement(jsonElement); - actualAdapter = adapterNexthopInternet; - match++; - log.log(Level.FINER, "Input data matches schema 'NexthopInternet'"); - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - java.util.Locale.ROOT, - "Deserialization for NexthopInternet failed with `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema 'NexthopInternet'", - e); - } - // deserialize NexthopBlackhole - try { - // validate the JSON object to see if any exception is thrown - NexthopBlackhole.validateJsonElement(jsonElement); - actualAdapter = adapterNexthopBlackhole; - match++; - log.log( - Level.FINER, - "Input data matches schema 'NexthopBlackhole'"); - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - java.util.Locale.ROOT, - "Deserialization for NexthopBlackhole failed with `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema 'NexthopBlackhole'", - e); - } - - if (match == 1) { - AddVPCStaticRoutePayloadNexthop ret = - new AddVPCStaticRoutePayloadNexthop(); - ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); - return ret; - } - - throw new IOException( - String.format( - java.util.Locale.ROOT, - "Failed deserialization for AddVPCStaticRoutePayloadNexthop: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", - match, - errorMessages, - jsonElement.toString())); - } - }.nullSafe(); - } - } - - // store a list of schema names defined in oneOf - public static final Map> schemas = new HashMap>(); - - public AddVPCStaticRoutePayloadNexthop() { - super("oneOf", Boolean.FALSE); - } - - public AddVPCStaticRoutePayloadNexthop(Object o) { - super("oneOf", Boolean.FALSE); - setActualInstance(o); - } - - static { - schemas.put("NexthopIPv4", NexthopIPv4.class); - schemas.put("NexthopIPv6", NexthopIPv6.class); - schemas.put("NexthopInternet", NexthopInternet.class); - schemas.put("NexthopBlackhole", NexthopBlackhole.class); - } - - @Override - public Map> getSchemas() { - return AddVPCStaticRoutePayloadNexthop.schemas; - } - - /** - * Set the instance that matches the oneOf child schema, check the instance parameter is valid - * against the oneOf child schemas: NexthopBlackhole, NexthopIPv4, NexthopIPv6, NexthopInternet - * - *

It could be an instance of the 'oneOf' schemas. - */ - @Override - public void setActualInstance(Object instance) { - if (instance instanceof NexthopIPv4) { - super.setActualInstance(instance); - return; - } - - if (instance instanceof NexthopIPv6) { - super.setActualInstance(instance); - return; - } - - if (instance instanceof NexthopInternet) { - super.setActualInstance(instance); - return; - } - - if (instance instanceof NexthopBlackhole) { - super.setActualInstance(instance); - return; - } - - throw new RuntimeException( - "Invalid instance type. Must be NexthopBlackhole, NexthopIPv4, NexthopIPv6, NexthopInternet"); - } - - /** - * Get the actual instance, which can be the following: NexthopBlackhole, NexthopIPv4, - * NexthopIPv6, NexthopInternet - * - * @return The actual instance (NexthopBlackhole, NexthopIPv4, NexthopIPv6, NexthopInternet) - */ - @SuppressWarnings("unchecked") - @Override - public Object getActualInstance() { - return super.getActualInstance(); - } - - /** - * Get the actual instance of `NexthopIPv4`. If the actual instance is not `NexthopIPv4`, the - * ClassCastException will be thrown. - * - * @return The actual instance of `NexthopIPv4` - * @throws ClassCastException if the instance is not `NexthopIPv4` - */ - public NexthopIPv4 getNexthopIPv4() throws ClassCastException { - return (NexthopIPv4) super.getActualInstance(); - } - - /** - * Get the actual instance of `NexthopIPv6`. If the actual instance is not `NexthopIPv6`, the - * ClassCastException will be thrown. - * - * @return The actual instance of `NexthopIPv6` - * @throws ClassCastException if the instance is not `NexthopIPv6` - */ - public NexthopIPv6 getNexthopIPv6() throws ClassCastException { - return (NexthopIPv6) super.getActualInstance(); - } - - /** - * Get the actual instance of `NexthopInternet`. If the actual instance is not - * `NexthopInternet`, the ClassCastException will be thrown. - * - * @return The actual instance of `NexthopInternet` - * @throws ClassCastException if the instance is not `NexthopInternet` - */ - public NexthopInternet getNexthopInternet() throws ClassCastException { - return (NexthopInternet) super.getActualInstance(); - } - - /** - * Get the actual instance of `NexthopBlackhole`. If the actual instance is not - * `NexthopBlackhole`, the ClassCastException will be thrown. - * - * @return The actual instance of `NexthopBlackhole` - * @throws ClassCastException if the instance is not `NexthopBlackhole` - */ - public NexthopBlackhole getNexthopBlackhole() throws ClassCastException { - return (NexthopBlackhole) super.getActualInstance(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * AddVPCStaticRoutePayloadNexthop - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - // validate oneOf schemas one by one - int validCount = 0; - ArrayList errorMessages = new ArrayList<>(); - // validate the json string with NexthopIPv4 - try { - NexthopIPv4.validateJsonElement(jsonElement); - validCount++; - } catch (Exception e) { - errorMessages.add( - String.format( - java.util.Locale.ROOT, - "Deserialization for NexthopIPv4 failed with `%s`.", - e.getMessage())); - // continue to the next one - } - // validate the json string with NexthopIPv6 - try { - NexthopIPv6.validateJsonElement(jsonElement); - validCount++; - } catch (Exception e) { - errorMessages.add( - String.format( - java.util.Locale.ROOT, - "Deserialization for NexthopIPv6 failed with `%s`.", - e.getMessage())); - // continue to the next one - } - // validate the json string with NexthopInternet - try { - NexthopInternet.validateJsonElement(jsonElement); - validCount++; - } catch (Exception e) { - errorMessages.add( - String.format( - java.util.Locale.ROOT, - "Deserialization for NexthopInternet failed with `%s`.", - e.getMessage())); - // continue to the next one - } - // validate the json string with NexthopBlackhole - try { - NexthopBlackhole.validateJsonElement(jsonElement); - validCount++; - } catch (Exception e) { - errorMessages.add( - String.format( - java.util.Locale.ROOT, - "Deserialization for NexthopBlackhole failed with `%s`.", - e.getMessage())); - // continue to the next one - } - if (validCount != 1) { - throw new IOException( - String.format( - java.util.Locale.ROOT, - "The JSON string is invalid for AddVPCStaticRoutePayloadNexthop with oneOf schemas: NexthopBlackhole, NexthopIPv4, NexthopIPv6, NexthopInternet. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", - validCount, - errorMessages, - jsonElement.toString())); - } - } - - /** - * Create an instance of AddVPCStaticRoutePayloadNexthop given an JSON string - * - * @param jsonString JSON string - * @return An instance of AddVPCStaticRoutePayloadNexthop - * @throws IOException if the JSON string is invalid with respect to - * AddVPCStaticRoutePayloadNexthop - */ - public static AddVPCStaticRoutePayloadNexthop fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AddVPCStaticRoutePayloadNexthop.class); - } - - /** - * Convert an instance of AddVPCStaticRoutePayloadNexthop to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AllRouteListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AllRouteListResponse.java deleted file mode 100644 index 9aafb7e9..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AllRouteListResponse.java +++ /dev/null @@ -1,324 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.model; - -import cloud.stackit.sdk.iaas.v2alpha1api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** All routes list response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class AllRouteListResponse { - public static final String SERIALIZED_NAME_ITEMS = "items"; - - @SerializedName(SERIALIZED_NAME_ITEMS) - @javax.annotation.Nonnull - private List items = new ArrayList<>(); - - public AllRouteListResponse() {} - - public AllRouteListResponse items(@javax.annotation.Nonnull List items) { - this.items = items; - return this; - } - - public AllRouteListResponse addItemsItem(AnyRoute itemsItem) { - if (this.items == null) { - this.items = new ArrayList<>(); - } - this.items.add(itemsItem); - return this; - } - - /** - * A list of all routes. - * - * @return items - */ - @javax.annotation.Nonnull - public List getItems() { - return items; - } - - public void setItems(@javax.annotation.Nonnull List items) { - this.items = items; - } - - /** - * 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. - * - * @param key name of the property - * @param value value of the property - * @return the AllRouteListResponse instance itself - */ - public AllRouteListResponse 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. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - 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; - } - AllRouteListResponse allRouteListResponse = (AllRouteListResponse) o; - return Objects.equals(this.items, allRouteListResponse.items) - && Objects.equals( - this.additionalProperties, allRouteListResponse.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(items, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AllRouteListResponse {\n"); - sb.append(" items: ").append(toIndentedString(items)).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(Arrays.asList("items")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("items")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AllRouteListResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AllRouteListResponse.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field(s) %s in AllRouteListResponse is not found in the empty JSON string", - AllRouteListResponse.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AllRouteListResponse.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field `%s` is not found in the JSON string: %s", - requiredField, - jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - AnyRoute.validateJsonElement(jsonArrayitems.get(i)); - } - ; - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AllRouteListResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AllRouteListResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(AllRouteListResponse.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, AllRouteListResponse value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional 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 { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public AllRouteListResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - AllRouteListResponse 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( - java.util.Locale.ROOT, - "The field `%s` has unknown primitive type. Value: %s", - entry.getKey(), - entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - }.nullSafe(); - } - } - - /** - * Create an instance of AllRouteListResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of AllRouteListResponse - * @throws IOException if the JSON string is invalid with respect to AllRouteListResponse - */ - public static AllRouteListResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AllRouteListResponse.class); - } - - /** - * Convert an instance of AllRouteListResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AnyRoute.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AnyRoute.java deleted file mode 100644 index 3b4e5348..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AnyRoute.java +++ /dev/null @@ -1,402 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.model; - -import cloud.stackit.sdk.iaas.v2alpha1api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Map; -import java.util.logging.Level; -import java.util.logging.Logger; - -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class AnyRoute extends AbstractOpenApiSchema { - private static final Logger log = Logger.getLogger(AnyRoute.class.getName()); - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AnyRoute.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AnyRoute' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter adapterAnyRouteStatic = - gson.getDelegateAdapter(this, TypeToken.get(AnyRouteStatic.class)); - final TypeAdapter adapterAnyRouteDynamic = - gson.getDelegateAdapter(this, TypeToken.get(AnyRouteDynamic.class)); - final TypeAdapter adapterAnyRouteSystem = - gson.getDelegateAdapter(this, TypeToken.get(AnyRouteSystem.class)); - final TypeAdapter adapterAnyRouteService = - gson.getDelegateAdapter(this, TypeToken.get(AnyRouteService.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, AnyRoute value) throws IOException { - if (value == null || value.getActualInstance() == null) { - elementAdapter.write(out, null); - return; - } - - // check if the actual instance is of the type `AnyRouteStatic` - if (value.getActualInstance() instanceof AnyRouteStatic) { - JsonElement element = - adapterAnyRouteStatic.toJsonTree( - (AnyRouteStatic) value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - // check if the actual instance is of the type `AnyRouteDynamic` - if (value.getActualInstance() instanceof AnyRouteDynamic) { - JsonElement element = - adapterAnyRouteDynamic.toJsonTree( - (AnyRouteDynamic) value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - // check if the actual instance is of the type `AnyRouteSystem` - if (value.getActualInstance() instanceof AnyRouteSystem) { - JsonElement element = - adapterAnyRouteSystem.toJsonTree( - (AnyRouteSystem) value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - // check if the actual instance is of the type `AnyRouteService` - if (value.getActualInstance() instanceof AnyRouteService) { - JsonElement element = - adapterAnyRouteService.toJsonTree( - (AnyRouteService) value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - throw new IOException( - "Failed to serialize as the type doesn't match oneOf schemas: AnyRouteDynamic, AnyRouteService, AnyRouteStatic, AnyRouteSystem"); - } - - @Override - public AnyRoute read(JsonReader in) throws IOException { - Object deserialized = null; - JsonElement jsonElement = elementAdapter.read(in); - - int match = 0; - ArrayList errorMessages = new ArrayList<>(); - TypeAdapter actualAdapter = elementAdapter; - - // deserialize AnyRouteStatic - try { - // validate the JSON object to see if any exception is thrown - AnyRouteStatic.validateJsonElement(jsonElement); - actualAdapter = adapterAnyRouteStatic; - match++; - log.log(Level.FINER, "Input data matches schema 'AnyRouteStatic'"); - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - java.util.Locale.ROOT, - "Deserialization for AnyRouteStatic failed with `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema 'AnyRouteStatic'", - e); - } - // deserialize AnyRouteDynamic - try { - // validate the JSON object to see if any exception is thrown - AnyRouteDynamic.validateJsonElement(jsonElement); - actualAdapter = adapterAnyRouteDynamic; - match++; - log.log(Level.FINER, "Input data matches schema 'AnyRouteDynamic'"); - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - java.util.Locale.ROOT, - "Deserialization for AnyRouteDynamic failed with `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema 'AnyRouteDynamic'", - e); - } - // deserialize AnyRouteSystem - try { - // validate the JSON object to see if any exception is thrown - AnyRouteSystem.validateJsonElement(jsonElement); - actualAdapter = adapterAnyRouteSystem; - match++; - log.log(Level.FINER, "Input data matches schema 'AnyRouteSystem'"); - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - java.util.Locale.ROOT, - "Deserialization for AnyRouteSystem failed with `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema 'AnyRouteSystem'", - e); - } - // deserialize AnyRouteService - try { - // validate the JSON object to see if any exception is thrown - AnyRouteService.validateJsonElement(jsonElement); - actualAdapter = adapterAnyRouteService; - match++; - log.log(Level.FINER, "Input data matches schema 'AnyRouteService'"); - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - java.util.Locale.ROOT, - "Deserialization for AnyRouteService failed with `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema 'AnyRouteService'", - e); - } - - if (match == 1) { - AnyRoute ret = new AnyRoute(); - ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); - return ret; - } - - throw new IOException( - String.format( - java.util.Locale.ROOT, - "Failed deserialization for AnyRoute: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", - match, - errorMessages, - jsonElement.toString())); - } - }.nullSafe(); - } - } - - // store a list of schema names defined in oneOf - public static final Map> schemas = new HashMap>(); - - public AnyRoute() { - super("oneOf", Boolean.FALSE); - } - - public AnyRoute(Object o) { - super("oneOf", Boolean.FALSE); - setActualInstance(o); - } - - static { - schemas.put("AnyRouteStatic", AnyRouteStatic.class); - schemas.put("AnyRouteDynamic", AnyRouteDynamic.class); - schemas.put("AnyRouteSystem", AnyRouteSystem.class); - schemas.put("AnyRouteService", AnyRouteService.class); - } - - @Override - public Map> getSchemas() { - return AnyRoute.schemas; - } - - /** - * Set the instance that matches the oneOf child schema, check the instance parameter is valid - * against the oneOf child schemas: AnyRouteDynamic, AnyRouteService, AnyRouteStatic, - * AnyRouteSystem - * - *

It could be an instance of the 'oneOf' schemas. - */ - @Override - public void setActualInstance(Object instance) { - if (instance instanceof AnyRouteStatic) { - super.setActualInstance(instance); - return; - } - - if (instance instanceof AnyRouteDynamic) { - super.setActualInstance(instance); - return; - } - - if (instance instanceof AnyRouteSystem) { - super.setActualInstance(instance); - return; - } - - if (instance instanceof AnyRouteService) { - super.setActualInstance(instance); - return; - } - - throw new RuntimeException( - "Invalid instance type. Must be AnyRouteDynamic, AnyRouteService, AnyRouteStatic, AnyRouteSystem"); - } - - /** - * Get the actual instance, which can be the following: AnyRouteDynamic, AnyRouteService, - * AnyRouteStatic, AnyRouteSystem - * - * @return The actual instance (AnyRouteDynamic, AnyRouteService, AnyRouteStatic, - * AnyRouteSystem) - */ - @SuppressWarnings("unchecked") - @Override - public Object getActualInstance() { - return super.getActualInstance(); - } - - /** - * Get the actual instance of `AnyRouteStatic`. If the actual instance is not `AnyRouteStatic`, - * the ClassCastException will be thrown. - * - * @return The actual instance of `AnyRouteStatic` - * @throws ClassCastException if the instance is not `AnyRouteStatic` - */ - public AnyRouteStatic getAnyRouteStatic() throws ClassCastException { - return (AnyRouteStatic) super.getActualInstance(); - } - - /** - * Get the actual instance of `AnyRouteDynamic`. If the actual instance is not - * `AnyRouteDynamic`, the ClassCastException will be thrown. - * - * @return The actual instance of `AnyRouteDynamic` - * @throws ClassCastException if the instance is not `AnyRouteDynamic` - */ - public AnyRouteDynamic getAnyRouteDynamic() throws ClassCastException { - return (AnyRouteDynamic) super.getActualInstance(); - } - - /** - * Get the actual instance of `AnyRouteSystem`. If the actual instance is not `AnyRouteSystem`, - * the ClassCastException will be thrown. - * - * @return The actual instance of `AnyRouteSystem` - * @throws ClassCastException if the instance is not `AnyRouteSystem` - */ - public AnyRouteSystem getAnyRouteSystem() throws ClassCastException { - return (AnyRouteSystem) super.getActualInstance(); - } - - /** - * Get the actual instance of `AnyRouteService`. If the actual instance is not - * `AnyRouteService`, the ClassCastException will be thrown. - * - * @return The actual instance of `AnyRouteService` - * @throws ClassCastException if the instance is not `AnyRouteService` - */ - public AnyRouteService getAnyRouteService() throws ClassCastException { - return (AnyRouteService) super.getActualInstance(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AnyRoute - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - // validate oneOf schemas one by one - int validCount = 0; - ArrayList errorMessages = new ArrayList<>(); - // validate the json string with AnyRouteStatic - try { - AnyRouteStatic.validateJsonElement(jsonElement); - validCount++; - } catch (Exception e) { - errorMessages.add( - String.format( - java.util.Locale.ROOT, - "Deserialization for AnyRouteStatic failed with `%s`.", - e.getMessage())); - // continue to the next one - } - // validate the json string with AnyRouteDynamic - try { - AnyRouteDynamic.validateJsonElement(jsonElement); - validCount++; - } catch (Exception e) { - errorMessages.add( - String.format( - java.util.Locale.ROOT, - "Deserialization for AnyRouteDynamic failed with `%s`.", - e.getMessage())); - // continue to the next one - } - // validate the json string with AnyRouteSystem - try { - AnyRouteSystem.validateJsonElement(jsonElement); - validCount++; - } catch (Exception e) { - errorMessages.add( - String.format( - java.util.Locale.ROOT, - "Deserialization for AnyRouteSystem failed with `%s`.", - e.getMessage())); - // continue to the next one - } - // validate the json string with AnyRouteService - try { - AnyRouteService.validateJsonElement(jsonElement); - validCount++; - } catch (Exception e) { - errorMessages.add( - String.format( - java.util.Locale.ROOT, - "Deserialization for AnyRouteService failed with `%s`.", - e.getMessage())); - // continue to the next one - } - if (validCount != 1) { - throw new IOException( - String.format( - java.util.Locale.ROOT, - "The JSON string is invalid for AnyRoute with oneOf schemas: AnyRouteDynamic, AnyRouteService, AnyRouteStatic, AnyRouteSystem. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", - validCount, - errorMessages, - jsonElement.toString())); - } - } - - /** - * Create an instance of AnyRoute given an JSON string - * - * @param jsonString JSON string - * @return An instance of AnyRoute - * @throws IOException if the JSON string is invalid with respect to AnyRoute - */ - public static AnyRoute fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AnyRoute.class); - } - - /** - * Convert an instance of AnyRoute to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AnyRouteDynamic.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AnyRouteDynamic.java deleted file mode 100644 index 6c563c75..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AnyRouteDynamic.java +++ /dev/null @@ -1,364 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.model; - -import cloud.stackit.sdk.iaas.v2alpha1api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** Object representing route of type dynamic. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class AnyRouteDynamic { - public static final String SERIALIZED_NAME_DESTINATION = "destination"; - - @SerializedName(SERIALIZED_NAME_DESTINATION) - @javax.annotation.Nonnull - private RouteDestination destination; - - public static final String SERIALIZED_NAME_TYPE = "type"; - - @SerializedName(SERIALIZED_NAME_TYPE) - @javax.annotation.Nonnull - private String type; - - public static final String SERIALIZED_NAME_SOURCE = "source"; - - @SerializedName(SERIALIZED_NAME_SOURCE) - @javax.annotation.Nullable private AnyRouteSource source; - - public AnyRouteDynamic() {} - - public AnyRouteDynamic destination(@javax.annotation.Nonnull RouteDestination destination) { - this.destination = destination; - return this; - } - - /** - * Get destination - * - * @return destination - */ - @javax.annotation.Nonnull - public RouteDestination getDestination() { - return destination; - } - - public void setDestination(@javax.annotation.Nonnull RouteDestination destination) { - this.destination = destination; - } - - public AnyRouteDynamic type(@javax.annotation.Nonnull String type) { - this.type = type; - return this; - } - - /** - * The type of the route. Possible values: `STATIC`, `DYNAMIC`, - * `SYSTEM`, `SERVICE`. - * - * @return type - */ - @javax.annotation.Nonnull - public String getType() { - return type; - } - - public void setType(@javax.annotation.Nonnull String type) { - this.type = type; - } - - public AnyRouteDynamic source(@javax.annotation.Nullable AnyRouteSource source) { - this.source = source; - return this; - } - - /** - * Get source - * - * @return source - */ - @javax.annotation.Nullable public AnyRouteSource getSource() { - return source; - } - - public void setSource(@javax.annotation.Nullable AnyRouteSource source) { - this.source = source; - } - - /** - * 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. - * - * @param key name of the property - * @param value value of the property - * @return the AnyRouteDynamic instance itself - */ - public AnyRouteDynamic 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. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - 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; - } - AnyRouteDynamic anyRouteDynamic = (AnyRouteDynamic) o; - return Objects.equals(this.destination, anyRouteDynamic.destination) - && Objects.equals(this.type, anyRouteDynamic.type) - && Objects.equals(this.source, anyRouteDynamic.source) - && Objects.equals(this.additionalProperties, anyRouteDynamic.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(destination, type, source, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AnyRouteDynamic {\n"); - sb.append(" destination: ").append(toIndentedString(destination)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" source: ").append(toIndentedString(source)).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(Arrays.asList("destination", "type", "source")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("destination", "type")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AnyRouteDynamic - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AnyRouteDynamic.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field(s) %s in AnyRouteDynamic is not found in the empty JSON string", - AnyRouteDynamic.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AnyRouteDynamic.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field `%s` is not found in the JSON string: %s", - requiredField, - jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the required field `destination` - RouteDestination.validateJsonElement(jsonObj.get("destination")); - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `type` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("type").toString())); - } - // validate the optional field `source` - if (jsonObj.get("source") != null && !jsonObj.get("source").isJsonNull()) { - AnyRouteSource.validateJsonElement(jsonObj.get("source")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AnyRouteDynamic.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AnyRouteDynamic' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(AnyRouteDynamic.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, AnyRouteDynamic value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional 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 { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public AnyRouteDynamic read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - AnyRouteDynamic 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( - java.util.Locale.ROOT, - "The field `%s` has unknown primitive type. Value: %s", - entry.getKey(), - entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - }.nullSafe(); - } - } - - /** - * Create an instance of AnyRouteDynamic given an JSON string - * - * @param jsonString JSON string - * @return An instance of AnyRouteDynamic - * @throws IOException if the JSON string is invalid with respect to AnyRouteDynamic - */ - public static AnyRouteDynamic fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AnyRouteDynamic.class); - } - - /** - * Convert an instance of AnyRouteDynamic to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AnyRouteService.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AnyRouteService.java deleted file mode 100644 index 7356b0e5..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AnyRouteService.java +++ /dev/null @@ -1,364 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.model; - -import cloud.stackit.sdk.iaas.v2alpha1api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** Object representing route of type service. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class AnyRouteService { - public static final String SERIALIZED_NAME_DESTINATION = "destination"; - - @SerializedName(SERIALIZED_NAME_DESTINATION) - @javax.annotation.Nonnull - private RouteDestination destination; - - public static final String SERIALIZED_NAME_TYPE = "type"; - - @SerializedName(SERIALIZED_NAME_TYPE) - @javax.annotation.Nonnull - private String type; - - public static final String SERIALIZED_NAME_SOURCE = "source"; - - @SerializedName(SERIALIZED_NAME_SOURCE) - @javax.annotation.Nullable private AnyRouteSource source; - - public AnyRouteService() {} - - public AnyRouteService destination(@javax.annotation.Nonnull RouteDestination destination) { - this.destination = destination; - return this; - } - - /** - * Get destination - * - * @return destination - */ - @javax.annotation.Nonnull - public RouteDestination getDestination() { - return destination; - } - - public void setDestination(@javax.annotation.Nonnull RouteDestination destination) { - this.destination = destination; - } - - public AnyRouteService type(@javax.annotation.Nonnull String type) { - this.type = type; - return this; - } - - /** - * The type of the route. Possible values: `STATIC`, `DYNAMIC`, - * `SYSTEM`, `SERVICE`. - * - * @return type - */ - @javax.annotation.Nonnull - public String getType() { - return type; - } - - public void setType(@javax.annotation.Nonnull String type) { - this.type = type; - } - - public AnyRouteService source(@javax.annotation.Nullable AnyRouteSource source) { - this.source = source; - return this; - } - - /** - * Get source - * - * @return source - */ - @javax.annotation.Nullable public AnyRouteSource getSource() { - return source; - } - - public void setSource(@javax.annotation.Nullable AnyRouteSource source) { - this.source = source; - } - - /** - * 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. - * - * @param key name of the property - * @param value value of the property - * @return the AnyRouteService instance itself - */ - public AnyRouteService 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. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - 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; - } - AnyRouteService anyRouteService = (AnyRouteService) o; - return Objects.equals(this.destination, anyRouteService.destination) - && Objects.equals(this.type, anyRouteService.type) - && Objects.equals(this.source, anyRouteService.source) - && Objects.equals(this.additionalProperties, anyRouteService.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(destination, type, source, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AnyRouteService {\n"); - sb.append(" destination: ").append(toIndentedString(destination)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" source: ").append(toIndentedString(source)).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(Arrays.asList("destination", "type", "source")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("destination", "type")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AnyRouteService - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AnyRouteService.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field(s) %s in AnyRouteService is not found in the empty JSON string", - AnyRouteService.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AnyRouteService.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field `%s` is not found in the JSON string: %s", - requiredField, - jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the required field `destination` - RouteDestination.validateJsonElement(jsonObj.get("destination")); - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `type` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("type").toString())); - } - // validate the optional field `source` - if (jsonObj.get("source") != null && !jsonObj.get("source").isJsonNull()) { - AnyRouteSource.validateJsonElement(jsonObj.get("source")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AnyRouteService.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AnyRouteService' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(AnyRouteService.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, AnyRouteService value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional 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 { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public AnyRouteService read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - AnyRouteService 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( - java.util.Locale.ROOT, - "The field `%s` has unknown primitive type. Value: %s", - entry.getKey(), - entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - }.nullSafe(); - } - } - - /** - * Create an instance of AnyRouteService given an JSON string - * - * @param jsonString JSON string - * @return An instance of AnyRouteService - * @throws IOException if the JSON string is invalid with respect to AnyRouteService - */ - public static AnyRouteService fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AnyRouteService.class); - } - - /** - * Convert an instance of AnyRouteService to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AnyRouteSource.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AnyRouteSource.java deleted file mode 100644 index 17d2edc0..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AnyRouteSource.java +++ /dev/null @@ -1,333 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.model; - -import cloud.stackit.sdk.iaas.v2alpha1api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** Object that represents the source information for any route. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class AnyRouteSource { - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - @javax.annotation.Nullable private AnyRouteSourceId id; - - public static final String SERIALIZED_NAME_TYPE = "type"; - - @SerializedName(SERIALIZED_NAME_TYPE) - @javax.annotation.Nonnull - private String type; - - public AnyRouteSource() {} - - public AnyRouteSource id(@javax.annotation.Nullable AnyRouteSourceId id) { - this.id = id; - return this; - } - - /** - * Get id - * - * @return id - */ - @javax.annotation.Nullable public AnyRouteSourceId getId() { - return id; - } - - public void setId(@javax.annotation.Nullable AnyRouteSourceId id) { - this.id = id; - } - - public AnyRouteSource type(@javax.annotation.Nonnull String type) { - this.type = type; - return this; - } - - /** - * The origin of the route. - * - * @return type - */ - @javax.annotation.Nonnull - public String getType() { - return type; - } - - public void setType(@javax.annotation.Nonnull String type) { - this.type = type; - } - - /** - * 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. - * - * @param key name of the property - * @param value value of the property - * @return the AnyRouteSource instance itself - */ - public AnyRouteSource 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. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - 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; - } - AnyRouteSource anyRouteSource = (AnyRouteSource) o; - return Objects.equals(this.id, anyRouteSource.id) - && Objects.equals(this.type, anyRouteSource.type) - && Objects.equals(this.additionalProperties, anyRouteSource.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(id, type, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AnyRouteSource {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).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(Arrays.asList("id", "type")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("type")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AnyRouteSource - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AnyRouteSource.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field(s) %s in AnyRouteSource is not found in the empty JSON string", - AnyRouteSource.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AnyRouteSource.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field `%s` is not found in the JSON string: %s", - requiredField, - jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `id` - if (jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) { - AnyRouteSourceId.validateJsonElement(jsonObj.get("id")); - } - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `type` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("type").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AnyRouteSource.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AnyRouteSource' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(AnyRouteSource.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, AnyRouteSource value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional 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 { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public AnyRouteSource read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - AnyRouteSource 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( - java.util.Locale.ROOT, - "The field `%s` has unknown primitive type. Value: %s", - entry.getKey(), - entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - }.nullSafe(); - } - } - - /** - * Create an instance of AnyRouteSource given an JSON string - * - * @param jsonString JSON string - * @return An instance of AnyRouteSource - * @throws IOException if the JSON string is invalid with respect to AnyRouteSource - */ - public static AnyRouteSource fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AnyRouteSource.class); - } - - /** - * Convert an instance of AnyRouteSource to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AnyRouteSourceId.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AnyRouteSourceId.java deleted file mode 100644 index 1e784314..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AnyRouteSourceId.java +++ /dev/null @@ -1,284 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.model; - -import cloud.stackit.sdk.iaas.v2alpha1api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonPrimitive; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; -import java.util.logging.Level; -import java.util.logging.Logger; - -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class AnyRouteSourceId extends AbstractOpenApiSchema { - private static final Logger log = Logger.getLogger(AnyRouteSourceId.class.getName()); - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AnyRouteSourceId.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AnyRouteSourceId' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter adapterUUID = - gson.getDelegateAdapter(this, TypeToken.get(UUID.class)); - final TypeAdapter adapterString = - gson.getDelegateAdapter(this, TypeToken.get(String.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, AnyRouteSourceId value) - throws IOException { - if (value == null || value.getActualInstance() == null) { - elementAdapter.write(out, null); - return; - } - - // check if the actual instance is of the type `UUID` - if (value.getActualInstance() instanceof UUID) { - JsonElement element = - adapterUUID.toJsonTree((UUID) value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - // check if the actual instance is of the type `String` - if (value.getActualInstance() instanceof String) { - JsonPrimitive primitive = - adapterString - .toJsonTree((String) value.getActualInstance()) - .getAsJsonPrimitive(); - elementAdapter.write(out, primitive); - return; - } - throw new IOException( - "Failed to serialize as the type doesn't match anyOf schemas: String, UUID"); - } - - @Override - public AnyRouteSourceId read(JsonReader in) throws IOException { - Object deserialized = null; - JsonElement jsonElement = elementAdapter.read(in); - - ArrayList errorMessages = new ArrayList<>(); - TypeAdapter actualAdapter = elementAdapter; - - // deserialize UUID - try { - // validate the JSON object to see if any exception is thrown - UUID.fromString(jsonElement.getAsString()); - actualAdapter = adapterUUID; - AnyRouteSourceId ret = new AnyRouteSourceId(); - ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); - return ret; - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - java.util.Locale.ROOT, - "Deserialization for UUID failed with `%s`.", - e.getMessage())); - log.log(Level.FINER, "Input data does not match schema 'UUID'", e); - } - // deserialize String - try { - // validate the JSON object to see if any exception is thrown - if (!jsonElement.getAsJsonPrimitive().isString()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected json element to be of type String in the JSON string but got `%s`", - jsonElement.toString())); - } - actualAdapter = adapterString; - AnyRouteSourceId ret = new AnyRouteSourceId(); - ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); - return ret; - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - java.util.Locale.ROOT, - "Deserialization for String failed with `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema 'String'", - e); - } - - throw new IOException( - String.format( - java.util.Locale.ROOT, - "Failed deserialization for AnyRouteSourceId: no class matches result, expected at least 1. Detailed failure message for anyOf schemas: %s. JSON: %s", - errorMessages, - jsonElement.toString())); - } - }.nullSafe(); - } - } - - // store a list of schema names defined in anyOf - public static final Map> schemas = new HashMap>(); - - public AnyRouteSourceId() { - super("anyOf", Boolean.FALSE); - } - - public AnyRouteSourceId(Object o) { - super("anyOf", Boolean.FALSE); - setActualInstance(o); - } - - static { - schemas.put("UUID", UUID.class); - schemas.put("String", String.class); - } - - @Override - public Map> getSchemas() { - return AnyRouteSourceId.schemas; - } - - /** - * Set the instance that matches the anyOf child schema, check the instance parameter is valid - * against the anyOf child schemas: String, UUID - * - *

It could be an instance of the 'anyOf' schemas. - */ - @Override - public void setActualInstance(Object instance) { - if (instance instanceof UUID) { - super.setActualInstance(instance); - return; - } - - if (instance instanceof String) { - super.setActualInstance(instance); - return; - } - - throw new RuntimeException("Invalid instance type. Must be String, UUID"); - } - - /** - * Get the actual instance, which can be the following: String, UUID - * - * @return The actual instance (String, UUID) - */ - @SuppressWarnings("unchecked") - @Override - public Object getActualInstance() { - return super.getActualInstance(); - } - - /** - * Get the actual instance of `UUID`. If the actual instance is not `UUID`, the - * ClassCastException will be thrown. - * - * @return The actual instance of `UUID` - * @throws ClassCastException if the instance is not `UUID` - */ - public UUID getUUID() throws ClassCastException { - return (UUID) super.getActualInstance(); - } - - /** - * Get the actual instance of `String`. If the actual instance is not `String`, the - * ClassCastException will be thrown. - * - * @return The actual instance of `String` - * @throws ClassCastException if the instance is not `String` - */ - public String getString() throws ClassCastException { - return (String) super.getActualInstance(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AnyRouteSourceId - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - // validate anyOf schemas one by one - ArrayList errorMessages = new ArrayList<>(); - // validate the json string with UUID - try { - UUID.fromString(jsonElement.getAsString()); - return; - } catch (Exception e) { - errorMessages.add( - String.format( - java.util.Locale.ROOT, - "Deserialization for UUID failed with `%s`.", - e.getMessage())); - // continue to the next one - } - // validate the json string with String - try { - if (!jsonElement.getAsJsonPrimitive().isString()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected json element to be of type String in the JSON string but got `%s`", - jsonElement.toString())); - } - return; - } catch (Exception e) { - errorMessages.add( - String.format( - java.util.Locale.ROOT, - "Deserialization for String failed with `%s`.", - e.getMessage())); - // continue to the next one - } - throw new IOException( - String.format( - java.util.Locale.ROOT, - "The JSON string is invalid for AnyRouteSourceId with anyOf schemas: String, UUID. no class match the result, expected at least 1. Detailed failure message for anyOf schemas: %s. JSON: %s", - errorMessages, - jsonElement.toString())); - } - - /** - * Create an instance of AnyRouteSourceId given an JSON string - * - * @param jsonString JSON string - * @return An instance of AnyRouteSourceId - * @throws IOException if the JSON string is invalid with respect to AnyRouteSourceId - */ - public static AnyRouteSourceId fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AnyRouteSourceId.class); - } - - /** - * Convert an instance of AnyRouteSourceId to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AnyRouteStatic.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AnyRouteStatic.java deleted file mode 100644 index dfdfd62e..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AnyRouteStatic.java +++ /dev/null @@ -1,534 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.model; - -import cloud.stackit.sdk.iaas.v2alpha1api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.UUID; - -/** Object that represents route of type static. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class AnyRouteStatic { - public static final String SERIALIZED_NAME_DESTINATION = "destination"; - - @SerializedName(SERIALIZED_NAME_DESTINATION) - @javax.annotation.Nonnull - private RouteDestination destination; - - public static final String SERIALIZED_NAME_TYPE = "type"; - - @SerializedName(SERIALIZED_NAME_TYPE) - @javax.annotation.Nonnull - private String type; - - public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; - - @SerializedName(SERIALIZED_NAME_CREATED_AT) - @javax.annotation.Nonnull - private OffsetDateTime createdAt; - - public static final String SERIALIZED_NAME_ERROR = "error"; - - @SerializedName(SERIALIZED_NAME_ERROR) - @javax.annotation.Nullable private String error; - - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - @javax.annotation.Nonnull - private UUID id; - - public static final String SERIALIZED_NAME_LABELS = "labels"; - - @SerializedName(SERIALIZED_NAME_LABELS) - @javax.annotation.Nullable private Object labels; - - public static final String SERIALIZED_NAME_NEXTHOP = "nexthop"; - - @SerializedName(SERIALIZED_NAME_NEXTHOP) - @javax.annotation.Nonnull - private RouteNexthop nexthop; - - public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; - - @SerializedName(SERIALIZED_NAME_UPDATED_AT) - @javax.annotation.Nullable private OffsetDateTime updatedAt; - - public AnyRouteStatic() {} - - public AnyRouteStatic(OffsetDateTime createdAt, OffsetDateTime updatedAt) { - this(); - this.createdAt = createdAt; - this.updatedAt = updatedAt; - } - - public AnyRouteStatic destination(@javax.annotation.Nonnull RouteDestination destination) { - this.destination = destination; - return this; - } - - /** - * Get destination - * - * @return destination - */ - @javax.annotation.Nonnull - public RouteDestination getDestination() { - return destination; - } - - public void setDestination(@javax.annotation.Nonnull RouteDestination destination) { - this.destination = destination; - } - - public AnyRouteStatic type(@javax.annotation.Nonnull String type) { - this.type = type; - return this; - } - - /** - * The type of the route. Possible values: `STATIC`, `DYNAMIC`, - * `SYSTEM`, `SERVICE`. - * - * @return type - */ - @javax.annotation.Nonnull - public String getType() { - return type; - } - - public void setType(@javax.annotation.Nonnull String type) { - this.type = type; - } - - /** - * Date-time when resource was created. - * - * @return createdAt - */ - @javax.annotation.Nonnull - public OffsetDateTime getCreatedAt() { - return createdAt; - } - - public AnyRouteStatic error(@javax.annotation.Nullable String error) { - this.error = error; - return this; - } - - /** - * Displays an error message with the reason why the route is invalid. Invalid routes are not - * applied and therefore not considered in the routing. A route can become invalid on creation - * and during its life-cycle. - * - * @return error - */ - @javax.annotation.Nullable public String getError() { - return error; - } - - public void setError(@javax.annotation.Nullable String error) { - this.error = error; - } - - public AnyRouteStatic id(@javax.annotation.Nonnull UUID id) { - this.id = id; - return this; - } - - /** - * Universally Unique Identifier (UUID). - * - * @return id - */ - @javax.annotation.Nonnull - public UUID getId() { - return id; - } - - public void setId(@javax.annotation.Nonnull UUID id) { - this.id = id; - } - - public AnyRouteStatic labels(@javax.annotation.Nullable Object labels) { - this.labels = labels; - return this; - } - - /** - * Object that represents the labels as key-value pairs of a resource. Key constraints: - May - * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must - * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain - * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), - * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 - * and 63 characters. - Must begin and end with an alphanumerical character - * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), - * dots (`.`), and alphanumerics in between. - Keys starting with the prefix - * `stackit-` or having a domain prefix of `stackit.cloud` (including its - * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value - * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not - * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May - * contain dashes (`-`), underscores (`_`), dots (`.`), and - * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are - * excluded from this count. Providing a `null` value for a key will remove that key. - * - * @return labels - */ - @javax.annotation.Nullable public Object getLabels() { - return labels; - } - - public void setLabels(@javax.annotation.Nullable Object labels) { - this.labels = labels; - } - - public AnyRouteStatic nexthop(@javax.annotation.Nonnull RouteNexthop nexthop) { - this.nexthop = nexthop; - return this; - } - - /** - * Get nexthop - * - * @return nexthop - */ - @javax.annotation.Nonnull - public RouteNexthop getNexthop() { - return nexthop; - } - - public void setNexthop(@javax.annotation.Nonnull RouteNexthop nexthop) { - this.nexthop = nexthop; - } - - /** - * Date-time when resource was last updated. - * - * @return updatedAt - */ - @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { - return updatedAt; - } - - /** - * 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. - * - * @param key name of the property - * @param value value of the property - * @return the AnyRouteStatic instance itself - */ - public AnyRouteStatic 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. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - 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; - } - AnyRouteStatic anyRouteStatic = (AnyRouteStatic) o; - return Objects.equals(this.destination, anyRouteStatic.destination) - && Objects.equals(this.type, anyRouteStatic.type) - && Objects.equals(this.createdAt, anyRouteStatic.createdAt) - && Objects.equals(this.error, anyRouteStatic.error) - && Objects.equals(this.id, anyRouteStatic.id) - && Objects.equals(this.labels, anyRouteStatic.labels) - && Objects.equals(this.nexthop, anyRouteStatic.nexthop) - && Objects.equals(this.updatedAt, anyRouteStatic.updatedAt) - && Objects.equals(this.additionalProperties, anyRouteStatic.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash( - destination, - type, - createdAt, - error, - id, - labels, - nexthop, - updatedAt, - additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AnyRouteStatic {\n"); - sb.append(" destination: ").append(toIndentedString(destination)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" error: ").append(toIndentedString(error)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); - sb.append(" nexthop: ").append(toIndentedString(nexthop)).append("\n"); - sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).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( - Arrays.asList( - "destination", - "type", - "createdAt", - "error", - "id", - "labels", - "nexthop", - "updatedAt")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = - new HashSet( - Arrays.asList("destination", "type", "createdAt", "id", "nexthop")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AnyRouteStatic - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AnyRouteStatic.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field(s) %s in AnyRouteStatic is not found in the empty JSON string", - AnyRouteStatic.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AnyRouteStatic.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field `%s` is not found in the JSON string: %s", - requiredField, - jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the required field `destination` - RouteDestination.validateJsonElement(jsonObj.get("destination")); - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `type` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("type").toString())); - } - if ((jsonObj.get("error") != null && !jsonObj.get("error").isJsonNull()) - && !jsonObj.get("error").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `error` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("error").toString())); - } - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `id` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("id").toString())); - } - // validate the required field `nexthop` - RouteNexthop.validateJsonElement(jsonObj.get("nexthop")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AnyRouteStatic.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AnyRouteStatic' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(AnyRouteStatic.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, AnyRouteStatic value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional 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 { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public AnyRouteStatic read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - AnyRouteStatic 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( - java.util.Locale.ROOT, - "The field `%s` has unknown primitive type. Value: %s", - entry.getKey(), - entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - }.nullSafe(); - } - } - - /** - * Create an instance of AnyRouteStatic given an JSON string - * - * @param jsonString JSON string - * @return An instance of AnyRouteStatic - * @throws IOException if the JSON string is invalid with respect to AnyRouteStatic - */ - public static AnyRouteStatic fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AnyRouteStatic.class); - } - - /** - * Convert an instance of AnyRouteStatic to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AnyRouteSystem.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AnyRouteSystem.java deleted file mode 100644 index 6811671d..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AnyRouteSystem.java +++ /dev/null @@ -1,334 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.model; - -import cloud.stackit.sdk.iaas.v2alpha1api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** Object representing route of type system. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class AnyRouteSystem { - public static final String SERIALIZED_NAME_DESTINATION = "destination"; - - @SerializedName(SERIALIZED_NAME_DESTINATION) - @javax.annotation.Nonnull - private RouteDestination destination; - - public static final String SERIALIZED_NAME_TYPE = "type"; - - @SerializedName(SERIALIZED_NAME_TYPE) - @javax.annotation.Nonnull - private String type; - - public AnyRouteSystem() {} - - public AnyRouteSystem destination(@javax.annotation.Nonnull RouteDestination destination) { - this.destination = destination; - return this; - } - - /** - * Get destination - * - * @return destination - */ - @javax.annotation.Nonnull - public RouteDestination getDestination() { - return destination; - } - - public void setDestination(@javax.annotation.Nonnull RouteDestination destination) { - this.destination = destination; - } - - public AnyRouteSystem type(@javax.annotation.Nonnull String type) { - this.type = type; - return this; - } - - /** - * The type of the route. Possible values: `STATIC`, `DYNAMIC`, - * `SYSTEM`, `SERVICE`. - * - * @return type - */ - @javax.annotation.Nonnull - public String getType() { - return type; - } - - public void setType(@javax.annotation.Nonnull String type) { - this.type = type; - } - - /** - * 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. - * - * @param key name of the property - * @param value value of the property - * @return the AnyRouteSystem instance itself - */ - public AnyRouteSystem 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. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - 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; - } - AnyRouteSystem anyRouteSystem = (AnyRouteSystem) o; - return Objects.equals(this.destination, anyRouteSystem.destination) - && Objects.equals(this.type, anyRouteSystem.type) - && Objects.equals(this.additionalProperties, anyRouteSystem.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(destination, type, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AnyRouteSystem {\n"); - sb.append(" destination: ").append(toIndentedString(destination)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).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(Arrays.asList("destination", "type")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("destination", "type")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AnyRouteSystem - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AnyRouteSystem.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field(s) %s in AnyRouteSystem is not found in the empty JSON string", - AnyRouteSystem.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AnyRouteSystem.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field `%s` is not found in the JSON string: %s", - requiredField, - jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the required field `destination` - RouteDestination.validateJsonElement(jsonObj.get("destination")); - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `type` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("type").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AnyRouteSystem.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AnyRouteSystem' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(AnyRouteSystem.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, AnyRouteSystem value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional 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 { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public AnyRouteSystem read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - AnyRouteSystem 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( - java.util.Locale.ROOT, - "The field `%s` has unknown primitive type. Value: %s", - entry.getKey(), - entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - }.nullSafe(); - } - } - - /** - * Create an instance of AnyRouteSystem given an JSON string - * - * @param jsonString JSON string - * @return An instance of AnyRouteSystem - * @throws IOException if the JSON string is invalid with respect to AnyRouteSystem - */ - public static AnyRouteSystem fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AnyRouteSystem.class); - } - - /** - * Convert an instance of AnyRouteSystem to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/BaseRoute.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/BaseRoute.java deleted file mode 100644 index 8ed5bcfd..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/BaseRoute.java +++ /dev/null @@ -1,334 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.model; - -import cloud.stackit.sdk.iaas.v2alpha1api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** Object that represents common route properties. Filterable Fields: `type`. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class BaseRoute { - public static final String SERIALIZED_NAME_DESTINATION = "destination"; - - @SerializedName(SERIALIZED_NAME_DESTINATION) - @javax.annotation.Nonnull - private RouteDestination destination; - - public static final String SERIALIZED_NAME_TYPE = "type"; - - @SerializedName(SERIALIZED_NAME_TYPE) - @javax.annotation.Nonnull - private String type; - - public BaseRoute() {} - - public BaseRoute destination(@javax.annotation.Nonnull RouteDestination destination) { - this.destination = destination; - return this; - } - - /** - * Get destination - * - * @return destination - */ - @javax.annotation.Nonnull - public RouteDestination getDestination() { - return destination; - } - - public void setDestination(@javax.annotation.Nonnull RouteDestination destination) { - this.destination = destination; - } - - public BaseRoute type(@javax.annotation.Nonnull String type) { - this.type = type; - return this; - } - - /** - * The type of the route. Possible values: `STATIC`, `DYNAMIC`, - * `SYSTEM`, `SERVICE`. - * - * @return type - */ - @javax.annotation.Nonnull - public String getType() { - return type; - } - - public void setType(@javax.annotation.Nonnull String type) { - this.type = type; - } - - /** - * 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. - * - * @param key name of the property - * @param value value of the property - * @return the BaseRoute instance itself - */ - public BaseRoute 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. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - 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; - } - BaseRoute baseRoute = (BaseRoute) o; - return Objects.equals(this.destination, baseRoute.destination) - && Objects.equals(this.type, baseRoute.type) - && Objects.equals(this.additionalProperties, baseRoute.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(destination, type, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BaseRoute {\n"); - sb.append(" destination: ").append(toIndentedString(destination)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).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(Arrays.asList("destination", "type")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("destination", "type")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to BaseRoute - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseRoute.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field(s) %s in BaseRoute is not found in the empty JSON string", - BaseRoute.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : BaseRoute.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field `%s` is not found in the JSON string: %s", - requiredField, - jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the required field `destination` - RouteDestination.validateJsonElement(jsonObj.get("destination")); - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `type` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("type").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!BaseRoute.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseRoute' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(BaseRoute.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseRoute value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional 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 { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public BaseRoute read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseRoute 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( - java.util.Locale.ROOT, - "The field `%s` has unknown primitive type. Value: %s", - entry.getKey(), - entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - }.nullSafe(); - } - } - - /** - * Create an instance of BaseRoute given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseRoute - * @throws IOException if the JSON string is invalid with respect to BaseRoute - */ - public static BaseRoute fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseRoute.class); - } - - /** - * Convert an instance of BaseRoute to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/CreateNetworkIPv4.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/CreateNetworkIPv4.java deleted file mode 100644 index 0eee1583..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/CreateNetworkIPv4.java +++ /dev/null @@ -1,298 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.model; - -import cloud.stackit.sdk.iaas.v2alpha1api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Map; -import java.util.logging.Level; -import java.util.logging.Logger; - -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class CreateNetworkIPv4 extends AbstractOpenApiSchema { - private static final Logger log = Logger.getLogger(CreateNetworkIPv4.class.getName()); - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateNetworkIPv4.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateNetworkIPv4' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter adapterCreateNetworkIPv4WithPrefix = - gson.getDelegateAdapter(this, TypeToken.get(CreateNetworkIPv4WithPrefix.class)); - final TypeAdapter - adapterCreateNetworkIPv4WithPrefixLength = - gson.getDelegateAdapter( - this, TypeToken.get(CreateNetworkIPv4WithPrefixLength.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateNetworkIPv4 value) - throws IOException { - if (value == null || value.getActualInstance() == null) { - elementAdapter.write(out, null); - return; - } - - // check if the actual instance is of the type - // `CreateNetworkIPv4WithPrefix` - if (value.getActualInstance() instanceof CreateNetworkIPv4WithPrefix) { - JsonElement element = - adapterCreateNetworkIPv4WithPrefix.toJsonTree( - (CreateNetworkIPv4WithPrefix) - value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - // check if the actual instance is of the type - // `CreateNetworkIPv4WithPrefixLength` - if (value.getActualInstance() - instanceof CreateNetworkIPv4WithPrefixLength) { - JsonElement element = - adapterCreateNetworkIPv4WithPrefixLength.toJsonTree( - (CreateNetworkIPv4WithPrefixLength) - value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - throw new IOException( - "Failed to serialize as the type doesn't match oneOf schemas: CreateNetworkIPv4WithPrefix, CreateNetworkIPv4WithPrefixLength"); - } - - @Override - public CreateNetworkIPv4 read(JsonReader in) throws IOException { - Object deserialized = null; - JsonElement jsonElement = elementAdapter.read(in); - - int match = 0; - ArrayList errorMessages = new ArrayList<>(); - TypeAdapter actualAdapter = elementAdapter; - - // deserialize CreateNetworkIPv4WithPrefix - try { - // validate the JSON object to see if any exception is thrown - CreateNetworkIPv4WithPrefix.validateJsonElement(jsonElement); - actualAdapter = adapterCreateNetworkIPv4WithPrefix; - match++; - log.log( - Level.FINER, - "Input data matches schema 'CreateNetworkIPv4WithPrefix'"); - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - java.util.Locale.ROOT, - "Deserialization for CreateNetworkIPv4WithPrefix failed with `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema 'CreateNetworkIPv4WithPrefix'", - e); - } - // deserialize CreateNetworkIPv4WithPrefixLength - try { - // validate the JSON object to see if any exception is thrown - CreateNetworkIPv4WithPrefixLength.validateJsonElement(jsonElement); - actualAdapter = adapterCreateNetworkIPv4WithPrefixLength; - match++; - log.log( - Level.FINER, - "Input data matches schema 'CreateNetworkIPv4WithPrefixLength'"); - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - java.util.Locale.ROOT, - "Deserialization for CreateNetworkIPv4WithPrefixLength failed with `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema 'CreateNetworkIPv4WithPrefixLength'", - e); - } - - if (match == 1) { - CreateNetworkIPv4 ret = new CreateNetworkIPv4(); - ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); - return ret; - } - - throw new IOException( - String.format( - java.util.Locale.ROOT, - "Failed deserialization for CreateNetworkIPv4: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", - match, - errorMessages, - jsonElement.toString())); - } - }.nullSafe(); - } - } - - // store a list of schema names defined in oneOf - public static final Map> schemas = new HashMap>(); - - public CreateNetworkIPv4() { - super("oneOf", Boolean.FALSE); - } - - public CreateNetworkIPv4(Object o) { - super("oneOf", Boolean.FALSE); - setActualInstance(o); - } - - static { - schemas.put("CreateNetworkIPv4WithPrefix", CreateNetworkIPv4WithPrefix.class); - schemas.put("CreateNetworkIPv4WithPrefixLength", CreateNetworkIPv4WithPrefixLength.class); - } - - @Override - public Map> getSchemas() { - return CreateNetworkIPv4.schemas; - } - - /** - * Set the instance that matches the oneOf child schema, check the instance parameter is valid - * against the oneOf child schemas: CreateNetworkIPv4WithPrefix, - * CreateNetworkIPv4WithPrefixLength - * - *

It could be an instance of the 'oneOf' schemas. - */ - @Override - public void setActualInstance(Object instance) { - if (instance instanceof CreateNetworkIPv4WithPrefix) { - super.setActualInstance(instance); - return; - } - - if (instance instanceof CreateNetworkIPv4WithPrefixLength) { - super.setActualInstance(instance); - return; - } - - throw new RuntimeException( - "Invalid instance type. Must be CreateNetworkIPv4WithPrefix, CreateNetworkIPv4WithPrefixLength"); - } - - /** - * Get the actual instance, which can be the following: CreateNetworkIPv4WithPrefix, - * CreateNetworkIPv4WithPrefixLength - * - * @return The actual instance (CreateNetworkIPv4WithPrefix, CreateNetworkIPv4WithPrefixLength) - */ - @SuppressWarnings("unchecked") - @Override - public Object getActualInstance() { - return super.getActualInstance(); - } - - /** - * Get the actual instance of `CreateNetworkIPv4WithPrefix`. If the actual instance is not - * `CreateNetworkIPv4WithPrefix`, the ClassCastException will be thrown. - * - * @return The actual instance of `CreateNetworkIPv4WithPrefix` - * @throws ClassCastException if the instance is not `CreateNetworkIPv4WithPrefix` - */ - public CreateNetworkIPv4WithPrefix getCreateNetworkIPv4WithPrefix() throws ClassCastException { - return (CreateNetworkIPv4WithPrefix) super.getActualInstance(); - } - - /** - * Get the actual instance of `CreateNetworkIPv4WithPrefixLength`. If the actual instance is not - * `CreateNetworkIPv4WithPrefixLength`, the ClassCastException will be thrown. - * - * @return The actual instance of `CreateNetworkIPv4WithPrefixLength` - * @throws ClassCastException if the instance is not `CreateNetworkIPv4WithPrefixLength` - */ - public CreateNetworkIPv4WithPrefixLength getCreateNetworkIPv4WithPrefixLength() - throws ClassCastException { - return (CreateNetworkIPv4WithPrefixLength) super.getActualInstance(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to CreateNetworkIPv4 - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - // validate oneOf schemas one by one - int validCount = 0; - ArrayList errorMessages = new ArrayList<>(); - // validate the json string with CreateNetworkIPv4WithPrefix - try { - CreateNetworkIPv4WithPrefix.validateJsonElement(jsonElement); - validCount++; - } catch (Exception e) { - errorMessages.add( - String.format( - java.util.Locale.ROOT, - "Deserialization for CreateNetworkIPv4WithPrefix failed with `%s`.", - e.getMessage())); - // continue to the next one - } - // validate the json string with CreateNetworkIPv4WithPrefixLength - try { - CreateNetworkIPv4WithPrefixLength.validateJsonElement(jsonElement); - validCount++; - } catch (Exception e) { - errorMessages.add( - String.format( - java.util.Locale.ROOT, - "Deserialization for CreateNetworkIPv4WithPrefixLength failed with `%s`.", - e.getMessage())); - // continue to the next one - } - if (validCount != 1) { - throw new IOException( - String.format( - java.util.Locale.ROOT, - "The JSON string is invalid for CreateNetworkIPv4 with oneOf schemas: CreateNetworkIPv4WithPrefix, CreateNetworkIPv4WithPrefixLength. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", - validCount, - errorMessages, - jsonElement.toString())); - } - } - - /** - * Create an instance of CreateNetworkIPv4 given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateNetworkIPv4 - * @throws IOException if the JSON string is invalid with respect to CreateNetworkIPv4 - */ - public static CreateNetworkIPv4 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateNetworkIPv4.class); - } - - /** - * Convert an instance of CreateNetworkIPv4 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/CreateNetworkIPv4WithPrefix.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/CreateNetworkIPv4WithPrefix.java deleted file mode 100644 index 26f177a4..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/CreateNetworkIPv4WithPrefix.java +++ /dev/null @@ -1,447 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.model; - -import cloud.stackit.sdk.iaas.v2alpha1api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.UUID; -import org.openapitools.jackson.nullable.JsonNullable; - -/** The create request for an IPv4 network with a specified prefix. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class CreateNetworkIPv4WithPrefix { - public static final String SERIALIZED_NAME_GATEWAY = "gateway"; - - @SerializedName(SERIALIZED_NAME_GATEWAY) - @javax.annotation.Nullable private String gateway; - - public static final String SERIALIZED_NAME_NAMESERVERS = "nameservers"; - - @SerializedName(SERIALIZED_NAME_NAMESERVERS) - @javax.annotation.Nullable private List nameservers = new ArrayList<>(); - - public static final String SERIALIZED_NAME_PREFIX = "prefix"; - - @SerializedName(SERIALIZED_NAME_PREFIX) - @javax.annotation.Nonnull - private String prefix; - - public static final String SERIALIZED_NAME_VPC_NETWORK_RANGE_ID = "vpcNetworkRangeId"; - - @SerializedName(SERIALIZED_NAME_VPC_NETWORK_RANGE_ID) - @javax.annotation.Nullable private UUID vpcNetworkRangeId; - - public CreateNetworkIPv4WithPrefix() {} - - public CreateNetworkIPv4WithPrefix gateway(@javax.annotation.Nullable String gateway) { - this.gateway = gateway; - return this; - } - - /** - * The IPv4 gateway of a network. If not specified the first IP of the network will be assigned - * as the gateway. If 'null' is sent, then the network doesn't have a gateway. - * - * @return gateway - */ - @javax.annotation.Nullable public String getGateway() { - return gateway; - } - - public void setGateway(@javax.annotation.Nullable String gateway) { - this.gateway = gateway; - } - - public CreateNetworkIPv4WithPrefix nameservers( - @javax.annotation.Nullable List nameservers) { - this.nameservers = nameservers; - return this; - } - - public CreateNetworkIPv4WithPrefix addNameserversItem(String nameserversItem) { - if (this.nameservers == null) { - this.nameservers = new ArrayList<>(); - } - this.nameservers.add(nameserversItem); - return this; - } - - /** - * A list containing DNS Servers/Nameservers for IPv4. - * - * @return nameservers - */ - @javax.annotation.Nullable public List getNameservers() { - return nameservers; - } - - public void setNameservers(@javax.annotation.Nullable List nameservers) { - this.nameservers = nameservers; - } - - public CreateNetworkIPv4WithPrefix prefix(@javax.annotation.Nonnull String prefix) { - this.prefix = prefix; - return this; - } - - /** - * IPv4 Classless Inter-Domain Routing (CIDR). - * - * @return prefix - */ - @javax.annotation.Nonnull - public String getPrefix() { - return prefix; - } - - public void setPrefix(@javax.annotation.Nonnull String prefix) { - this.prefix = prefix; - } - - public CreateNetworkIPv4WithPrefix vpcNetworkRangeId( - @javax.annotation.Nullable UUID vpcNetworkRangeId) { - this.vpcNetworkRangeId = vpcNetworkRangeId; - return this; - } - - /** - * Universally Unique Identifier (UUID). - * - * @return vpcNetworkRangeId - */ - @javax.annotation.Nullable public UUID getVpcNetworkRangeId() { - return vpcNetworkRangeId; - } - - public void setVpcNetworkRangeId(@javax.annotation.Nullable UUID vpcNetworkRangeId) { - this.vpcNetworkRangeId = vpcNetworkRangeId; - } - - /** - * 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. - * - * @param key name of the property - * @param value value of the property - * @return the CreateNetworkIPv4WithPrefix instance itself - */ - public CreateNetworkIPv4WithPrefix 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. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - 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; - } - CreateNetworkIPv4WithPrefix createNetworkIPv4WithPrefix = (CreateNetworkIPv4WithPrefix) o; - return Objects.equals(this.gateway, createNetworkIPv4WithPrefix.gateway) - && Objects.equals(this.nameservers, createNetworkIPv4WithPrefix.nameservers) - && Objects.equals(this.prefix, createNetworkIPv4WithPrefix.prefix) - && Objects.equals( - this.vpcNetworkRangeId, createNetworkIPv4WithPrefix.vpcNetworkRangeId) - && Objects.equals( - this.additionalProperties, - createNetworkIPv4WithPrefix.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b - || (a != null - && b != null - && a.isPresent() - && b.isPresent() - && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(gateway, nameservers, prefix, vpcNetworkRangeId, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateNetworkIPv4WithPrefix {\n"); - sb.append(" gateway: ").append(toIndentedString(gateway)).append("\n"); - sb.append(" nameservers: ").append(toIndentedString(nameservers)).append("\n"); - sb.append(" prefix: ").append(toIndentedString(prefix)).append("\n"); - sb.append(" vpcNetworkRangeId: ") - .append(toIndentedString(vpcNetworkRangeId)) - .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( - Arrays.asList("gateway", "nameservers", "prefix", "vpcNetworkRangeId")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("prefix")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * CreateNetworkIPv4WithPrefix - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!CreateNetworkIPv4WithPrefix.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field(s) %s in CreateNetworkIPv4WithPrefix is not found in the empty JSON string", - CreateNetworkIPv4WithPrefix.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CreateNetworkIPv4WithPrefix.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field `%s` is not found in the JSON string: %s", - requiredField, - jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("gateway") != null && !jsonObj.get("gateway").isJsonNull()) - && !jsonObj.get("gateway").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `gateway` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("gateway").toString())); - } - // ensure the optional json data is an array if present - if (jsonObj.get("nameservers") != null - && !jsonObj.get("nameservers").isJsonNull() - && !jsonObj.get("nameservers").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `nameservers` to be an array in the JSON string but got `%s`", - jsonObj.get("nameservers").toString())); - } - if (!jsonObj.get("prefix").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `prefix` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("prefix").toString())); - } - if ((jsonObj.get("vpcNetworkRangeId") != null - && !jsonObj.get("vpcNetworkRangeId").isJsonNull()) - && !jsonObj.get("vpcNetworkRangeId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `vpcNetworkRangeId` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("vpcNetworkRangeId").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateNetworkIPv4WithPrefix.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateNetworkIPv4WithPrefix' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(CreateNetworkIPv4WithPrefix.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateNetworkIPv4WithPrefix value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional 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 { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public CreateNetworkIPv4WithPrefix read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - CreateNetworkIPv4WithPrefix 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( - java.util.Locale.ROOT, - "The field `%s` has unknown primitive type. Value: %s", - entry.getKey(), - entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - }.nullSafe(); - } - } - - /** - * Create an instance of CreateNetworkIPv4WithPrefix given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateNetworkIPv4WithPrefix - * @throws IOException if the JSON string is invalid with respect to CreateNetworkIPv4WithPrefix - */ - public static CreateNetworkIPv4WithPrefix fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateNetworkIPv4WithPrefix.class); - } - - /** - * Convert an instance of CreateNetworkIPv4WithPrefix to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/CreateNetworkIPv4WithPrefixLength.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/CreateNetworkIPv4WithPrefixLength.java deleted file mode 100644 index 36e89402..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/CreateNetworkIPv4WithPrefixLength.java +++ /dev/null @@ -1,395 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.model; - -import cloud.stackit.sdk.iaas.v2alpha1api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.UUID; - -/** The create request for an IPv4 network with a wanted prefix length. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class CreateNetworkIPv4WithPrefixLength { - public static final String SERIALIZED_NAME_NAMESERVERS = "nameservers"; - - @SerializedName(SERIALIZED_NAME_NAMESERVERS) - @javax.annotation.Nullable private List nameservers = new ArrayList<>(); - - public static final String SERIALIZED_NAME_PREFIX_LENGTH = "prefixLength"; - - @SerializedName(SERIALIZED_NAME_PREFIX_LENGTH) - @javax.annotation.Nonnull - private Long prefixLength; - - public static final String SERIALIZED_NAME_VPC_NETWORK_RANGE_ID = "vpcNetworkRangeId"; - - @SerializedName(SERIALIZED_NAME_VPC_NETWORK_RANGE_ID) - @javax.annotation.Nullable private UUID vpcNetworkRangeId; - - public CreateNetworkIPv4WithPrefixLength() {} - - public CreateNetworkIPv4WithPrefixLength nameservers( - @javax.annotation.Nullable List nameservers) { - this.nameservers = nameservers; - return this; - } - - public CreateNetworkIPv4WithPrefixLength addNameserversItem(String nameserversItem) { - if (this.nameservers == null) { - this.nameservers = new ArrayList<>(); - } - this.nameservers.add(nameserversItem); - return this; - } - - /** - * A list containing DNS Servers/Nameservers for IPv4. - * - * @return nameservers - */ - @javax.annotation.Nullable public List getNameservers() { - return nameservers; - } - - public void setNameservers(@javax.annotation.Nullable List nameservers) { - this.nameservers = nameservers; - } - - public CreateNetworkIPv4WithPrefixLength prefixLength( - @javax.annotation.Nonnull Long prefixLength) { - this.prefixLength = prefixLength; - return this; - } - - /** - * Get prefixLength minimum: 8 maximum: 29 - * - * @return prefixLength - */ - @javax.annotation.Nonnull - public Long getPrefixLength() { - return prefixLength; - } - - public void setPrefixLength(@javax.annotation.Nonnull Long prefixLength) { - this.prefixLength = prefixLength; - } - - public CreateNetworkIPv4WithPrefixLength vpcNetworkRangeId( - @javax.annotation.Nullable UUID vpcNetworkRangeId) { - this.vpcNetworkRangeId = vpcNetworkRangeId; - return this; - } - - /** - * Universally Unique Identifier (UUID). - * - * @return vpcNetworkRangeId - */ - @javax.annotation.Nullable public UUID getVpcNetworkRangeId() { - return vpcNetworkRangeId; - } - - public void setVpcNetworkRangeId(@javax.annotation.Nullable UUID vpcNetworkRangeId) { - this.vpcNetworkRangeId = vpcNetworkRangeId; - } - - /** - * 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. - * - * @param key name of the property - * @param value value of the property - * @return the CreateNetworkIPv4WithPrefixLength instance itself - */ - public CreateNetworkIPv4WithPrefixLength 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. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - 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; - } - CreateNetworkIPv4WithPrefixLength createNetworkIPv4WithPrefixLength = - (CreateNetworkIPv4WithPrefixLength) o; - return Objects.equals(this.nameservers, createNetworkIPv4WithPrefixLength.nameservers) - && Objects.equals(this.prefixLength, createNetworkIPv4WithPrefixLength.prefixLength) - && Objects.equals( - this.vpcNetworkRangeId, createNetworkIPv4WithPrefixLength.vpcNetworkRangeId) - && Objects.equals( - this.additionalProperties, - createNetworkIPv4WithPrefixLength.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(nameservers, prefixLength, vpcNetworkRangeId, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateNetworkIPv4WithPrefixLength {\n"); - sb.append(" nameservers: ").append(toIndentedString(nameservers)).append("\n"); - sb.append(" prefixLength: ").append(toIndentedString(prefixLength)).append("\n"); - sb.append(" vpcNetworkRangeId: ") - .append(toIndentedString(vpcNetworkRangeId)) - .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( - Arrays.asList("nameservers", "prefixLength", "vpcNetworkRangeId")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("prefixLength")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * CreateNetworkIPv4WithPrefixLength - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!CreateNetworkIPv4WithPrefixLength.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field(s) %s in CreateNetworkIPv4WithPrefixLength is not found in the empty JSON string", - CreateNetworkIPv4WithPrefixLength.openapiRequiredFields - .toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CreateNetworkIPv4WithPrefixLength.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field `%s` is not found in the JSON string: %s", - requiredField, - jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the optional json data is an array if present - if (jsonObj.get("nameservers") != null - && !jsonObj.get("nameservers").isJsonNull() - && !jsonObj.get("nameservers").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `nameservers` to be an array in the JSON string but got `%s`", - jsonObj.get("nameservers").toString())); - } - if ((jsonObj.get("vpcNetworkRangeId") != null - && !jsonObj.get("vpcNetworkRangeId").isJsonNull()) - && !jsonObj.get("vpcNetworkRangeId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `vpcNetworkRangeId` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("vpcNetworkRangeId").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateNetworkIPv4WithPrefixLength.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateNetworkIPv4WithPrefixLength' and - // its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(CreateNetworkIPv4WithPrefixLength.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateNetworkIPv4WithPrefixLength value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional 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 { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public CreateNetworkIPv4WithPrefixLength read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - CreateNetworkIPv4WithPrefixLength 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( - java.util.Locale.ROOT, - "The field `%s` has unknown primitive type. Value: %s", - entry.getKey(), - entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - }.nullSafe(); - } - } - - /** - * Create an instance of CreateNetworkIPv4WithPrefixLength given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateNetworkIPv4WithPrefixLength - * @throws IOException if the JSON string is invalid with respect to - * CreateNetworkIPv4WithPrefixLength - */ - public static CreateNetworkIPv4WithPrefixLength fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateNetworkIPv4WithPrefixLength.class); - } - - /** - * Convert an instance of CreateNetworkIPv4WithPrefixLength to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/CreateNetworkIPv6.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/CreateNetworkIPv6.java deleted file mode 100644 index e69dd320..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/CreateNetworkIPv6.java +++ /dev/null @@ -1,298 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.model; - -import cloud.stackit.sdk.iaas.v2alpha1api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Map; -import java.util.logging.Level; -import java.util.logging.Logger; - -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class CreateNetworkIPv6 extends AbstractOpenApiSchema { - private static final Logger log = Logger.getLogger(CreateNetworkIPv6.class.getName()); - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateNetworkIPv6.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateNetworkIPv6' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter adapterCreateNetworkIPv6WithPrefix = - gson.getDelegateAdapter(this, TypeToken.get(CreateNetworkIPv6WithPrefix.class)); - final TypeAdapter - adapterCreateNetworkIPv6WithPrefixLength = - gson.getDelegateAdapter( - this, TypeToken.get(CreateNetworkIPv6WithPrefixLength.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateNetworkIPv6 value) - throws IOException { - if (value == null || value.getActualInstance() == null) { - elementAdapter.write(out, null); - return; - } - - // check if the actual instance is of the type - // `CreateNetworkIPv6WithPrefix` - if (value.getActualInstance() instanceof CreateNetworkIPv6WithPrefix) { - JsonElement element = - adapterCreateNetworkIPv6WithPrefix.toJsonTree( - (CreateNetworkIPv6WithPrefix) - value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - // check if the actual instance is of the type - // `CreateNetworkIPv6WithPrefixLength` - if (value.getActualInstance() - instanceof CreateNetworkIPv6WithPrefixLength) { - JsonElement element = - adapterCreateNetworkIPv6WithPrefixLength.toJsonTree( - (CreateNetworkIPv6WithPrefixLength) - value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - throw new IOException( - "Failed to serialize as the type doesn't match oneOf schemas: CreateNetworkIPv6WithPrefix, CreateNetworkIPv6WithPrefixLength"); - } - - @Override - public CreateNetworkIPv6 read(JsonReader in) throws IOException { - Object deserialized = null; - JsonElement jsonElement = elementAdapter.read(in); - - int match = 0; - ArrayList errorMessages = new ArrayList<>(); - TypeAdapter actualAdapter = elementAdapter; - - // deserialize CreateNetworkIPv6WithPrefix - try { - // validate the JSON object to see if any exception is thrown - CreateNetworkIPv6WithPrefix.validateJsonElement(jsonElement); - actualAdapter = adapterCreateNetworkIPv6WithPrefix; - match++; - log.log( - Level.FINER, - "Input data matches schema 'CreateNetworkIPv6WithPrefix'"); - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - java.util.Locale.ROOT, - "Deserialization for CreateNetworkIPv6WithPrefix failed with `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema 'CreateNetworkIPv6WithPrefix'", - e); - } - // deserialize CreateNetworkIPv6WithPrefixLength - try { - // validate the JSON object to see if any exception is thrown - CreateNetworkIPv6WithPrefixLength.validateJsonElement(jsonElement); - actualAdapter = adapterCreateNetworkIPv6WithPrefixLength; - match++; - log.log( - Level.FINER, - "Input data matches schema 'CreateNetworkIPv6WithPrefixLength'"); - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - java.util.Locale.ROOT, - "Deserialization for CreateNetworkIPv6WithPrefixLength failed with `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema 'CreateNetworkIPv6WithPrefixLength'", - e); - } - - if (match == 1) { - CreateNetworkIPv6 ret = new CreateNetworkIPv6(); - ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); - return ret; - } - - throw new IOException( - String.format( - java.util.Locale.ROOT, - "Failed deserialization for CreateNetworkIPv6: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", - match, - errorMessages, - jsonElement.toString())); - } - }.nullSafe(); - } - } - - // store a list of schema names defined in oneOf - public static final Map> schemas = new HashMap>(); - - public CreateNetworkIPv6() { - super("oneOf", Boolean.FALSE); - } - - public CreateNetworkIPv6(Object o) { - super("oneOf", Boolean.FALSE); - setActualInstance(o); - } - - static { - schemas.put("CreateNetworkIPv6WithPrefix", CreateNetworkIPv6WithPrefix.class); - schemas.put("CreateNetworkIPv6WithPrefixLength", CreateNetworkIPv6WithPrefixLength.class); - } - - @Override - public Map> getSchemas() { - return CreateNetworkIPv6.schemas; - } - - /** - * Set the instance that matches the oneOf child schema, check the instance parameter is valid - * against the oneOf child schemas: CreateNetworkIPv6WithPrefix, - * CreateNetworkIPv6WithPrefixLength - * - *

It could be an instance of the 'oneOf' schemas. - */ - @Override - public void setActualInstance(Object instance) { - if (instance instanceof CreateNetworkIPv6WithPrefix) { - super.setActualInstance(instance); - return; - } - - if (instance instanceof CreateNetworkIPv6WithPrefixLength) { - super.setActualInstance(instance); - return; - } - - throw new RuntimeException( - "Invalid instance type. Must be CreateNetworkIPv6WithPrefix, CreateNetworkIPv6WithPrefixLength"); - } - - /** - * Get the actual instance, which can be the following: CreateNetworkIPv6WithPrefix, - * CreateNetworkIPv6WithPrefixLength - * - * @return The actual instance (CreateNetworkIPv6WithPrefix, CreateNetworkIPv6WithPrefixLength) - */ - @SuppressWarnings("unchecked") - @Override - public Object getActualInstance() { - return super.getActualInstance(); - } - - /** - * Get the actual instance of `CreateNetworkIPv6WithPrefix`. If the actual instance is not - * `CreateNetworkIPv6WithPrefix`, the ClassCastException will be thrown. - * - * @return The actual instance of `CreateNetworkIPv6WithPrefix` - * @throws ClassCastException if the instance is not `CreateNetworkIPv6WithPrefix` - */ - public CreateNetworkIPv6WithPrefix getCreateNetworkIPv6WithPrefix() throws ClassCastException { - return (CreateNetworkIPv6WithPrefix) super.getActualInstance(); - } - - /** - * Get the actual instance of `CreateNetworkIPv6WithPrefixLength`. If the actual instance is not - * `CreateNetworkIPv6WithPrefixLength`, the ClassCastException will be thrown. - * - * @return The actual instance of `CreateNetworkIPv6WithPrefixLength` - * @throws ClassCastException if the instance is not `CreateNetworkIPv6WithPrefixLength` - */ - public CreateNetworkIPv6WithPrefixLength getCreateNetworkIPv6WithPrefixLength() - throws ClassCastException { - return (CreateNetworkIPv6WithPrefixLength) super.getActualInstance(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to CreateNetworkIPv6 - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - // validate oneOf schemas one by one - int validCount = 0; - ArrayList errorMessages = new ArrayList<>(); - // validate the json string with CreateNetworkIPv6WithPrefix - try { - CreateNetworkIPv6WithPrefix.validateJsonElement(jsonElement); - validCount++; - } catch (Exception e) { - errorMessages.add( - String.format( - java.util.Locale.ROOT, - "Deserialization for CreateNetworkIPv6WithPrefix failed with `%s`.", - e.getMessage())); - // continue to the next one - } - // validate the json string with CreateNetworkIPv6WithPrefixLength - try { - CreateNetworkIPv6WithPrefixLength.validateJsonElement(jsonElement); - validCount++; - } catch (Exception e) { - errorMessages.add( - String.format( - java.util.Locale.ROOT, - "Deserialization for CreateNetworkIPv6WithPrefixLength failed with `%s`.", - e.getMessage())); - // continue to the next one - } - if (validCount != 1) { - throw new IOException( - String.format( - java.util.Locale.ROOT, - "The JSON string is invalid for CreateNetworkIPv6 with oneOf schemas: CreateNetworkIPv6WithPrefix, CreateNetworkIPv6WithPrefixLength. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", - validCount, - errorMessages, - jsonElement.toString())); - } - } - - /** - * Create an instance of CreateNetworkIPv6 given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateNetworkIPv6 - * @throws IOException if the JSON string is invalid with respect to CreateNetworkIPv6 - */ - public static CreateNetworkIPv6 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateNetworkIPv6.class); - } - - /** - * Convert an instance of CreateNetworkIPv6 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/CreateNetworkIPv6WithPrefix.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/CreateNetworkIPv6WithPrefix.java deleted file mode 100644 index cae2398e..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/CreateNetworkIPv6WithPrefix.java +++ /dev/null @@ -1,447 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.model; - -import cloud.stackit.sdk.iaas.v2alpha1api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.UUID; -import org.openapitools.jackson.nullable.JsonNullable; - -/** The create request for an IPv6 network with a specified prefix. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class CreateNetworkIPv6WithPrefix { - public static final String SERIALIZED_NAME_GATEWAY = "gateway"; - - @SerializedName(SERIALIZED_NAME_GATEWAY) - @javax.annotation.Nullable private String gateway; - - public static final String SERIALIZED_NAME_NAMESERVERS = "nameservers"; - - @SerializedName(SERIALIZED_NAME_NAMESERVERS) - @javax.annotation.Nullable private List nameservers = new ArrayList<>(); - - public static final String SERIALIZED_NAME_PREFIX = "prefix"; - - @SerializedName(SERIALIZED_NAME_PREFIX) - @javax.annotation.Nonnull - private String prefix; - - public static final String SERIALIZED_NAME_VPC_NETWORK_RANGE_ID = "vpcNetworkRangeId"; - - @SerializedName(SERIALIZED_NAME_VPC_NETWORK_RANGE_ID) - @javax.annotation.Nullable private UUID vpcNetworkRangeId; - - public CreateNetworkIPv6WithPrefix() {} - - public CreateNetworkIPv6WithPrefix gateway(@javax.annotation.Nullable String gateway) { - this.gateway = gateway; - return this; - } - - /** - * The IPv6 gateway of a network. If not specified the first IP of the network will be assigned - * as the gateway. If 'null' is sent, then the network doesn't have a gateway. - * - * @return gateway - */ - @javax.annotation.Nullable public String getGateway() { - return gateway; - } - - public void setGateway(@javax.annotation.Nullable String gateway) { - this.gateway = gateway; - } - - public CreateNetworkIPv6WithPrefix nameservers( - @javax.annotation.Nullable List nameservers) { - this.nameservers = nameservers; - return this; - } - - public CreateNetworkIPv6WithPrefix addNameserversItem(String nameserversItem) { - if (this.nameservers == null) { - this.nameservers = new ArrayList<>(); - } - this.nameservers.add(nameserversItem); - return this; - } - - /** - * A list containing DNS Servers/Nameservers for IPv6. - * - * @return nameservers - */ - @javax.annotation.Nullable public List getNameservers() { - return nameservers; - } - - public void setNameservers(@javax.annotation.Nullable List nameservers) { - this.nameservers = nameservers; - } - - public CreateNetworkIPv6WithPrefix prefix(@javax.annotation.Nonnull String prefix) { - this.prefix = prefix; - return this; - } - - /** - * Classless Inter-Domain Routing (CIDR) for IPv6. - * - * @return prefix - */ - @javax.annotation.Nonnull - public String getPrefix() { - return prefix; - } - - public void setPrefix(@javax.annotation.Nonnull String prefix) { - this.prefix = prefix; - } - - public CreateNetworkIPv6WithPrefix vpcNetworkRangeId( - @javax.annotation.Nullable UUID vpcNetworkRangeId) { - this.vpcNetworkRangeId = vpcNetworkRangeId; - return this; - } - - /** - * Universally Unique Identifier (UUID). - * - * @return vpcNetworkRangeId - */ - @javax.annotation.Nullable public UUID getVpcNetworkRangeId() { - return vpcNetworkRangeId; - } - - public void setVpcNetworkRangeId(@javax.annotation.Nullable UUID vpcNetworkRangeId) { - this.vpcNetworkRangeId = vpcNetworkRangeId; - } - - /** - * 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. - * - * @param key name of the property - * @param value value of the property - * @return the CreateNetworkIPv6WithPrefix instance itself - */ - public CreateNetworkIPv6WithPrefix 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. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - 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; - } - CreateNetworkIPv6WithPrefix createNetworkIPv6WithPrefix = (CreateNetworkIPv6WithPrefix) o; - return Objects.equals(this.gateway, createNetworkIPv6WithPrefix.gateway) - && Objects.equals(this.nameservers, createNetworkIPv6WithPrefix.nameservers) - && Objects.equals(this.prefix, createNetworkIPv6WithPrefix.prefix) - && Objects.equals( - this.vpcNetworkRangeId, createNetworkIPv6WithPrefix.vpcNetworkRangeId) - && Objects.equals( - this.additionalProperties, - createNetworkIPv6WithPrefix.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b - || (a != null - && b != null - && a.isPresent() - && b.isPresent() - && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(gateway, nameservers, prefix, vpcNetworkRangeId, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateNetworkIPv6WithPrefix {\n"); - sb.append(" gateway: ").append(toIndentedString(gateway)).append("\n"); - sb.append(" nameservers: ").append(toIndentedString(nameservers)).append("\n"); - sb.append(" prefix: ").append(toIndentedString(prefix)).append("\n"); - sb.append(" vpcNetworkRangeId: ") - .append(toIndentedString(vpcNetworkRangeId)) - .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( - Arrays.asList("gateway", "nameservers", "prefix", "vpcNetworkRangeId")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("prefix")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * CreateNetworkIPv6WithPrefix - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!CreateNetworkIPv6WithPrefix.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field(s) %s in CreateNetworkIPv6WithPrefix is not found in the empty JSON string", - CreateNetworkIPv6WithPrefix.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CreateNetworkIPv6WithPrefix.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field `%s` is not found in the JSON string: %s", - requiredField, - jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("gateway") != null && !jsonObj.get("gateway").isJsonNull()) - && !jsonObj.get("gateway").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `gateway` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("gateway").toString())); - } - // ensure the optional json data is an array if present - if (jsonObj.get("nameservers") != null - && !jsonObj.get("nameservers").isJsonNull() - && !jsonObj.get("nameservers").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `nameservers` to be an array in the JSON string but got `%s`", - jsonObj.get("nameservers").toString())); - } - if (!jsonObj.get("prefix").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `prefix` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("prefix").toString())); - } - if ((jsonObj.get("vpcNetworkRangeId") != null - && !jsonObj.get("vpcNetworkRangeId").isJsonNull()) - && !jsonObj.get("vpcNetworkRangeId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `vpcNetworkRangeId` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("vpcNetworkRangeId").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateNetworkIPv6WithPrefix.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateNetworkIPv6WithPrefix' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(CreateNetworkIPv6WithPrefix.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateNetworkIPv6WithPrefix value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional 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 { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public CreateNetworkIPv6WithPrefix read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - CreateNetworkIPv6WithPrefix 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( - java.util.Locale.ROOT, - "The field `%s` has unknown primitive type. Value: %s", - entry.getKey(), - entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - }.nullSafe(); - } - } - - /** - * Create an instance of CreateNetworkIPv6WithPrefix given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateNetworkIPv6WithPrefix - * @throws IOException if the JSON string is invalid with respect to CreateNetworkIPv6WithPrefix - */ - public static CreateNetworkIPv6WithPrefix fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateNetworkIPv6WithPrefix.class); - } - - /** - * Convert an instance of CreateNetworkIPv6WithPrefix to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/CreateNetworkIPv6WithPrefixLength.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/CreateNetworkIPv6WithPrefixLength.java deleted file mode 100644 index 2f089c15..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/CreateNetworkIPv6WithPrefixLength.java +++ /dev/null @@ -1,395 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.model; - -import cloud.stackit.sdk.iaas.v2alpha1api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.UUID; - -/** The create request for an IPv6 network with a wanted prefix length. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class CreateNetworkIPv6WithPrefixLength { - public static final String SERIALIZED_NAME_NAMESERVERS = "nameservers"; - - @SerializedName(SERIALIZED_NAME_NAMESERVERS) - @javax.annotation.Nullable private List nameservers = new ArrayList<>(); - - public static final String SERIALIZED_NAME_PREFIX_LENGTH = "prefixLength"; - - @SerializedName(SERIALIZED_NAME_PREFIX_LENGTH) - @javax.annotation.Nonnull - private Long prefixLength; - - public static final String SERIALIZED_NAME_VPC_NETWORK_RANGE_ID = "vpcNetworkRangeId"; - - @SerializedName(SERIALIZED_NAME_VPC_NETWORK_RANGE_ID) - @javax.annotation.Nullable private UUID vpcNetworkRangeId; - - public CreateNetworkIPv6WithPrefixLength() {} - - public CreateNetworkIPv6WithPrefixLength nameservers( - @javax.annotation.Nullable List nameservers) { - this.nameservers = nameservers; - return this; - } - - public CreateNetworkIPv6WithPrefixLength addNameserversItem(String nameserversItem) { - if (this.nameservers == null) { - this.nameservers = new ArrayList<>(); - } - this.nameservers.add(nameserversItem); - return this; - } - - /** - * A list containing DNS Servers/Nameservers for IPv6. - * - * @return nameservers - */ - @javax.annotation.Nullable public List getNameservers() { - return nameservers; - } - - public void setNameservers(@javax.annotation.Nullable List nameservers) { - this.nameservers = nameservers; - } - - public CreateNetworkIPv6WithPrefixLength prefixLength( - @javax.annotation.Nonnull Long prefixLength) { - this.prefixLength = prefixLength; - return this; - } - - /** - * Get prefixLength minimum: 56 maximum: 128 - * - * @return prefixLength - */ - @javax.annotation.Nonnull - public Long getPrefixLength() { - return prefixLength; - } - - public void setPrefixLength(@javax.annotation.Nonnull Long prefixLength) { - this.prefixLength = prefixLength; - } - - public CreateNetworkIPv6WithPrefixLength vpcNetworkRangeId( - @javax.annotation.Nullable UUID vpcNetworkRangeId) { - this.vpcNetworkRangeId = vpcNetworkRangeId; - return this; - } - - /** - * Universally Unique Identifier (UUID). - * - * @return vpcNetworkRangeId - */ - @javax.annotation.Nullable public UUID getVpcNetworkRangeId() { - return vpcNetworkRangeId; - } - - public void setVpcNetworkRangeId(@javax.annotation.Nullable UUID vpcNetworkRangeId) { - this.vpcNetworkRangeId = vpcNetworkRangeId; - } - - /** - * 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. - * - * @param key name of the property - * @param value value of the property - * @return the CreateNetworkIPv6WithPrefixLength instance itself - */ - public CreateNetworkIPv6WithPrefixLength 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. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - 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; - } - CreateNetworkIPv6WithPrefixLength createNetworkIPv6WithPrefixLength = - (CreateNetworkIPv6WithPrefixLength) o; - return Objects.equals(this.nameservers, createNetworkIPv6WithPrefixLength.nameservers) - && Objects.equals(this.prefixLength, createNetworkIPv6WithPrefixLength.prefixLength) - && Objects.equals( - this.vpcNetworkRangeId, createNetworkIPv6WithPrefixLength.vpcNetworkRangeId) - && Objects.equals( - this.additionalProperties, - createNetworkIPv6WithPrefixLength.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(nameservers, prefixLength, vpcNetworkRangeId, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateNetworkIPv6WithPrefixLength {\n"); - sb.append(" nameservers: ").append(toIndentedString(nameservers)).append("\n"); - sb.append(" prefixLength: ").append(toIndentedString(prefixLength)).append("\n"); - sb.append(" vpcNetworkRangeId: ") - .append(toIndentedString(vpcNetworkRangeId)) - .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( - Arrays.asList("nameservers", "prefixLength", "vpcNetworkRangeId")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("prefixLength")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * CreateNetworkIPv6WithPrefixLength - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!CreateNetworkIPv6WithPrefixLength.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field(s) %s in CreateNetworkIPv6WithPrefixLength is not found in the empty JSON string", - CreateNetworkIPv6WithPrefixLength.openapiRequiredFields - .toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CreateNetworkIPv6WithPrefixLength.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field `%s` is not found in the JSON string: %s", - requiredField, - jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the optional json data is an array if present - if (jsonObj.get("nameservers") != null - && !jsonObj.get("nameservers").isJsonNull() - && !jsonObj.get("nameservers").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `nameservers` to be an array in the JSON string but got `%s`", - jsonObj.get("nameservers").toString())); - } - if ((jsonObj.get("vpcNetworkRangeId") != null - && !jsonObj.get("vpcNetworkRangeId").isJsonNull()) - && !jsonObj.get("vpcNetworkRangeId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `vpcNetworkRangeId` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("vpcNetworkRangeId").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateNetworkIPv6WithPrefixLength.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateNetworkIPv6WithPrefixLength' and - // its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(CreateNetworkIPv6WithPrefixLength.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateNetworkIPv6WithPrefixLength value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional 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 { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public CreateNetworkIPv6WithPrefixLength read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - CreateNetworkIPv6WithPrefixLength 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( - java.util.Locale.ROOT, - "The field `%s` has unknown primitive type. Value: %s", - entry.getKey(), - entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - }.nullSafe(); - } - } - - /** - * Create an instance of CreateNetworkIPv6WithPrefixLength given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateNetworkIPv6WithPrefixLength - * @throws IOException if the JSON string is invalid with respect to - * CreateNetworkIPv6WithPrefixLength - */ - public static CreateNetworkIPv6WithPrefixLength fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateNetworkIPv6WithPrefixLength.class); - } - - /** - * Convert an instance of CreateNetworkIPv6WithPrefixLength to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/CreateNetworkPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/CreateNetworkPayload.java deleted file mode 100644 index f8f35ead..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/CreateNetworkPayload.java +++ /dev/null @@ -1,574 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.model; - -import cloud.stackit.sdk.iaas.v2alpha1api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.UUID; - -/** Object that represents the request body for a network create. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class CreateNetworkPayload { - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - @javax.annotation.Nullable private String description; - - public static final String SERIALIZED_NAME_DHCP = "dhcp"; - - @SerializedName(SERIALIZED_NAME_DHCP) - @javax.annotation.Nullable private Boolean dhcp = true; - - public static final String SERIALIZED_NAME_IPV4 = "ipv4"; - - @SerializedName(SERIALIZED_NAME_IPV4) - @javax.annotation.Nullable private CreateNetworkIPv4 ipv4; - - public static final String SERIALIZED_NAME_IPV6 = "ipv6"; - - @SerializedName(SERIALIZED_NAME_IPV6) - @javax.annotation.Nullable private CreateNetworkIPv6 ipv6; - - public static final String SERIALIZED_NAME_LABELS = "labels"; - - @SerializedName(SERIALIZED_NAME_LABELS) - @javax.annotation.Nullable private Object labels; - - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - @javax.annotation.Nonnull - private String name; - - public static final String SERIALIZED_NAME_ROUTED = "routed"; - - @SerializedName(SERIALIZED_NAME_ROUTED) - @javax.annotation.Nullable private Boolean routed; - - public static final String SERIALIZED_NAME_ROUTING_TABLE_ID = "routingTableId"; - - @SerializedName(SERIALIZED_NAME_ROUTING_TABLE_ID) - @javax.annotation.Nullable private UUID routingTableId; - - public static final String SERIALIZED_NAME_VPC_ID = "vpcId"; - - @SerializedName(SERIALIZED_NAME_VPC_ID) - @javax.annotation.Nullable private UUID vpcId; - - public CreateNetworkPayload() {} - - public CreateNetworkPayload description(@javax.annotation.Nullable String description) { - this.description = description; - return this; - } - - /** - * Description Object. Allows string up to 255 Characters. - * - * @return description - */ - @javax.annotation.Nullable public String getDescription() { - return description; - } - - public void setDescription(@javax.annotation.Nullable String description) { - this.description = description; - } - - public CreateNetworkPayload dhcp(@javax.annotation.Nullable Boolean dhcp) { - this.dhcp = dhcp; - return this; - } - - /** - * Enable or disable DHCP for a network. - * - * @return dhcp - */ - @javax.annotation.Nullable public Boolean getDhcp() { - return dhcp; - } - - public void setDhcp(@javax.annotation.Nullable Boolean dhcp) { - this.dhcp = dhcp; - } - - public CreateNetworkPayload ipv4(@javax.annotation.Nullable CreateNetworkIPv4 ipv4) { - this.ipv4 = ipv4; - return this; - } - - /** - * Get ipv4 - * - * @return ipv4 - */ - @javax.annotation.Nullable public CreateNetworkIPv4 getIpv4() { - return ipv4; - } - - public void setIpv4(@javax.annotation.Nullable CreateNetworkIPv4 ipv4) { - this.ipv4 = ipv4; - } - - public CreateNetworkPayload ipv6(@javax.annotation.Nullable CreateNetworkIPv6 ipv6) { - this.ipv6 = ipv6; - return this; - } - - /** - * Get ipv6 - * - * @return ipv6 - */ - @javax.annotation.Nullable public CreateNetworkIPv6 getIpv6() { - return ipv6; - } - - public void setIpv6(@javax.annotation.Nullable CreateNetworkIPv6 ipv6) { - this.ipv6 = ipv6; - } - - public CreateNetworkPayload labels(@javax.annotation.Nullable Object labels) { - this.labels = labels; - return this; - } - - /** - * Object that represents the labels as key-value pairs of a resource. Key constraints: - May - * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must - * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain - * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), - * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 - * and 63 characters. - Must begin and end with an alphanumerical character - * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), - * dots (`.`), and alphanumerics in between. - Keys starting with the prefix - * `stackit-` or having a domain prefix of `stackit.cloud` (including its - * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value - * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not - * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May - * contain dashes (`-`), underscores (`_`), dots (`.`), and - * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are - * excluded from this count. Providing a `null` value for a key will remove that key. - * - * @return labels - */ - @javax.annotation.Nullable public Object getLabels() { - return labels; - } - - public void setLabels(@javax.annotation.Nullable Object labels) { - this.labels = labels; - } - - public CreateNetworkPayload name(@javax.annotation.Nonnull String name) { - this.name = name; - return this; - } - - /** - * The name for a General Object. Matches Names and also UUIDs. - * - * @return name - */ - @javax.annotation.Nonnull - public String getName() { - return name; - } - - public void setName(@javax.annotation.Nonnull String name) { - this.name = name; - } - - public CreateNetworkPayload routed(@javax.annotation.Nullable Boolean routed) { - this.routed = routed; - return this; - } - - /** - * Shows if the network is routed and therefore accessible from other networks. - * - * @return routed - */ - @javax.annotation.Nullable public Boolean getRouted() { - return routed; - } - - public void setRouted(@javax.annotation.Nullable Boolean routed) { - this.routed = routed; - } - - public CreateNetworkPayload routingTableId(@javax.annotation.Nullable UUID routingTableId) { - this.routingTableId = routingTableId; - return this; - } - - /** - * Universally Unique Identifier (UUID). - * - * @return routingTableId - */ - @javax.annotation.Nullable public UUID getRoutingTableId() { - return routingTableId; - } - - public void setRoutingTableId(@javax.annotation.Nullable UUID routingTableId) { - this.routingTableId = routingTableId; - } - - public CreateNetworkPayload vpcId(@javax.annotation.Nullable UUID vpcId) { - this.vpcId = vpcId; - return this; - } - - /** - * The identifier (ID) of a STACKIT VPC. - * - * @return vpcId - */ - @javax.annotation.Nullable public UUID getVpcId() { - return vpcId; - } - - public void setVpcId(@javax.annotation.Nullable UUID vpcId) { - this.vpcId = vpcId; - } - - /** - * 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. - * - * @param key name of the property - * @param value value of the property - * @return the CreateNetworkPayload instance itself - */ - public CreateNetworkPayload 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. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - 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; - } - CreateNetworkPayload createNetworkPayload = (CreateNetworkPayload) o; - return Objects.equals(this.description, createNetworkPayload.description) - && Objects.equals(this.dhcp, createNetworkPayload.dhcp) - && Objects.equals(this.ipv4, createNetworkPayload.ipv4) - && Objects.equals(this.ipv6, createNetworkPayload.ipv6) - && Objects.equals(this.labels, createNetworkPayload.labels) - && Objects.equals(this.name, createNetworkPayload.name) - && Objects.equals(this.routed, createNetworkPayload.routed) - && Objects.equals(this.routingTableId, createNetworkPayload.routingTableId) - && Objects.equals(this.vpcId, createNetworkPayload.vpcId) - && Objects.equals( - this.additionalProperties, createNetworkPayload.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash( - description, - dhcp, - ipv4, - ipv6, - labels, - name, - routed, - routingTableId, - vpcId, - additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateNetworkPayload {\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" dhcp: ").append(toIndentedString(dhcp)).append("\n"); - sb.append(" ipv4: ").append(toIndentedString(ipv4)).append("\n"); - sb.append(" ipv6: ").append(toIndentedString(ipv6)).append("\n"); - sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" routed: ").append(toIndentedString(routed)).append("\n"); - sb.append(" routingTableId: ").append(toIndentedString(routingTableId)).append("\n"); - sb.append(" vpcId: ").append(toIndentedString(vpcId)).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( - Arrays.asList( - "description", - "dhcp", - "ipv4", - "ipv6", - "labels", - "name", - "routed", - "routingTableId", - "vpcId")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("name")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to CreateNetworkPayload - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!CreateNetworkPayload.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field(s) %s in CreateNetworkPayload is not found in the empty JSON string", - CreateNetworkPayload.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CreateNetworkPayload.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field `%s` is not found in the JSON string: %s", - requiredField, - jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) - && !jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `description` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("description").toString())); - } - // validate the optional field `ipv4` - if (jsonObj.get("ipv4") != null && !jsonObj.get("ipv4").isJsonNull()) { - CreateNetworkIPv4.validateJsonElement(jsonObj.get("ipv4")); - } - // validate the optional field `ipv6` - if (jsonObj.get("ipv6") != null && !jsonObj.get("ipv6").isJsonNull()) { - CreateNetworkIPv6.validateJsonElement(jsonObj.get("ipv6")); - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `name` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("name").toString())); - } - if ((jsonObj.get("routingTableId") != null && !jsonObj.get("routingTableId").isJsonNull()) - && !jsonObj.get("routingTableId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `routingTableId` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("routingTableId").toString())); - } - if ((jsonObj.get("vpcId") != null && !jsonObj.get("vpcId").isJsonNull()) - && !jsonObj.get("vpcId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `vpcId` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("vpcId").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateNetworkPayload.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateNetworkPayload' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(CreateNetworkPayload.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateNetworkPayload value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional 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 { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public CreateNetworkPayload read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - CreateNetworkPayload 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( - java.util.Locale.ROOT, - "The field `%s` has unknown primitive type. Value: %s", - entry.getKey(), - entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - }.nullSafe(); - } - } - - /** - * Create an instance of CreateNetworkPayload given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateNetworkPayload - * @throws IOException if the JSON string is invalid with respect to CreateNetworkPayload - */ - public static CreateNetworkPayload fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateNetworkPayload.class); - } - - /** - * Convert an instance of CreateNetworkPayload to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/CreateVPCNetworkRangePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/CreateVPCNetworkRangePayload.java deleted file mode 100644 index f6f15e65..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/CreateVPCNetworkRangePayload.java +++ /dev/null @@ -1,233 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.model; - -import cloud.stackit.sdk.iaas.v2alpha1api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Map; -import java.util.logging.Level; -import java.util.logging.Logger; - -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class CreateVPCNetworkRangePayload extends AbstractOpenApiSchema { - private static final Logger log = - Logger.getLogger(CreateVPCNetworkRangePayload.class.getName()); - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateVPCNetworkRangePayload.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateVPCNetworkRangePayload' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter adapterNetworkRangeIPv4Request = - gson.getDelegateAdapter(this, TypeToken.get(NetworkRangeIPv4Request.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateVPCNetworkRangePayload value) - throws IOException { - if (value == null || value.getActualInstance() == null) { - elementAdapter.write(out, null); - return; - } - - // check if the actual instance is of the type `NetworkRangeIPv4Request` - if (value.getActualInstance() instanceof NetworkRangeIPv4Request) { - JsonElement element = - adapterNetworkRangeIPv4Request.toJsonTree( - (NetworkRangeIPv4Request) - value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - throw new IOException( - "Failed to serialize as the type doesn't match oneOf schemas: NetworkRangeIPv4Request"); - } - - @Override - public CreateVPCNetworkRangePayload read(JsonReader in) throws IOException { - Object deserialized = null; - JsonElement jsonElement = elementAdapter.read(in); - - int match = 0; - ArrayList errorMessages = new ArrayList<>(); - TypeAdapter actualAdapter = elementAdapter; - - // deserialize NetworkRangeIPv4Request - try { - // validate the JSON object to see if any exception is thrown - NetworkRangeIPv4Request.validateJsonElement(jsonElement); - actualAdapter = adapterNetworkRangeIPv4Request; - match++; - log.log( - Level.FINER, - "Input data matches schema 'NetworkRangeIPv4Request'"); - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - java.util.Locale.ROOT, - "Deserialization for NetworkRangeIPv4Request failed with `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema 'NetworkRangeIPv4Request'", - e); - } - - if (match == 1) { - CreateVPCNetworkRangePayload ret = - new CreateVPCNetworkRangePayload(); - ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); - return ret; - } - - throw new IOException( - String.format( - java.util.Locale.ROOT, - "Failed deserialization for CreateVPCNetworkRangePayload: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", - match, - errorMessages, - jsonElement.toString())); - } - }.nullSafe(); - } - } - - // store a list of schema names defined in oneOf - public static final Map> schemas = new HashMap>(); - - public CreateVPCNetworkRangePayload() { - super("oneOf", Boolean.FALSE); - } - - public CreateVPCNetworkRangePayload(Object o) { - super("oneOf", Boolean.FALSE); - setActualInstance(o); - } - - static { - schemas.put("NetworkRangeIPv4Request", NetworkRangeIPv4Request.class); - } - - @Override - public Map> getSchemas() { - return CreateVPCNetworkRangePayload.schemas; - } - - /** - * Set the instance that matches the oneOf child schema, check the instance parameter is valid - * against the oneOf child schemas: NetworkRangeIPv4Request - * - *

It could be an instance of the 'oneOf' schemas. - */ - @Override - public void setActualInstance(Object instance) { - if (instance instanceof NetworkRangeIPv4Request) { - super.setActualInstance(instance); - return; - } - - throw new RuntimeException("Invalid instance type. Must be NetworkRangeIPv4Request"); - } - - /** - * Get the actual instance, which can be the following: NetworkRangeIPv4Request - * - * @return The actual instance (NetworkRangeIPv4Request) - */ - @SuppressWarnings("unchecked") - @Override - public Object getActualInstance() { - return super.getActualInstance(); - } - - /** - * Get the actual instance of `NetworkRangeIPv4Request`. If the actual instance is not - * `NetworkRangeIPv4Request`, the ClassCastException will be thrown. - * - * @return The actual instance of `NetworkRangeIPv4Request` - * @throws ClassCastException if the instance is not `NetworkRangeIPv4Request` - */ - public NetworkRangeIPv4Request getNetworkRangeIPv4Request() throws ClassCastException { - return (NetworkRangeIPv4Request) super.getActualInstance(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * CreateVPCNetworkRangePayload - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - // validate oneOf schemas one by one - int validCount = 0; - ArrayList errorMessages = new ArrayList<>(); - // validate the json string with NetworkRangeIPv4Request - try { - NetworkRangeIPv4Request.validateJsonElement(jsonElement); - validCount++; - } catch (Exception e) { - errorMessages.add( - String.format( - java.util.Locale.ROOT, - "Deserialization for NetworkRangeIPv4Request failed with `%s`.", - e.getMessage())); - // continue to the next one - } - if (validCount != 1) { - throw new IOException( - String.format( - java.util.Locale.ROOT, - "The JSON string is invalid for CreateVPCNetworkRangePayload with oneOf schemas: NetworkRangeIPv4Request. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", - validCount, - errorMessages, - jsonElement.toString())); - } - } - - /** - * Create an instance of CreateVPCNetworkRangePayload given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateVPCNetworkRangePayload - * @throws IOException if the JSON string is invalid with respect to - * CreateVPCNetworkRangePayload - */ - public static CreateVPCNetworkRangePayload fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateVPCNetworkRangePayload.class); - } - - /** - * Convert an instance of CreateVPCNetworkRangePayload to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/CreateVPCPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/CreateVPCPayload.java deleted file mode 100644 index a893738b..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/CreateVPCPayload.java +++ /dev/null @@ -1,377 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.model; - -import cloud.stackit.sdk.iaas.v2alpha1api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** Object that represents a create VPC request. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class CreateVPCPayload { - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - @javax.annotation.Nullable private String description; - - public static final String SERIALIZED_NAME_LABELS = "labels"; - - @SerializedName(SERIALIZED_NAME_LABELS) - @javax.annotation.Nullable private Object labels; - - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - @javax.annotation.Nonnull - private String name; - - public CreateVPCPayload() {} - - public CreateVPCPayload description(@javax.annotation.Nullable String description) { - this.description = description; - return this; - } - - /** - * Description Object. Allows string up to 255 Characters. - * - * @return description - */ - @javax.annotation.Nullable public String getDescription() { - return description; - } - - public void setDescription(@javax.annotation.Nullable String description) { - this.description = description; - } - - public CreateVPCPayload labels(@javax.annotation.Nullable Object labels) { - this.labels = labels; - return this; - } - - /** - * Object that represents the labels as key-value pairs of a resource. Key constraints: - May - * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must - * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain - * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), - * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 - * and 63 characters. - Must begin and end with an alphanumerical character - * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), - * dots (`.`), and alphanumerics in between. - Keys starting with the prefix - * `stackit-` or having a domain prefix of `stackit.cloud` (including its - * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value - * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not - * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May - * contain dashes (`-`), underscores (`_`), dots (`.`), and - * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are - * excluded from this count. Providing a `null` value for a key will remove that key. - * - * @return labels - */ - @javax.annotation.Nullable public Object getLabels() { - return labels; - } - - public void setLabels(@javax.annotation.Nullable Object labels) { - this.labels = labels; - } - - public CreateVPCPayload name(@javax.annotation.Nonnull String name) { - this.name = name; - return this; - } - - /** - * The name for a General Object. Matches Names and also UUIDs. - * - * @return name - */ - @javax.annotation.Nonnull - public String getName() { - return name; - } - - public void setName(@javax.annotation.Nonnull 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. - * - * @param key name of the property - * @param value value of the property - * @return the CreateVPCPayload instance itself - */ - public CreateVPCPayload 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. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - 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; - } - CreateVPCPayload createVPCPayload = (CreateVPCPayload) o; - return Objects.equals(this.description, createVPCPayload.description) - && Objects.equals(this.labels, createVPCPayload.labels) - && Objects.equals(this.name, createVPCPayload.name) - && Objects.equals(this.additionalProperties, createVPCPayload.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(description, labels, name, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateVPCPayload {\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" labels: ").append(toIndentedString(labels)).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(Arrays.asList("description", "labels", "name")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("name")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to CreateVPCPayload - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!CreateVPCPayload.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field(s) %s in CreateVPCPayload is not found in the empty JSON string", - CreateVPCPayload.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CreateVPCPayload.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field `%s` is not found in the JSON string: %s", - requiredField, - jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) - && !jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `description` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("description").toString())); - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "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 (!CreateVPCPayload.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateVPCPayload' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(CreateVPCPayload.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateVPCPayload value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional 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 { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public CreateVPCPayload read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - CreateVPCPayload 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( - java.util.Locale.ROOT, - "The field `%s` has unknown primitive type. Value: %s", - entry.getKey(), - entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - }.nullSafe(); - } - } - - /** - * Create an instance of CreateVPCPayload given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateVPCPayload - * @throws IOException if the JSON string is invalid with respect to CreateVPCPayload - */ - public static CreateVPCPayload fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateVPCPayload.class); - } - - /** - * Convert an instance of CreateVPCPayload to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/CreateVPCRegionPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/CreateVPCRegionPayload.java deleted file mode 100644 index 7a96f1d2..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/CreateVPCRegionPayload.java +++ /dev/null @@ -1,320 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.model; - -import cloud.stackit.sdk.iaas.v2alpha1api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** The basic properties of a regional VPC. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class CreateVPCRegionPayload { - public static final String SERIALIZED_NAME_IPV4 = "ipv4"; - - @SerializedName(SERIALIZED_NAME_IPV4) - @javax.annotation.Nullable private RegionalVPCIPv4 ipv4; - - public static final String SERIALIZED_NAME_STATUS = "status"; - - @SerializedName(SERIALIZED_NAME_STATUS) - @javax.annotation.Nullable private String status; - - public CreateVPCRegionPayload() {} - - public CreateVPCRegionPayload(String status) { - this(); - this.status = status; - } - - public CreateVPCRegionPayload ipv4(@javax.annotation.Nullable RegionalVPCIPv4 ipv4) { - this.ipv4 = ipv4; - return this; - } - - /** - * Get ipv4 - * - * @return ipv4 - */ - @javax.annotation.Nullable public RegionalVPCIPv4 getIpv4() { - return ipv4; - } - - public void setIpv4(@javax.annotation.Nullable RegionalVPCIPv4 ipv4) { - this.ipv4 = ipv4; - } - - /** - * The state of a resource object. Possible values: `CREATING`, `CREATED`, - * `DELETING`, `DELETED`, `FAILED`, `UPDATED`, - * `UPDATING`. - * - * @return status - */ - @javax.annotation.Nullable public String getStatus() { - return status; - } - - /** - * 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. - * - * @param key name of the property - * @param value value of the property - * @return the CreateVPCRegionPayload instance itself - */ - public CreateVPCRegionPayload 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. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - 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; - } - CreateVPCRegionPayload createVPCRegionPayload = (CreateVPCRegionPayload) o; - return Objects.equals(this.ipv4, createVPCRegionPayload.ipv4) - && Objects.equals(this.status, createVPCRegionPayload.status) - && Objects.equals( - this.additionalProperties, createVPCRegionPayload.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(ipv4, status, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateVPCRegionPayload {\n"); - sb.append(" ipv4: ").append(toIndentedString(ipv4)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).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(Arrays.asList("ipv4", "status")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(0); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to CreateVPCRegionPayload - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!CreateVPCRegionPayload.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field(s) %s in CreateVPCRegionPayload is not found in the empty JSON string", - CreateVPCRegionPayload.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `ipv4` - if (jsonObj.get("ipv4") != null && !jsonObj.get("ipv4").isJsonNull()) { - RegionalVPCIPv4.validateJsonElement(jsonObj.get("ipv4")); - } - if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) - && !jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `status` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("status").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateVPCRegionPayload.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateVPCRegionPayload' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(CreateVPCRegionPayload.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateVPCRegionPayload value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional 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 { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public CreateVPCRegionPayload read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - CreateVPCRegionPayload 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( - java.util.Locale.ROOT, - "The field `%s` has unknown primitive type. Value: %s", - entry.getKey(), - entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - }.nullSafe(); - } - } - - /** - * Create an instance of CreateVPCRegionPayload given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateVPCRegionPayload - * @throws IOException if the JSON string is invalid with respect to CreateVPCRegionPayload - */ - public static CreateVPCRegionPayload fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateVPCRegionPayload.class); - } - - /** - * Convert an instance of CreateVPCRegionPayload to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/DestinationCIDRv4.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/DestinationCIDRv4.java deleted file mode 100644 index 083a5a02..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/DestinationCIDRv4.java +++ /dev/null @@ -1,402 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.model; - -import cloud.stackit.sdk.iaas.v2alpha1api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** IPv4 Classless Inter-Domain Routing (CIDR) Object. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class DestinationCIDRv4 { - /** Gets or Sets type */ - @JsonAdapter(TypeEnum.Adapter.class) - public enum TypeEnum { - CIDRV4("cidrv4"), - - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static TypeEnum fromValue(String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public TypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return TypeEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - TypeEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_TYPE = "type"; - - @SerializedName(SERIALIZED_NAME_TYPE) - @javax.annotation.Nonnull - private TypeEnum type; - - public static final String SERIALIZED_NAME_VALUE = "value"; - - @SerializedName(SERIALIZED_NAME_VALUE) - @javax.annotation.Nonnull - private String value; - - public DestinationCIDRv4() {} - - public DestinationCIDRv4 type(@javax.annotation.Nonnull TypeEnum type) { - this.type = type; - return this; - } - - /** - * Get type - * - * @return type - */ - @javax.annotation.Nonnull - public TypeEnum getType() { - return type; - } - - public void setType(@javax.annotation.Nonnull TypeEnum type) { - this.type = type; - } - - public DestinationCIDRv4 value(@javax.annotation.Nonnull String value) { - this.value = value; - return this; - } - - /** - * An CIDRv4 string. - * - * @return value - */ - @javax.annotation.Nonnull - public String getValue() { - return value; - } - - public void setValue(@javax.annotation.Nonnull String value) { - this.value = value; - } - - /** - * 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. - * - * @param key name of the property - * @param value value of the property - * @return the DestinationCIDRv4 instance itself - */ - public DestinationCIDRv4 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. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - 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; - } - DestinationCIDRv4 destinationCIDRv4 = (DestinationCIDRv4) o; - return Objects.equals(this.type, destinationCIDRv4.type) - && Objects.equals(this.value, destinationCIDRv4.value) - && Objects.equals( - this.additionalProperties, destinationCIDRv4.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(type, value, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DestinationCIDRv4 {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).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(Arrays.asList("type", "value")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("type", "value")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to DestinationCIDRv4 - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!DestinationCIDRv4.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field(s) %s in DestinationCIDRv4 is not found in the empty JSON string", - DestinationCIDRv4.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : DestinationCIDRv4.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field `%s` is not found in the JSON string: %s", - requiredField, - jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `type` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("type").toString())); - } - // OVERRIDE: this if block fixes oneOf issues - if (!"cidrv4".equals(jsonObj.get("type").getAsString())) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expectd the field `type` to have value `cidrv4` but got `%s`", - jsonObj.get("type"))); - } - // validate the required field `type` - TypeEnum.validateJsonElement(jsonObj.get("type")); - if (!jsonObj.get("value").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `value` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("value").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!DestinationCIDRv4.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'DestinationCIDRv4' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(DestinationCIDRv4.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, DestinationCIDRv4 value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional 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 { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public DestinationCIDRv4 read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - DestinationCIDRv4 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( - java.util.Locale.ROOT, - "The field `%s` has unknown primitive type. Value: %s", - entry.getKey(), - entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - }.nullSafe(); - } - } - - /** - * Create an instance of DestinationCIDRv4 given an JSON string - * - * @param jsonString JSON string - * @return An instance of DestinationCIDRv4 - * @throws IOException if the JSON string is invalid with respect to DestinationCIDRv4 - */ - public static DestinationCIDRv4 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, DestinationCIDRv4.class); - } - - /** - * Convert an instance of DestinationCIDRv4 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/DestinationCIDRv6.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/DestinationCIDRv6.java deleted file mode 100644 index ba6d9eff..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/DestinationCIDRv6.java +++ /dev/null @@ -1,402 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.model; - -import cloud.stackit.sdk.iaas.v2alpha1api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** IPv6 Classless Inter-Domain Routing (CIDR) Object. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class DestinationCIDRv6 { - /** Gets or Sets type */ - @JsonAdapter(TypeEnum.Adapter.class) - public enum TypeEnum { - CIDRV6("cidrv6"), - - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static TypeEnum fromValue(String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public TypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return TypeEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - TypeEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_TYPE = "type"; - - @SerializedName(SERIALIZED_NAME_TYPE) - @javax.annotation.Nonnull - private TypeEnum type; - - public static final String SERIALIZED_NAME_VALUE = "value"; - - @SerializedName(SERIALIZED_NAME_VALUE) - @javax.annotation.Nonnull - private String value; - - public DestinationCIDRv6() {} - - public DestinationCIDRv6 type(@javax.annotation.Nonnull TypeEnum type) { - this.type = type; - return this; - } - - /** - * Get type - * - * @return type - */ - @javax.annotation.Nonnull - public TypeEnum getType() { - return type; - } - - public void setType(@javax.annotation.Nonnull TypeEnum type) { - this.type = type; - } - - public DestinationCIDRv6 value(@javax.annotation.Nonnull String value) { - this.value = value; - return this; - } - - /** - * An CIDRv6 string. - * - * @return value - */ - @javax.annotation.Nonnull - public String getValue() { - return value; - } - - public void setValue(@javax.annotation.Nonnull String value) { - this.value = value; - } - - /** - * 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. - * - * @param key name of the property - * @param value value of the property - * @return the DestinationCIDRv6 instance itself - */ - public DestinationCIDRv6 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. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - 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; - } - DestinationCIDRv6 destinationCIDRv6 = (DestinationCIDRv6) o; - return Objects.equals(this.type, destinationCIDRv6.type) - && Objects.equals(this.value, destinationCIDRv6.value) - && Objects.equals( - this.additionalProperties, destinationCIDRv6.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(type, value, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DestinationCIDRv6 {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).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(Arrays.asList("type", "value")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("type", "value")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to DestinationCIDRv6 - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!DestinationCIDRv6.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field(s) %s in DestinationCIDRv6 is not found in the empty JSON string", - DestinationCIDRv6.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : DestinationCIDRv6.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field `%s` is not found in the JSON string: %s", - requiredField, - jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `type` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("type").toString())); - } - // OVERRIDE: this if block fixes oneOf issues - if (!"cidrv6".equals(jsonObj.get("type").getAsString())) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expectd the field `type` to have value `cidrv6` but got `%s`", - jsonObj.get("type"))); - } - // validate the required field `type` - TypeEnum.validateJsonElement(jsonObj.get("type")); - if (!jsonObj.get("value").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `value` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("value").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!DestinationCIDRv6.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'DestinationCIDRv6' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(DestinationCIDRv6.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, DestinationCIDRv6 value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional 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 { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public DestinationCIDRv6 read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - DestinationCIDRv6 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( - java.util.Locale.ROOT, - "The field `%s` has unknown primitive type. Value: %s", - entry.getKey(), - entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - }.nullSafe(); - } - } - - /** - * Create an instance of DestinationCIDRv6 given an JSON string - * - * @param jsonString JSON string - * @return An instance of DestinationCIDRv6 - * @throws IOException if the JSON string is invalid with respect to DestinationCIDRv6 - */ - public static DestinationCIDRv6 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, DestinationCIDRv6.class); - } - - /** - * Convert an instance of DestinationCIDRv6 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/Error.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/Error.java deleted file mode 100644 index 4e7a6177..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/Error.java +++ /dev/null @@ -1,331 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.model; - -import cloud.stackit.sdk.iaas.v2alpha1api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** Error with HTTP error code and an error message. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class Error { - public static final String SERIALIZED_NAME_CODE = "code"; - - @SerializedName(SERIALIZED_NAME_CODE) - @javax.annotation.Nonnull - private Long code; - - public static final String SERIALIZED_NAME_MSG = "msg"; - - @SerializedName(SERIALIZED_NAME_MSG) - @javax.annotation.Nonnull - private String msg; - - public Error() {} - - public Error code(@javax.annotation.Nonnull Long code) { - this.code = code; - return this; - } - - /** - * Get code - * - * @return code - */ - @javax.annotation.Nonnull - public Long getCode() { - return code; - } - - public void setCode(@javax.annotation.Nonnull Long code) { - this.code = code; - } - - public Error msg(@javax.annotation.Nonnull String msg) { - this.msg = msg; - return this; - } - - /** - * An error message. - * - * @return msg - */ - @javax.annotation.Nonnull - public String getMsg() { - return msg; - } - - public void setMsg(@javax.annotation.Nonnull String msg) { - this.msg = msg; - } - - /** - * 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. - * - * @param key name of the property - * @param value value of the property - * @return the Error instance itself - */ - public Error 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. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - 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; - } - Error error = (Error) o; - return Objects.equals(this.code, error.code) - && Objects.equals(this.msg, error.msg) - && Objects.equals(this.additionalProperties, error.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(code, msg, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Error {\n"); - sb.append(" code: ").append(toIndentedString(code)).append("\n"); - sb.append(" msg: ").append(toIndentedString(msg)).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(Arrays.asList("code", "msg")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("code", "msg")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to Error - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!Error.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field(s) %s in Error is not found in the empty JSON string", - Error.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Error.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field `%s` is not found in the JSON string: %s", - requiredField, - jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("msg").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `msg` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("msg").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Error.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Error' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(Error.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, Error value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional 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 { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public Error read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - Error 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( - java.util.Locale.ROOT, - "The field `%s` has unknown primitive type. Value: %s", - entry.getKey(), - entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - }.nullSafe(); - } - } - - /** - * Create an instance of Error given an JSON string - * - * @param jsonString JSON string - * @return An instance of Error - * @throws IOException if the JSON string is invalid with respect to Error - */ - public static Error fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Error.class); - } - - /** - * Convert an instance of Error to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/Network.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/Network.java deleted file mode 100644 index f2fbfb2b..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/Network.java +++ /dev/null @@ -1,692 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.model; - -import cloud.stackit.sdk.iaas.v2alpha1api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.UUID; - -/** - * Object that represents a network. If no routing table is specified, the default routing table is - * used. - */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class Network { - public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; - - @SerializedName(SERIALIZED_NAME_CREATED_AT) - @javax.annotation.Nullable private OffsetDateTime createdAt; - - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - @javax.annotation.Nullable private String description; - - public static final String SERIALIZED_NAME_DHCP = "dhcp"; - - @SerializedName(SERIALIZED_NAME_DHCP) - @javax.annotation.Nullable private Boolean dhcp; - - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - @javax.annotation.Nonnull - private UUID id; - - public static final String SERIALIZED_NAME_IPV4 = "ipv4"; - - @SerializedName(SERIALIZED_NAME_IPV4) - @javax.annotation.Nullable private NetworkIPv4 ipv4; - - public static final String SERIALIZED_NAME_IPV6 = "ipv6"; - - @SerializedName(SERIALIZED_NAME_IPV6) - @javax.annotation.Nullable private NetworkIPv6 ipv6; - - public static final String SERIALIZED_NAME_LABELS = "labels"; - - @SerializedName(SERIALIZED_NAME_LABELS) - @javax.annotation.Nullable private Object labels; - - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - @javax.annotation.Nonnull - private String name; - - public static final String SERIALIZED_NAME_ROUTED = "routed"; - - @SerializedName(SERIALIZED_NAME_ROUTED) - @javax.annotation.Nullable private Boolean routed; - - public static final String SERIALIZED_NAME_ROUTING_TABLE_ID = "routingTableId"; - - @SerializedName(SERIALIZED_NAME_ROUTING_TABLE_ID) - @javax.annotation.Nullable private UUID routingTableId; - - public static final String SERIALIZED_NAME_STATUS = "status"; - - @SerializedName(SERIALIZED_NAME_STATUS) - @javax.annotation.Nonnull - private String status; - - public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; - - @SerializedName(SERIALIZED_NAME_UPDATED_AT) - @javax.annotation.Nullable private OffsetDateTime updatedAt; - - public static final String SERIALIZED_NAME_VPC_ID = "vpcId"; - - @SerializedName(SERIALIZED_NAME_VPC_ID) - @javax.annotation.Nullable private UUID vpcId; - - public Network() {} - - public Network(OffsetDateTime createdAt, OffsetDateTime updatedAt) { - this(); - this.createdAt = createdAt; - this.updatedAt = updatedAt; - } - - /** - * Date-time when resource was created. - * - * @return createdAt - */ - @javax.annotation.Nullable public OffsetDateTime getCreatedAt() { - return createdAt; - } - - public Network description(@javax.annotation.Nullable String description) { - this.description = description; - return this; - } - - /** - * Description Object. Allows string up to 255 Characters. - * - * @return description - */ - @javax.annotation.Nullable public String getDescription() { - return description; - } - - public void setDescription(@javax.annotation.Nullable String description) { - this.description = description; - } - - public Network dhcp(@javax.annotation.Nullable Boolean dhcp) { - this.dhcp = dhcp; - return this; - } - - /** - * Enable or disable DHCP for a network. - * - * @return dhcp - */ - @javax.annotation.Nullable public Boolean getDhcp() { - return dhcp; - } - - public void setDhcp(@javax.annotation.Nullable Boolean dhcp) { - this.dhcp = dhcp; - } - - public Network id(@javax.annotation.Nonnull UUID id) { - this.id = id; - return this; - } - - /** - * Universally Unique Identifier (UUID). - * - * @return id - */ - @javax.annotation.Nonnull - public UUID getId() { - return id; - } - - public void setId(@javax.annotation.Nonnull UUID id) { - this.id = id; - } - - public Network ipv4(@javax.annotation.Nullable NetworkIPv4 ipv4) { - this.ipv4 = ipv4; - return this; - } - - /** - * Get ipv4 - * - * @return ipv4 - */ - @javax.annotation.Nullable public NetworkIPv4 getIpv4() { - return ipv4; - } - - public void setIpv4(@javax.annotation.Nullable NetworkIPv4 ipv4) { - this.ipv4 = ipv4; - } - - public Network ipv6(@javax.annotation.Nullable NetworkIPv6 ipv6) { - this.ipv6 = ipv6; - return this; - } - - /** - * Get ipv6 - * - * @return ipv6 - */ - @javax.annotation.Nullable public NetworkIPv6 getIpv6() { - return ipv6; - } - - public void setIpv6(@javax.annotation.Nullable NetworkIPv6 ipv6) { - this.ipv6 = ipv6; - } - - public Network labels(@javax.annotation.Nullable Object labels) { - this.labels = labels; - return this; - } - - /** - * Object that represents the labels as key-value pairs of a resource. Key constraints: - May - * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must - * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain - * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), - * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 - * and 63 characters. - Must begin and end with an alphanumerical character - * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), - * dots (`.`), and alphanumerics in between. - Keys starting with the prefix - * `stackit-` or having a domain prefix of `stackit.cloud` (including its - * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value - * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not - * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May - * contain dashes (`-`), underscores (`_`), dots (`.`), and - * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are - * excluded from this count. Providing a `null` value for a key will remove that key. - * - * @return labels - */ - @javax.annotation.Nullable public Object getLabels() { - return labels; - } - - public void setLabels(@javax.annotation.Nullable Object labels) { - this.labels = labels; - } - - public Network name(@javax.annotation.Nonnull String name) { - this.name = name; - return this; - } - - /** - * Get name - * - * @return name - */ - @javax.annotation.Nonnull - public String getName() { - return name; - } - - public void setName(@javax.annotation.Nonnull String name) { - this.name = name; - } - - public Network routed(@javax.annotation.Nullable Boolean routed) { - this.routed = routed; - return this; - } - - /** - * Shows if the network is routed and therefore accessible from other networks. - * - * @return routed - */ - @javax.annotation.Nullable public Boolean getRouted() { - return routed; - } - - public void setRouted(@javax.annotation.Nullable Boolean routed) { - this.routed = routed; - } - - public Network routingTableId(@javax.annotation.Nullable UUID routingTableId) { - this.routingTableId = routingTableId; - return this; - } - - /** - * Universally Unique Identifier (UUID). - * - * @return routingTableId - */ - @javax.annotation.Nullable public UUID getRoutingTableId() { - return routingTableId; - } - - public void setRoutingTableId(@javax.annotation.Nullable UUID routingTableId) { - this.routingTableId = routingTableId; - } - - public Network status(@javax.annotation.Nonnull String status) { - this.status = status; - return this; - } - - /** - * The state of a resource object. Possible values: `CREATING`, `CREATED`, - * `DELETING`, `DELETED`, `FAILED`, `UPDATED`, - * `UPDATING`. - * - * @return status - */ - @javax.annotation.Nonnull - public String getStatus() { - return status; - } - - public void setStatus(@javax.annotation.Nonnull String status) { - this.status = status; - } - - /** - * Date-time when resource was last updated. - * - * @return updatedAt - */ - @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { - return updatedAt; - } - - public Network vpcId(@javax.annotation.Nullable UUID vpcId) { - this.vpcId = vpcId; - return this; - } - - /** - * The identifier (ID) of a STACKIT VPC. - * - * @return vpcId - */ - @javax.annotation.Nullable public UUID getVpcId() { - return vpcId; - } - - public void setVpcId(@javax.annotation.Nullable UUID vpcId) { - this.vpcId = vpcId; - } - - /** - * 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. - * - * @param key name of the property - * @param value value of the property - * @return the Network instance itself - */ - public Network 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. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - 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; - } - Network network = (Network) o; - return Objects.equals(this.createdAt, network.createdAt) - && Objects.equals(this.description, network.description) - && Objects.equals(this.dhcp, network.dhcp) - && Objects.equals(this.id, network.id) - && Objects.equals(this.ipv4, network.ipv4) - && Objects.equals(this.ipv6, network.ipv6) - && Objects.equals(this.labels, network.labels) - && Objects.equals(this.name, network.name) - && Objects.equals(this.routed, network.routed) - && Objects.equals(this.routingTableId, network.routingTableId) - && Objects.equals(this.status, network.status) - && Objects.equals(this.updatedAt, network.updatedAt) - && Objects.equals(this.vpcId, network.vpcId) - && Objects.equals(this.additionalProperties, network.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash( - createdAt, - description, - dhcp, - id, - ipv4, - ipv6, - labels, - name, - routed, - routingTableId, - status, - updatedAt, - vpcId, - additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Network {\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" dhcp: ").append(toIndentedString(dhcp)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" ipv4: ").append(toIndentedString(ipv4)).append("\n"); - sb.append(" ipv6: ").append(toIndentedString(ipv6)).append("\n"); - sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" routed: ").append(toIndentedString(routed)).append("\n"); - sb.append(" routingTableId: ").append(toIndentedString(routingTableId)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); - sb.append(" vpcId: ").append(toIndentedString(vpcId)).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( - Arrays.asList( - "createdAt", - "description", - "dhcp", - "id", - "ipv4", - "ipv6", - "labels", - "name", - "routed", - "routingTableId", - "status", - "updatedAt", - "vpcId")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("id", "name", "status")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to Network - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!Network.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field(s) %s in Network is not found in the empty JSON string", - Network.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Network.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field `%s` is not found in the JSON string: %s", - requiredField, - jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) - && !jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `description` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("description").toString())); - } - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `id` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("id").toString())); - } - // validate the optional field `ipv4` - if (jsonObj.get("ipv4") != null && !jsonObj.get("ipv4").isJsonNull()) { - NetworkIPv4.validateJsonElement(jsonObj.get("ipv4")); - } - // validate the optional field `ipv6` - if (jsonObj.get("ipv6") != null && !jsonObj.get("ipv6").isJsonNull()) { - NetworkIPv6.validateJsonElement(jsonObj.get("ipv6")); - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `name` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("name").toString())); - } - if ((jsonObj.get("routingTableId") != null && !jsonObj.get("routingTableId").isJsonNull()) - && !jsonObj.get("routingTableId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `routingTableId` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("routingTableId").toString())); - } - if (!jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `status` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("status").toString())); - } - if ((jsonObj.get("vpcId") != null && !jsonObj.get("vpcId").isJsonNull()) - && !jsonObj.get("vpcId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `vpcId` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("vpcId").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Network.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Network' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(Network.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, Network value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional 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 { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public Network read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - Network 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( - java.util.Locale.ROOT, - "The field `%s` has unknown primitive type. Value: %s", - entry.getKey(), - entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - }.nullSafe(); - } - } - - /** - * Create an instance of Network given an JSON string - * - * @param jsonString JSON string - * @return An instance of Network - * @throws IOException if the JSON string is invalid with respect to Network - */ - public static Network fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Network.class); - } - - /** - * Convert an instance of Network to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/NetworkIPv4.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/NetworkIPv4.java deleted file mode 100644 index 6a67c17c..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/NetworkIPv4.java +++ /dev/null @@ -1,485 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.model; - -import cloud.stackit.sdk.iaas.v2alpha1api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.UUID; -import org.openapitools.jackson.nullable.JsonNullable; - -/** Object that represents the IPv4 part of a network. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class NetworkIPv4 { - public static final String SERIALIZED_NAME_GATEWAY = "gateway"; - - @SerializedName(SERIALIZED_NAME_GATEWAY) - @javax.annotation.Nullable private String gateway; - - public static final String SERIALIZED_NAME_NAMESERVERS = "nameservers"; - - @SerializedName(SERIALIZED_NAME_NAMESERVERS) - @javax.annotation.Nullable private List nameservers = new ArrayList<>(); - - public static final String SERIALIZED_NAME_PREFIXES = "prefixes"; - - @SerializedName(SERIALIZED_NAME_PREFIXES) - @javax.annotation.Nonnull - private List prefixes = new ArrayList<>(); - - public static final String SERIALIZED_NAME_PUBLIC_IP = "publicIp"; - - @SerializedName(SERIALIZED_NAME_PUBLIC_IP) - @javax.annotation.Nullable private String publicIp; - - public static final String SERIALIZED_NAME_VPC_NETWORK_RANGE_ID = "vpcNetworkRangeId"; - - @SerializedName(SERIALIZED_NAME_VPC_NETWORK_RANGE_ID) - @javax.annotation.Nullable private UUID vpcNetworkRangeId; - - public NetworkIPv4() {} - - public NetworkIPv4(String publicIp) { - this(); - this.publicIp = publicIp; - } - - public NetworkIPv4 gateway(@javax.annotation.Nullable String gateway) { - this.gateway = gateway; - return this; - } - - /** - * The IPv4 gateway of a network. If not specified the first IP of the network will be assigned - * as the gateway. If 'null' is sent, then the network doesn't have a gateway. - * - * @return gateway - */ - @javax.annotation.Nullable public String getGateway() { - return gateway; - } - - public void setGateway(@javax.annotation.Nullable String gateway) { - this.gateway = gateway; - } - - public NetworkIPv4 nameservers(@javax.annotation.Nullable List nameservers) { - this.nameservers = nameservers; - return this; - } - - public NetworkIPv4 addNameserversItem(String nameserversItem) { - if (this.nameservers == null) { - this.nameservers = new ArrayList<>(); - } - this.nameservers.add(nameserversItem); - return this; - } - - /** - * A list containing DNS Servers/Nameservers for IPv4. - * - * @return nameservers - */ - @javax.annotation.Nullable public List getNameservers() { - return nameservers; - } - - public void setNameservers(@javax.annotation.Nullable List nameservers) { - this.nameservers = nameservers; - } - - public NetworkIPv4 prefixes(@javax.annotation.Nonnull List prefixes) { - this.prefixes = prefixes; - return this; - } - - public NetworkIPv4 addPrefixesItem(String prefixesItem) { - if (this.prefixes == null) { - this.prefixes = new ArrayList<>(); - } - this.prefixes.add(prefixesItem); - return this; - } - - /** - * Get prefixes - * - * @return prefixes - */ - @javax.annotation.Nonnull - public List getPrefixes() { - return prefixes; - } - - public void setPrefixes(@javax.annotation.Nonnull List prefixes) { - this.prefixes = prefixes; - } - - /** - * String that represents an IPv4 address. - * - * @return publicIp - */ - @javax.annotation.Nullable public String getPublicIp() { - return publicIp; - } - - public NetworkIPv4 vpcNetworkRangeId(@javax.annotation.Nullable UUID vpcNetworkRangeId) { - this.vpcNetworkRangeId = vpcNetworkRangeId; - return this; - } - - /** - * Universally Unique Identifier (UUID). - * - * @return vpcNetworkRangeId - */ - @javax.annotation.Nullable public UUID getVpcNetworkRangeId() { - return vpcNetworkRangeId; - } - - public void setVpcNetworkRangeId(@javax.annotation.Nullable UUID vpcNetworkRangeId) { - this.vpcNetworkRangeId = vpcNetworkRangeId; - } - - /** - * 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. - * - * @param key name of the property - * @param value value of the property - * @return the NetworkIPv4 instance itself - */ - public NetworkIPv4 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. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - 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; - } - NetworkIPv4 networkIPv4 = (NetworkIPv4) o; - return Objects.equals(this.gateway, networkIPv4.gateway) - && Objects.equals(this.nameservers, networkIPv4.nameservers) - && Objects.equals(this.prefixes, networkIPv4.prefixes) - && Objects.equals(this.publicIp, networkIPv4.publicIp) - && Objects.equals(this.vpcNetworkRangeId, networkIPv4.vpcNetworkRangeId) - && Objects.equals(this.additionalProperties, networkIPv4.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b - || (a != null - && b != null - && a.isPresent() - && b.isPresent() - && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash( - gateway, nameservers, prefixes, publicIp, vpcNetworkRangeId, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class NetworkIPv4 {\n"); - sb.append(" gateway: ").append(toIndentedString(gateway)).append("\n"); - sb.append(" nameservers: ").append(toIndentedString(nameservers)).append("\n"); - sb.append(" prefixes: ").append(toIndentedString(prefixes)).append("\n"); - sb.append(" publicIp: ").append(toIndentedString(publicIp)).append("\n"); - sb.append(" vpcNetworkRangeId: ") - .append(toIndentedString(vpcNetworkRangeId)) - .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( - Arrays.asList( - "gateway", - "nameservers", - "prefixes", - "publicIp", - "vpcNetworkRangeId")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("prefixes")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to NetworkIPv4 - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!NetworkIPv4.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field(s) %s in NetworkIPv4 is not found in the empty JSON string", - NetworkIPv4.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : NetworkIPv4.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field `%s` is not found in the JSON string: %s", - requiredField, - jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("gateway") != null && !jsonObj.get("gateway").isJsonNull()) - && !jsonObj.get("gateway").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `gateway` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("gateway").toString())); - } - // ensure the optional json data is an array if present - if (jsonObj.get("nameservers") != null - && !jsonObj.get("nameservers").isJsonNull() - && !jsonObj.get("nameservers").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `nameservers` to be an array in the JSON string but got `%s`", - jsonObj.get("nameservers").toString())); - } - // ensure the required json array is present - if (jsonObj.get("prefixes") == null) { - throw new IllegalArgumentException( - "Expected the field `linkedContent` to be an array in the JSON string but got `null`"); - } else if (!jsonObj.get("prefixes").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `prefixes` to be an array in the JSON string but got `%s`", - jsonObj.get("prefixes").toString())); - } - if ((jsonObj.get("publicIp") != null && !jsonObj.get("publicIp").isJsonNull()) - && !jsonObj.get("publicIp").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `publicIp` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("publicIp").toString())); - } - if ((jsonObj.get("vpcNetworkRangeId") != null - && !jsonObj.get("vpcNetworkRangeId").isJsonNull()) - && !jsonObj.get("vpcNetworkRangeId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `vpcNetworkRangeId` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("vpcNetworkRangeId").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!NetworkIPv4.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'NetworkIPv4' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(NetworkIPv4.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, NetworkIPv4 value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional 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 { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public NetworkIPv4 read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - NetworkIPv4 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( - java.util.Locale.ROOT, - "The field `%s` has unknown primitive type. Value: %s", - entry.getKey(), - entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - }.nullSafe(); - } - } - - /** - * Create an instance of NetworkIPv4 given an JSON string - * - * @param jsonString JSON string - * @return An instance of NetworkIPv4 - * @throws IOException if the JSON string is invalid with respect to NetworkIPv4 - */ - public static NetworkIPv4 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, NetworkIPv4.class); - } - - /** - * Convert an instance of NetworkIPv4 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/NetworkIPv6.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/NetworkIPv6.java deleted file mode 100644 index 24d5b89c..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/NetworkIPv6.java +++ /dev/null @@ -1,451 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.model; - -import cloud.stackit.sdk.iaas.v2alpha1api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.UUID; -import org.openapitools.jackson.nullable.JsonNullable; - -/** Object that represents the IPv6 part of a network. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class NetworkIPv6 { - public static final String SERIALIZED_NAME_GATEWAY = "gateway"; - - @SerializedName(SERIALIZED_NAME_GATEWAY) - @javax.annotation.Nullable private String gateway; - - public static final String SERIALIZED_NAME_NAMESERVERS = "nameservers"; - - @SerializedName(SERIALIZED_NAME_NAMESERVERS) - @javax.annotation.Nullable private List nameservers = new ArrayList<>(); - - public static final String SERIALIZED_NAME_PREFIXES = "prefixes"; - - @SerializedName(SERIALIZED_NAME_PREFIXES) - @javax.annotation.Nonnull - private List prefixes = new ArrayList<>(); - - public static final String SERIALIZED_NAME_VPC_NETWORK_RANGE_ID = "vpcNetworkRangeId"; - - @SerializedName(SERIALIZED_NAME_VPC_NETWORK_RANGE_ID) - @javax.annotation.Nullable private UUID vpcNetworkRangeId; - - public NetworkIPv6() {} - - public NetworkIPv6 gateway(@javax.annotation.Nullable String gateway) { - this.gateway = gateway; - return this; - } - - /** - * The IPv6 gateway of a network. If not specified the first IP of the network will be assigned - * as the gateway. If 'null' is sent, then the network doesn't have a gateway. - * - * @return gateway - */ - @javax.annotation.Nullable public String getGateway() { - return gateway; - } - - public void setGateway(@javax.annotation.Nullable String gateway) { - this.gateway = gateway; - } - - public NetworkIPv6 nameservers(@javax.annotation.Nullable List nameservers) { - this.nameservers = nameservers; - return this; - } - - public NetworkIPv6 addNameserversItem(String nameserversItem) { - if (this.nameservers == null) { - this.nameservers = new ArrayList<>(); - } - this.nameservers.add(nameserversItem); - return this; - } - - /** - * A list containing DNS Servers/Nameservers for IPv6. - * - * @return nameservers - */ - @javax.annotation.Nullable public List getNameservers() { - return nameservers; - } - - public void setNameservers(@javax.annotation.Nullable List nameservers) { - this.nameservers = nameservers; - } - - public NetworkIPv6 prefixes(@javax.annotation.Nonnull List prefixes) { - this.prefixes = prefixes; - return this; - } - - public NetworkIPv6 addPrefixesItem(String prefixesItem) { - if (this.prefixes == null) { - this.prefixes = new ArrayList<>(); - } - this.prefixes.add(prefixesItem); - return this; - } - - /** - * Get prefixes - * - * @return prefixes - */ - @javax.annotation.Nonnull - public List getPrefixes() { - return prefixes; - } - - public void setPrefixes(@javax.annotation.Nonnull List prefixes) { - this.prefixes = prefixes; - } - - public NetworkIPv6 vpcNetworkRangeId(@javax.annotation.Nullable UUID vpcNetworkRangeId) { - this.vpcNetworkRangeId = vpcNetworkRangeId; - return this; - } - - /** - * Universally Unique Identifier (UUID). - * - * @return vpcNetworkRangeId - */ - @javax.annotation.Nullable public UUID getVpcNetworkRangeId() { - return vpcNetworkRangeId; - } - - public void setVpcNetworkRangeId(@javax.annotation.Nullable UUID vpcNetworkRangeId) { - this.vpcNetworkRangeId = vpcNetworkRangeId; - } - - /** - * 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. - * - * @param key name of the property - * @param value value of the property - * @return the NetworkIPv6 instance itself - */ - public NetworkIPv6 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. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - 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; - } - NetworkIPv6 networkIPv6 = (NetworkIPv6) o; - return Objects.equals(this.gateway, networkIPv6.gateway) - && Objects.equals(this.nameservers, networkIPv6.nameservers) - && Objects.equals(this.prefixes, networkIPv6.prefixes) - && Objects.equals(this.vpcNetworkRangeId, networkIPv6.vpcNetworkRangeId) - && Objects.equals(this.additionalProperties, networkIPv6.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b - || (a != null - && b != null - && a.isPresent() - && b.isPresent() - && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash( - gateway, nameservers, prefixes, vpcNetworkRangeId, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class NetworkIPv6 {\n"); - sb.append(" gateway: ").append(toIndentedString(gateway)).append("\n"); - sb.append(" nameservers: ").append(toIndentedString(nameservers)).append("\n"); - sb.append(" prefixes: ").append(toIndentedString(prefixes)).append("\n"); - sb.append(" vpcNetworkRangeId: ") - .append(toIndentedString(vpcNetworkRangeId)) - .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( - Arrays.asList("gateway", "nameservers", "prefixes", "vpcNetworkRangeId")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("prefixes")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to NetworkIPv6 - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!NetworkIPv6.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field(s) %s in NetworkIPv6 is not found in the empty JSON string", - NetworkIPv6.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : NetworkIPv6.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field `%s` is not found in the JSON string: %s", - requiredField, - jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("gateway") != null && !jsonObj.get("gateway").isJsonNull()) - && !jsonObj.get("gateway").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `gateway` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("gateway").toString())); - } - // ensure the optional json data is an array if present - if (jsonObj.get("nameservers") != null - && !jsonObj.get("nameservers").isJsonNull() - && !jsonObj.get("nameservers").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `nameservers` to be an array in the JSON string but got `%s`", - jsonObj.get("nameservers").toString())); - } - // ensure the required json array is present - if (jsonObj.get("prefixes") == null) { - throw new IllegalArgumentException( - "Expected the field `linkedContent` to be an array in the JSON string but got `null`"); - } else if (!jsonObj.get("prefixes").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `prefixes` to be an array in the JSON string but got `%s`", - jsonObj.get("prefixes").toString())); - } - if ((jsonObj.get("vpcNetworkRangeId") != null - && !jsonObj.get("vpcNetworkRangeId").isJsonNull()) - && !jsonObj.get("vpcNetworkRangeId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `vpcNetworkRangeId` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("vpcNetworkRangeId").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!NetworkIPv6.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'NetworkIPv6' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(NetworkIPv6.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, NetworkIPv6 value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional 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 { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public NetworkIPv6 read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - NetworkIPv6 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( - java.util.Locale.ROOT, - "The field `%s` has unknown primitive type. Value: %s", - entry.getKey(), - entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - }.nullSafe(); - } - } - - /** - * Create an instance of NetworkIPv6 given an JSON string - * - * @param jsonString JSON string - * @return An instance of NetworkIPv6 - * @throws IOException if the JSON string is invalid with respect to NetworkIPv6 - */ - public static NetworkIPv6 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, NetworkIPv6.class); - } - - /** - * Convert an instance of NetworkIPv6 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/NetworkListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/NetworkListResponse.java deleted file mode 100644 index 9fc11e9b..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/NetworkListResponse.java +++ /dev/null @@ -1,324 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.model; - -import cloud.stackit.sdk.iaas.v2alpha1api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** Network list response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class NetworkListResponse { - public static final String SERIALIZED_NAME_ITEMS = "items"; - - @SerializedName(SERIALIZED_NAME_ITEMS) - @javax.annotation.Nonnull - private List items = new ArrayList<>(); - - public NetworkListResponse() {} - - public NetworkListResponse items(@javax.annotation.Nonnull List items) { - this.items = items; - return this; - } - - public NetworkListResponse addItemsItem(Network itemsItem) { - if (this.items == null) { - this.items = new ArrayList<>(); - } - this.items.add(itemsItem); - return this; - } - - /** - * A list of networks. - * - * @return items - */ - @javax.annotation.Nonnull - public List getItems() { - return items; - } - - public void setItems(@javax.annotation.Nonnull List items) { - this.items = items; - } - - /** - * 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. - * - * @param key name of the property - * @param value value of the property - * @return the NetworkListResponse instance itself - */ - public NetworkListResponse 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. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - 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; - } - NetworkListResponse networkListResponse = (NetworkListResponse) o; - return Objects.equals(this.items, networkListResponse.items) - && Objects.equals( - this.additionalProperties, networkListResponse.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(items, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class NetworkListResponse {\n"); - sb.append(" items: ").append(toIndentedString(items)).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(Arrays.asList("items")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("items")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to NetworkListResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!NetworkListResponse.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field(s) %s in NetworkListResponse is not found in the empty JSON string", - NetworkListResponse.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : NetworkListResponse.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field `%s` is not found in the JSON string: %s", - requiredField, - jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - Network.validateJsonElement(jsonArrayitems.get(i)); - } - ; - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!NetworkListResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'NetworkListResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(NetworkListResponse.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, NetworkListResponse value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional 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 { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public NetworkListResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - NetworkListResponse 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( - java.util.Locale.ROOT, - "The field `%s` has unknown primitive type. Value: %s", - entry.getKey(), - entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - }.nullSafe(); - } - } - - /** - * Create an instance of NetworkListResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of NetworkListResponse - * @throws IOException if the JSON string is invalid with respect to NetworkListResponse - */ - public static NetworkListResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, NetworkListResponse.class); - } - - /** - * Convert an instance of NetworkListResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/NetworkRangeIPv4Request.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/NetworkRangeIPv4Request.java deleted file mode 100644 index e7619c9c..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/NetworkRangeIPv4Request.java +++ /dev/null @@ -1,611 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.model; - -import cloud.stackit.sdk.iaas.v2alpha1api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** - * Contains the IPv4 properties of a VPC network range request. Filterable Fields: - * `defaultPrefixLen`, `maxPrefixLen`, `minPrefixLen`, - * `nameservers`, `prefix`. - */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class NetworkRangeIPv4Request { - public static final String SERIALIZED_NAME_DEFAULT_PREFIX_LEN = "defaultPrefixLen"; - - @SerializedName(SERIALIZED_NAME_DEFAULT_PREFIX_LEN) - @javax.annotation.Nullable private Long defaultPrefixLen = 25l; - - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - @javax.annotation.Nullable private String description; - - /** Gets or Sets ipVersion */ - @JsonAdapter(IpVersionEnum.Adapter.class) - public enum IpVersionEnum { - IPV4("ipv4"), - - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - IpVersionEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static IpVersionEnum fromValue(String value) { - for (IpVersionEnum b : IpVersionEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final IpVersionEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public IpVersionEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return IpVersionEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - IpVersionEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_IP_VERSION = "ipVersion"; - - @SerializedName(SERIALIZED_NAME_IP_VERSION) - @javax.annotation.Nonnull - private IpVersionEnum ipVersion; - - public static final String SERIALIZED_NAME_LABELS = "labels"; - - @SerializedName(SERIALIZED_NAME_LABELS) - @javax.annotation.Nullable private Object labels; - - public static final String SERIALIZED_NAME_MAX_PREFIX_LEN = "maxPrefixLen"; - - @SerializedName(SERIALIZED_NAME_MAX_PREFIX_LEN) - @javax.annotation.Nullable private Long maxPrefixLen = 29l; - - public static final String SERIALIZED_NAME_MIN_PREFIX_LEN = "minPrefixLen"; - - @SerializedName(SERIALIZED_NAME_MIN_PREFIX_LEN) - @javax.annotation.Nullable private Long minPrefixLen = 24l; - - public static final String SERIALIZED_NAME_NAMESERVERS = "nameservers"; - - @SerializedName(SERIALIZED_NAME_NAMESERVERS) - @javax.annotation.Nullable private List nameservers; - - public static final String SERIALIZED_NAME_PREFIX = "prefix"; - - @SerializedName(SERIALIZED_NAME_PREFIX) - @javax.annotation.Nonnull - private String prefix; - - public NetworkRangeIPv4Request() {} - - public NetworkRangeIPv4Request defaultPrefixLen( - @javax.annotation.Nullable Long defaultPrefixLen) { - this.defaultPrefixLen = defaultPrefixLen; - return this; - } - - /** - * The default prefix length for network ranges in the VPC. minimum: 24 maximum: 29 - * - * @return defaultPrefixLen - */ - @javax.annotation.Nullable public Long getDefaultPrefixLen() { - return defaultPrefixLen; - } - - public void setDefaultPrefixLen(@javax.annotation.Nullable Long defaultPrefixLen) { - this.defaultPrefixLen = defaultPrefixLen; - } - - public NetworkRangeIPv4Request description(@javax.annotation.Nullable String description) { - this.description = description; - return this; - } - - /** - * Description Object. Allows string up to 255 Characters. - * - * @return description - */ - @javax.annotation.Nullable public String getDescription() { - return description; - } - - public void setDescription(@javax.annotation.Nullable String description) { - this.description = description; - } - - public NetworkRangeIPv4Request ipVersion(@javax.annotation.Nonnull IpVersionEnum ipVersion) { - this.ipVersion = ipVersion; - return this; - } - - /** - * Get ipVersion - * - * @return ipVersion - */ - @javax.annotation.Nonnull - public IpVersionEnum getIpVersion() { - return ipVersion; - } - - public void setIpVersion(@javax.annotation.Nonnull IpVersionEnum ipVersion) { - this.ipVersion = ipVersion; - } - - public NetworkRangeIPv4Request labels(@javax.annotation.Nullable Object labels) { - this.labels = labels; - return this; - } - - /** - * Object that represents the labels as key-value pairs of a resource. Key constraints: - May - * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must - * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain - * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), - * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 - * and 63 characters. - Must begin and end with an alphanumerical character - * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), - * dots (`.`), and alphanumerics in between. - Keys starting with the prefix - * `stackit-` or having a domain prefix of `stackit.cloud` (including its - * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value - * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not - * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May - * contain dashes (`-`), underscores (`_`), dots (`.`), and - * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are - * excluded from this count. Providing a `null` value for a key will remove that key. - * - * @return labels - */ - @javax.annotation.Nullable public Object getLabels() { - return labels; - } - - public void setLabels(@javax.annotation.Nullable Object labels) { - this.labels = labels; - } - - public NetworkRangeIPv4Request maxPrefixLen(@javax.annotation.Nullable Long maxPrefixLen) { - this.maxPrefixLen = maxPrefixLen; - return this; - } - - /** - * The maximal prefix length for network ranges in the VPC. minimum: 24 maximum: 29 - * - * @return maxPrefixLen - */ - @javax.annotation.Nullable public Long getMaxPrefixLen() { - return maxPrefixLen; - } - - public void setMaxPrefixLen(@javax.annotation.Nullable Long maxPrefixLen) { - this.maxPrefixLen = maxPrefixLen; - } - - public NetworkRangeIPv4Request minPrefixLen(@javax.annotation.Nullable Long minPrefixLen) { - this.minPrefixLen = minPrefixLen; - return this; - } - - /** - * The minimal prefix length for network ranges in the VPC. minimum: 8 maximum: 29 - * - * @return minPrefixLen - */ - @javax.annotation.Nullable public Long getMinPrefixLen() { - return minPrefixLen; - } - - public void setMinPrefixLen(@javax.annotation.Nullable Long minPrefixLen) { - this.minPrefixLen = minPrefixLen; - } - - public NetworkRangeIPv4Request nameservers( - @javax.annotation.Nullable List nameservers) { - this.nameservers = nameservers; - return this; - } - - public NetworkRangeIPv4Request addNameserversItem(String nameserversItem) { - if (this.nameservers == null) { - this.nameservers = new ArrayList<>(); - } - this.nameservers.add(nameserversItem); - return this; - } - - /** - * A list containing DNS Servers/Nameservers for IPv4. - * - * @return nameservers - */ - @javax.annotation.Nullable public List getNameservers() { - return nameservers; - } - - public void setNameservers(@javax.annotation.Nullable List nameservers) { - this.nameservers = nameservers; - } - - public NetworkRangeIPv4Request prefix(@javax.annotation.Nonnull String prefix) { - this.prefix = prefix; - return this; - } - - /** - * Classless Inter-Domain Routing (CIDR). - * - * @return prefix - */ - @javax.annotation.Nonnull - public String getPrefix() { - return prefix; - } - - public void setPrefix(@javax.annotation.Nonnull String prefix) { - this.prefix = prefix; - } - - /** - * 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. - * - * @param key name of the property - * @param value value of the property - * @return the NetworkRangeIPv4Request instance itself - */ - public NetworkRangeIPv4Request 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. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - 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; - } - NetworkRangeIPv4Request networkRangeIPv4Request = (NetworkRangeIPv4Request) o; - return Objects.equals(this.defaultPrefixLen, networkRangeIPv4Request.defaultPrefixLen) - && Objects.equals(this.description, networkRangeIPv4Request.description) - && Objects.equals(this.ipVersion, networkRangeIPv4Request.ipVersion) - && Objects.equals(this.labels, networkRangeIPv4Request.labels) - && Objects.equals(this.maxPrefixLen, networkRangeIPv4Request.maxPrefixLen) - && Objects.equals(this.minPrefixLen, networkRangeIPv4Request.minPrefixLen) - && Objects.equals(this.nameservers, networkRangeIPv4Request.nameservers) - && Objects.equals(this.prefix, networkRangeIPv4Request.prefix) - && Objects.equals( - this.additionalProperties, networkRangeIPv4Request.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash( - defaultPrefixLen, - description, - ipVersion, - labels, - maxPrefixLen, - minPrefixLen, - nameservers, - prefix, - additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class NetworkRangeIPv4Request {\n"); - sb.append(" defaultPrefixLen: ").append(toIndentedString(defaultPrefixLen)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" ipVersion: ").append(toIndentedString(ipVersion)).append("\n"); - sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); - sb.append(" maxPrefixLen: ").append(toIndentedString(maxPrefixLen)).append("\n"); - sb.append(" minPrefixLen: ").append(toIndentedString(minPrefixLen)).append("\n"); - sb.append(" nameservers: ").append(toIndentedString(nameservers)).append("\n"); - sb.append(" prefix: ").append(toIndentedString(prefix)).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( - Arrays.asList( - "defaultPrefixLen", - "description", - "ipVersion", - "labels", - "maxPrefixLen", - "minPrefixLen", - "nameservers", - "prefix")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("ipVersion", "prefix")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to NetworkRangeIPv4Request - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!NetworkRangeIPv4Request.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field(s) %s in NetworkRangeIPv4Request is not found in the empty JSON string", - NetworkRangeIPv4Request.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : NetworkRangeIPv4Request.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field `%s` is not found in the JSON string: %s", - requiredField, - jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) - && !jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `description` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("description").toString())); - } - if (!jsonObj.get("ipVersion").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `ipVersion` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("ipVersion").toString())); - } - // validate the required field `ipVersion` - IpVersionEnum.validateJsonElement(jsonObj.get("ipVersion")); - // ensure the optional json data is an array if present - if (jsonObj.get("nameservers") != null - && !jsonObj.get("nameservers").isJsonNull() - && !jsonObj.get("nameservers").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `nameservers` to be an array in the JSON string but got `%s`", - jsonObj.get("nameservers").toString())); - } - if (!jsonObj.get("prefix").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `prefix` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("prefix").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!NetworkRangeIPv4Request.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'NetworkRangeIPv4Request' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(NetworkRangeIPv4Request.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, NetworkRangeIPv4Request value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional 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 { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public NetworkRangeIPv4Request read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - NetworkRangeIPv4Request 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( - java.util.Locale.ROOT, - "The field `%s` has unknown primitive type. Value: %s", - entry.getKey(), - entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - }.nullSafe(); - } - } - - /** - * Create an instance of NetworkRangeIPv4Request given an JSON string - * - * @param jsonString JSON string - * @return An instance of NetworkRangeIPv4Request - * @throws IOException if the JSON string is invalid with respect to NetworkRangeIPv4Request - */ - public static NetworkRangeIPv4Request fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, NetworkRangeIPv4Request.class); - } - - /** - * Convert an instance of NetworkRangeIPv4Request to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/NexthopBlackhole.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/NexthopBlackhole.java deleted file mode 100644 index c2a893e3..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/NexthopBlackhole.java +++ /dev/null @@ -1,367 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.model; - -import cloud.stackit.sdk.iaas.v2alpha1api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** Object that represents a blackhole route. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class NexthopBlackhole { - /** Gets or Sets type */ - @JsonAdapter(TypeEnum.Adapter.class) - public enum TypeEnum { - BLACKHOLE("blackhole"), - - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static TypeEnum fromValue(String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public TypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return TypeEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - TypeEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_TYPE = "type"; - - @SerializedName(SERIALIZED_NAME_TYPE) - @javax.annotation.Nonnull - private TypeEnum type; - - public NexthopBlackhole() {} - - public NexthopBlackhole type(@javax.annotation.Nonnull TypeEnum type) { - this.type = type; - return this; - } - - /** - * Get type - * - * @return type - */ - @javax.annotation.Nonnull - public TypeEnum getType() { - return type; - } - - public void setType(@javax.annotation.Nonnull TypeEnum type) { - this.type = type; - } - - /** - * 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. - * - * @param key name of the property - * @param value value of the property - * @return the NexthopBlackhole instance itself - */ - public NexthopBlackhole 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. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - 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; - } - NexthopBlackhole nexthopBlackhole = (NexthopBlackhole) o; - return Objects.equals(this.type, nexthopBlackhole.type) - && Objects.equals(this.additionalProperties, nexthopBlackhole.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(type, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class NexthopBlackhole {\n"); - sb.append(" type: ").append(toIndentedString(type)).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(Arrays.asList("type")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("type")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to NexthopBlackhole - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!NexthopBlackhole.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field(s) %s in NexthopBlackhole is not found in the empty JSON string", - NexthopBlackhole.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : NexthopBlackhole.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field `%s` is not found in the JSON string: %s", - requiredField, - jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `type` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("type").toString())); - } - // OVERRIDE: this if block fixes oneOf issues - if (!"blackhole".equals(jsonObj.get("type").getAsString())) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expectd the field `type` to have value `blackhole` but got `%s`", - jsonObj.get("type"))); - } - // validate the required field `type` - TypeEnum.validateJsonElement(jsonObj.get("type")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!NexthopBlackhole.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'NexthopBlackhole' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(NexthopBlackhole.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, NexthopBlackhole value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional 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 { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public NexthopBlackhole read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - NexthopBlackhole 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( - java.util.Locale.ROOT, - "The field `%s` has unknown primitive type. Value: %s", - entry.getKey(), - entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - }.nullSafe(); - } - } - - /** - * Create an instance of NexthopBlackhole given an JSON string - * - * @param jsonString JSON string - * @return An instance of NexthopBlackhole - * @throws IOException if the JSON string is invalid with respect to NexthopBlackhole - */ - public static NexthopBlackhole fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, NexthopBlackhole.class); - } - - /** - * Convert an instance of NexthopBlackhole to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/NexthopIPv4.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/NexthopIPv4.java deleted file mode 100644 index fafecfae..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/NexthopIPv4.java +++ /dev/null @@ -1,400 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.model; - -import cloud.stackit.sdk.iaas.v2alpha1api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** Object that represents an IPv4 address. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class NexthopIPv4 { - /** Gets or Sets type */ - @JsonAdapter(TypeEnum.Adapter.class) - public enum TypeEnum { - IPV4("ipv4"), - - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static TypeEnum fromValue(String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public TypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return TypeEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - TypeEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_TYPE = "type"; - - @SerializedName(SERIALIZED_NAME_TYPE) - @javax.annotation.Nonnull - private TypeEnum type; - - public static final String SERIALIZED_NAME_VALUE = "value"; - - @SerializedName(SERIALIZED_NAME_VALUE) - @javax.annotation.Nonnull - private String value; - - public NexthopIPv4() {} - - public NexthopIPv4 type(@javax.annotation.Nonnull TypeEnum type) { - this.type = type; - return this; - } - - /** - * Get type - * - * @return type - */ - @javax.annotation.Nonnull - public TypeEnum getType() { - return type; - } - - public void setType(@javax.annotation.Nonnull TypeEnum type) { - this.type = type; - } - - public NexthopIPv4 value(@javax.annotation.Nonnull String value) { - this.value = value; - return this; - } - - /** - * An IPv4 address. - * - * @return value - */ - @javax.annotation.Nonnull - public String getValue() { - return value; - } - - public void setValue(@javax.annotation.Nonnull String value) { - this.value = value; - } - - /** - * 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. - * - * @param key name of the property - * @param value value of the property - * @return the NexthopIPv4 instance itself - */ - public NexthopIPv4 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. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - 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; - } - NexthopIPv4 nexthopIPv4 = (NexthopIPv4) o; - return Objects.equals(this.type, nexthopIPv4.type) - && Objects.equals(this.value, nexthopIPv4.value) - && Objects.equals(this.additionalProperties, nexthopIPv4.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(type, value, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class NexthopIPv4 {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).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(Arrays.asList("type", "value")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("type", "value")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to NexthopIPv4 - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!NexthopIPv4.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field(s) %s in NexthopIPv4 is not found in the empty JSON string", - NexthopIPv4.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : NexthopIPv4.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field `%s` is not found in the JSON string: %s", - requiredField, - jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `type` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("type").toString())); - } - // OVERRIDE: this if block fixes oneOf issues - if (!"ipv4".equals(jsonObj.get("type").getAsString())) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expectd the field `type` to have value `ipv4` but got `%s`", - jsonObj.get("type"))); - } - // validate the required field `type` - TypeEnum.validateJsonElement(jsonObj.get("type")); - if (!jsonObj.get("value").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `value` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("value").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!NexthopIPv4.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'NexthopIPv4' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(NexthopIPv4.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, NexthopIPv4 value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional 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 { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public NexthopIPv4 read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - NexthopIPv4 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( - java.util.Locale.ROOT, - "The field `%s` has unknown primitive type. Value: %s", - entry.getKey(), - entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - }.nullSafe(); - } - } - - /** - * Create an instance of NexthopIPv4 given an JSON string - * - * @param jsonString JSON string - * @return An instance of NexthopIPv4 - * @throws IOException if the JSON string is invalid with respect to NexthopIPv4 - */ - public static NexthopIPv4 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, NexthopIPv4.class); - } - - /** - * Convert an instance of NexthopIPv4 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/NexthopIPv6.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/NexthopIPv6.java deleted file mode 100644 index bff04dc9..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/NexthopIPv6.java +++ /dev/null @@ -1,400 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.model; - -import cloud.stackit.sdk.iaas.v2alpha1api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** Object that represents an IPv6 address. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class NexthopIPv6 { - /** Gets or Sets type */ - @JsonAdapter(TypeEnum.Adapter.class) - public enum TypeEnum { - IPV6("ipv6"), - - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static TypeEnum fromValue(String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public TypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return TypeEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - TypeEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_TYPE = "type"; - - @SerializedName(SERIALIZED_NAME_TYPE) - @javax.annotation.Nonnull - private TypeEnum type; - - public static final String SERIALIZED_NAME_VALUE = "value"; - - @SerializedName(SERIALIZED_NAME_VALUE) - @javax.annotation.Nonnull - private String value; - - public NexthopIPv6() {} - - public NexthopIPv6 type(@javax.annotation.Nonnull TypeEnum type) { - this.type = type; - return this; - } - - /** - * Get type - * - * @return type - */ - @javax.annotation.Nonnull - public TypeEnum getType() { - return type; - } - - public void setType(@javax.annotation.Nonnull TypeEnum type) { - this.type = type; - } - - public NexthopIPv6 value(@javax.annotation.Nonnull String value) { - this.value = value; - return this; - } - - /** - * An IPv6 address. - * - * @return value - */ - @javax.annotation.Nonnull - public String getValue() { - return value; - } - - public void setValue(@javax.annotation.Nonnull String value) { - this.value = value; - } - - /** - * 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. - * - * @param key name of the property - * @param value value of the property - * @return the NexthopIPv6 instance itself - */ - public NexthopIPv6 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. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - 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; - } - NexthopIPv6 nexthopIPv6 = (NexthopIPv6) o; - return Objects.equals(this.type, nexthopIPv6.type) - && Objects.equals(this.value, nexthopIPv6.value) - && Objects.equals(this.additionalProperties, nexthopIPv6.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(type, value, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class NexthopIPv6 {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).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(Arrays.asList("type", "value")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("type", "value")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to NexthopIPv6 - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!NexthopIPv6.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field(s) %s in NexthopIPv6 is not found in the empty JSON string", - NexthopIPv6.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : NexthopIPv6.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field `%s` is not found in the JSON string: %s", - requiredField, - jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `type` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("type").toString())); - } - // OVERRIDE: this if block fixes oneOf issues - if (!"ipv6".equals(jsonObj.get("type").getAsString())) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expectd the field `type` to have value `ipv6` but got `%s`", - jsonObj.get("type"))); - } - // validate the required field `type` - TypeEnum.validateJsonElement(jsonObj.get("type")); - if (!jsonObj.get("value").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `value` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("value").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!NexthopIPv6.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'NexthopIPv6' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(NexthopIPv6.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, NexthopIPv6 value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional 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 { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public NexthopIPv6 read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - NexthopIPv6 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( - java.util.Locale.ROOT, - "The field `%s` has unknown primitive type. Value: %s", - entry.getKey(), - entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - }.nullSafe(); - } - } - - /** - * Create an instance of NexthopIPv6 given an JSON string - * - * @param jsonString JSON string - * @return An instance of NexthopIPv6 - * @throws IOException if the JSON string is invalid with respect to NexthopIPv6 - */ - public static NexthopIPv6 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, NexthopIPv6.class); - } - - /** - * Convert an instance of NexthopIPv6 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/NexthopInternet.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/NexthopInternet.java deleted file mode 100644 index e45e2d52..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/NexthopInternet.java +++ /dev/null @@ -1,367 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.model; - -import cloud.stackit.sdk.iaas.v2alpha1api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** Object that represents a route to the internet. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class NexthopInternet { - /** Gets or Sets type */ - @JsonAdapter(TypeEnum.Adapter.class) - public enum TypeEnum { - INTERNET("internet"), - - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static TypeEnum fromValue(String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public TypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return TypeEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - TypeEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_TYPE = "type"; - - @SerializedName(SERIALIZED_NAME_TYPE) - @javax.annotation.Nonnull - private TypeEnum type; - - public NexthopInternet() {} - - public NexthopInternet type(@javax.annotation.Nonnull TypeEnum type) { - this.type = type; - return this; - } - - /** - * Get type - * - * @return type - */ - @javax.annotation.Nonnull - public TypeEnum getType() { - return type; - } - - public void setType(@javax.annotation.Nonnull TypeEnum type) { - this.type = type; - } - - /** - * 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. - * - * @param key name of the property - * @param value value of the property - * @return the NexthopInternet instance itself - */ - public NexthopInternet 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. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - 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; - } - NexthopInternet nexthopInternet = (NexthopInternet) o; - return Objects.equals(this.type, nexthopInternet.type) - && Objects.equals(this.additionalProperties, nexthopInternet.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(type, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class NexthopInternet {\n"); - sb.append(" type: ").append(toIndentedString(type)).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(Arrays.asList("type")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("type")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to NexthopInternet - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!NexthopInternet.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field(s) %s in NexthopInternet is not found in the empty JSON string", - NexthopInternet.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : NexthopInternet.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field `%s` is not found in the JSON string: %s", - requiredField, - jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `type` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("type").toString())); - } - // OVERRIDE: this if block fixes oneOf issues - if (!"internet".equals(jsonObj.get("type").getAsString())) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expectd the field `type` to have value `internet` but got `%s`", - jsonObj.get("type"))); - } - // validate the required field `type` - TypeEnum.validateJsonElement(jsonObj.get("type")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!NexthopInternet.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'NexthopInternet' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(NexthopInternet.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, NexthopInternet value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional 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 { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public NexthopInternet read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - NexthopInternet 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( - java.util.Locale.ROOT, - "The field `%s` has unknown primitive type. Value: %s", - entry.getKey(), - entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - }.nullSafe(); - } - } - - /** - * Create an instance of NexthopInternet given an JSON string - * - * @param jsonString JSON string - * @return An instance of NexthopInternet - * @throws IOException if the JSON string is invalid with respect to NexthopInternet - */ - public static NexthopInternet fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, NexthopInternet.class); - } - - /** - * Convert an instance of NexthopInternet to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/PartialUpdateNetworkPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/PartialUpdateNetworkPayload.java deleted file mode 100644 index 3ad5ab20..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/PartialUpdateNetworkPayload.java +++ /dev/null @@ -1,531 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.model; - -import cloud.stackit.sdk.iaas.v2alpha1api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.UUID; - -/** Object that represents the request body for a network update. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class PartialUpdateNetworkPayload { - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - @javax.annotation.Nullable private String description; - - public static final String SERIALIZED_NAME_DHCP = "dhcp"; - - @SerializedName(SERIALIZED_NAME_DHCP) - @javax.annotation.Nullable private Boolean dhcp; - - public static final String SERIALIZED_NAME_IPV4 = "ipv4"; - - @SerializedName(SERIALIZED_NAME_IPV4) - @javax.annotation.Nullable private UpdateNetworkIPv4Body ipv4; - - public static final String SERIALIZED_NAME_IPV6 = "ipv6"; - - @SerializedName(SERIALIZED_NAME_IPV6) - @javax.annotation.Nullable private UpdateNetworkIPv6Body ipv6; - - public static final String SERIALIZED_NAME_LABELS = "labels"; - - @SerializedName(SERIALIZED_NAME_LABELS) - @javax.annotation.Nullable private Object labels; - - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - @javax.annotation.Nullable private String name; - - public static final String SERIALIZED_NAME_ROUTED = "routed"; - - @SerializedName(SERIALIZED_NAME_ROUTED) - @javax.annotation.Nullable private Boolean routed; - - public static final String SERIALIZED_NAME_ROUTING_TABLE_ID = "routingTableId"; - - @SerializedName(SERIALIZED_NAME_ROUTING_TABLE_ID) - @javax.annotation.Nullable private UUID routingTableId; - - public PartialUpdateNetworkPayload() {} - - public PartialUpdateNetworkPayload description(@javax.annotation.Nullable String description) { - this.description = description; - return this; - } - - /** - * Description Object. Allows string up to 255 Characters. - * - * @return description - */ - @javax.annotation.Nullable public String getDescription() { - return description; - } - - public void setDescription(@javax.annotation.Nullable String description) { - this.description = description; - } - - public PartialUpdateNetworkPayload dhcp(@javax.annotation.Nullable Boolean dhcp) { - this.dhcp = dhcp; - return this; - } - - /** - * Enable or disable DHCP for a network. - * - * @return dhcp - */ - @javax.annotation.Nullable public Boolean getDhcp() { - return dhcp; - } - - public void setDhcp(@javax.annotation.Nullable Boolean dhcp) { - this.dhcp = dhcp; - } - - public PartialUpdateNetworkPayload ipv4(@javax.annotation.Nullable UpdateNetworkIPv4Body ipv4) { - this.ipv4 = ipv4; - return this; - } - - /** - * Get ipv4 - * - * @return ipv4 - */ - @javax.annotation.Nullable public UpdateNetworkIPv4Body getIpv4() { - return ipv4; - } - - public void setIpv4(@javax.annotation.Nullable UpdateNetworkIPv4Body ipv4) { - this.ipv4 = ipv4; - } - - public PartialUpdateNetworkPayload ipv6(@javax.annotation.Nullable UpdateNetworkIPv6Body ipv6) { - this.ipv6 = ipv6; - return this; - } - - /** - * Get ipv6 - * - * @return ipv6 - */ - @javax.annotation.Nullable public UpdateNetworkIPv6Body getIpv6() { - return ipv6; - } - - public void setIpv6(@javax.annotation.Nullable UpdateNetworkIPv6Body ipv6) { - this.ipv6 = ipv6; - } - - public PartialUpdateNetworkPayload labels(@javax.annotation.Nullable Object labels) { - this.labels = labels; - return this; - } - - /** - * Object that represents the labels as key-value pairs of a resource. Key constraints: - May - * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must - * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain - * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), - * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 - * and 63 characters. - Must begin and end with an alphanumerical character - * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), - * dots (`.`), and alphanumerics in between. - Keys starting with the prefix - * `stackit-` or having a domain prefix of `stackit.cloud` (including its - * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value - * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not - * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May - * contain dashes (`-`), underscores (`_`), dots (`.`), and - * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are - * excluded from this count. Providing a `null` value for a key will remove that key. - * - * @return labels - */ - @javax.annotation.Nullable public Object getLabels() { - return labels; - } - - public void setLabels(@javax.annotation.Nullable Object labels) { - this.labels = labels; - } - - public PartialUpdateNetworkPayload name(@javax.annotation.Nullable String name) { - this.name = name; - return this; - } - - /** - * The name for a General Object. Matches Names and also UUIDs. - * - * @return name - */ - @javax.annotation.Nullable public String getName() { - return name; - } - - public void setName(@javax.annotation.Nullable String name) { - this.name = name; - } - - public PartialUpdateNetworkPayload routed(@javax.annotation.Nullable Boolean routed) { - this.routed = routed; - return this; - } - - /** - * Shows if the network is routed and therefore accessible from other networks. - * - * @return routed - */ - @javax.annotation.Nullable public Boolean getRouted() { - return routed; - } - - public void setRouted(@javax.annotation.Nullable Boolean routed) { - this.routed = routed; - } - - public PartialUpdateNetworkPayload routingTableId( - @javax.annotation.Nullable UUID routingTableId) { - this.routingTableId = routingTableId; - return this; - } - - /** - * Universally Unique Identifier (UUID). - * - * @return routingTableId - */ - @javax.annotation.Nullable public UUID getRoutingTableId() { - return routingTableId; - } - - public void setRoutingTableId(@javax.annotation.Nullable UUID routingTableId) { - this.routingTableId = routingTableId; - } - - /** - * 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. - * - * @param key name of the property - * @param value value of the property - * @return the PartialUpdateNetworkPayload instance itself - */ - public PartialUpdateNetworkPayload 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. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - 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; - } - PartialUpdateNetworkPayload partialUpdateNetworkPayload = (PartialUpdateNetworkPayload) o; - return Objects.equals(this.description, partialUpdateNetworkPayload.description) - && Objects.equals(this.dhcp, partialUpdateNetworkPayload.dhcp) - && Objects.equals(this.ipv4, partialUpdateNetworkPayload.ipv4) - && Objects.equals(this.ipv6, partialUpdateNetworkPayload.ipv6) - && Objects.equals(this.labels, partialUpdateNetworkPayload.labels) - && Objects.equals(this.name, partialUpdateNetworkPayload.name) - && Objects.equals(this.routed, partialUpdateNetworkPayload.routed) - && Objects.equals(this.routingTableId, partialUpdateNetworkPayload.routingTableId) - && Objects.equals( - this.additionalProperties, - partialUpdateNetworkPayload.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash( - description, - dhcp, - ipv4, - ipv6, - labels, - name, - routed, - routingTableId, - additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class PartialUpdateNetworkPayload {\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" dhcp: ").append(toIndentedString(dhcp)).append("\n"); - sb.append(" ipv4: ").append(toIndentedString(ipv4)).append("\n"); - sb.append(" ipv6: ").append(toIndentedString(ipv6)).append("\n"); - sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" routed: ").append(toIndentedString(routed)).append("\n"); - sb.append(" routingTableId: ").append(toIndentedString(routingTableId)).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( - Arrays.asList( - "description", - "dhcp", - "ipv4", - "ipv6", - "labels", - "name", - "routed", - "routingTableId")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(0); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * PartialUpdateNetworkPayload - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!PartialUpdateNetworkPayload.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field(s) %s in PartialUpdateNetworkPayload is not found in the empty JSON string", - PartialUpdateNetworkPayload.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) - && !jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `description` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("description").toString())); - } - // validate the optional field `ipv4` - if (jsonObj.get("ipv4") != null && !jsonObj.get("ipv4").isJsonNull()) { - UpdateNetworkIPv4Body.validateJsonElement(jsonObj.get("ipv4")); - } - // validate the optional field `ipv6` - if (jsonObj.get("ipv6") != null && !jsonObj.get("ipv6").isJsonNull()) { - UpdateNetworkIPv6Body.validateJsonElement(jsonObj.get("ipv6")); - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) - && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `name` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("name").toString())); - } - if ((jsonObj.get("routingTableId") != null && !jsonObj.get("routingTableId").isJsonNull()) - && !jsonObj.get("routingTableId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `routingTableId` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("routingTableId").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!PartialUpdateNetworkPayload.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'PartialUpdateNetworkPayload' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(PartialUpdateNetworkPayload.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, PartialUpdateNetworkPayload value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional 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 { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public PartialUpdateNetworkPayload read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - PartialUpdateNetworkPayload 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( - java.util.Locale.ROOT, - "The field `%s` has unknown primitive type. Value: %s", - entry.getKey(), - entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - }.nullSafe(); - } - } - - /** - * Create an instance of PartialUpdateNetworkPayload given an JSON string - * - * @param jsonString JSON string - * @return An instance of PartialUpdateNetworkPayload - * @throws IOException if the JSON string is invalid with respect to PartialUpdateNetworkPayload - */ - public static PartialUpdateNetworkPayload fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, PartialUpdateNetworkPayload.class); - } - - /** - * Convert an instance of PartialUpdateNetworkPayload to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/PartialUpdateVPCPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/PartialUpdateVPCPayload.java deleted file mode 100644 index 79379a6b..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/PartialUpdateVPCPayload.java +++ /dev/null @@ -1,366 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.model; - -import cloud.stackit.sdk.iaas.v2alpha1api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** Object that represents a update VPC request. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class PartialUpdateVPCPayload { - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - @javax.annotation.Nullable private String description; - - public static final String SERIALIZED_NAME_LABELS = "labels"; - - @SerializedName(SERIALIZED_NAME_LABELS) - @javax.annotation.Nullable private Object labels; - - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - @javax.annotation.Nullable private String name; - - public PartialUpdateVPCPayload() {} - - public PartialUpdateVPCPayload description(@javax.annotation.Nullable String description) { - this.description = description; - return this; - } - - /** - * Description Object. Allows string up to 255 Characters. - * - * @return description - */ - @javax.annotation.Nullable public String getDescription() { - return description; - } - - public void setDescription(@javax.annotation.Nullable String description) { - this.description = description; - } - - public PartialUpdateVPCPayload labels(@javax.annotation.Nullable Object labels) { - this.labels = labels; - return this; - } - - /** - * Object that represents the labels as key-value pairs of a resource. Key constraints: - May - * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must - * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain - * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), - * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 - * and 63 characters. - Must begin and end with an alphanumerical character - * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), - * dots (`.`), and alphanumerics in between. - Keys starting with the prefix - * `stackit-` or having a domain prefix of `stackit.cloud` (including its - * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value - * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not - * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May - * contain dashes (`-`), underscores (`_`), dots (`.`), and - * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are - * excluded from this count. Providing a `null` value for a key will remove that key. - * - * @return labels - */ - @javax.annotation.Nullable public Object getLabels() { - return labels; - } - - public void setLabels(@javax.annotation.Nullable Object labels) { - this.labels = labels; - } - - public PartialUpdateVPCPayload name(@javax.annotation.Nullable String name) { - this.name = name; - return this; - } - - /** - * The name for a General Object. Matches Names and also UUIDs. - * - * @return name - */ - @javax.annotation.Nullable public String getName() { - return name; - } - - public void setName(@javax.annotation.Nullable 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. - * - * @param key name of the property - * @param value value of the property - * @return the PartialUpdateVPCPayload instance itself - */ - public PartialUpdateVPCPayload 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. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - 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; - } - PartialUpdateVPCPayload partialUpdateVPCPayload = (PartialUpdateVPCPayload) o; - return Objects.equals(this.description, partialUpdateVPCPayload.description) - && Objects.equals(this.labels, partialUpdateVPCPayload.labels) - && Objects.equals(this.name, partialUpdateVPCPayload.name) - && Objects.equals( - this.additionalProperties, partialUpdateVPCPayload.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(description, labels, name, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class PartialUpdateVPCPayload {\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" labels: ").append(toIndentedString(labels)).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(Arrays.asList("description", "labels", "name")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(0); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to PartialUpdateVPCPayload - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!PartialUpdateVPCPayload.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field(s) %s in PartialUpdateVPCPayload is not found in the empty JSON string", - PartialUpdateVPCPayload.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) - && !jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `description` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("description").toString())); - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) - && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "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 (!PartialUpdateVPCPayload.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'PartialUpdateVPCPayload' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(PartialUpdateVPCPayload.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, PartialUpdateVPCPayload value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional 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 { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public PartialUpdateVPCPayload read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - PartialUpdateVPCPayload 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( - java.util.Locale.ROOT, - "The field `%s` has unknown primitive type. Value: %s", - entry.getKey(), - entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - }.nullSafe(); - } - } - - /** - * Create an instance of PartialUpdateVPCPayload given an JSON string - * - * @param jsonString JSON string - * @return An instance of PartialUpdateVPCPayload - * @throws IOException if the JSON string is invalid with respect to PartialUpdateVPCPayload - */ - public static PartialUpdateVPCPayload fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, PartialUpdateVPCPayload.class); - } - - /** - * Convert an instance of PartialUpdateVPCPayload to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/PrefixEntries.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/PrefixEntries.java deleted file mode 100644 index 339809ed..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/PrefixEntries.java +++ /dev/null @@ -1,317 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.model; - -import cloud.stackit.sdk.iaas.v2alpha1api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** Object containing all CIDR entries of a prefix list. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class PrefixEntries { - public static final String SERIALIZED_NAME_ENTRIES = "entries"; - - @SerializedName(SERIALIZED_NAME_ENTRIES) - @javax.annotation.Nonnull - private List entries = new ArrayList<>(); - - public PrefixEntries() {} - - public PrefixEntries entries(@javax.annotation.Nonnull List entries) { - this.entries = entries; - return this; - } - - public PrefixEntries addEntriesItem(String entriesItem) { - if (this.entries == null) { - this.entries = new ArrayList<>(); - } - this.entries.add(entriesItem); - return this; - } - - /** - * List of CIDR blocks in the prefix list. - * - * @return entries - */ - @javax.annotation.Nonnull - public List getEntries() { - return entries; - } - - public void setEntries(@javax.annotation.Nonnull List entries) { - this.entries = entries; - } - - /** - * 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. - * - * @param key name of the property - * @param value value of the property - * @return the PrefixEntries instance itself - */ - public PrefixEntries 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. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - 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; - } - PrefixEntries prefixEntries = (PrefixEntries) o; - return Objects.equals(this.entries, prefixEntries.entries) - && Objects.equals(this.additionalProperties, prefixEntries.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(entries, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class PrefixEntries {\n"); - sb.append(" entries: ").append(toIndentedString(entries)).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(Arrays.asList("entries")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("entries")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to PrefixEntries - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!PrefixEntries.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field(s) %s in PrefixEntries is not found in the empty JSON string", - PrefixEntries.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : PrefixEntries.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field `%s` is not found in the JSON string: %s", - requiredField, - jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the required json array is present - if (jsonObj.get("entries") == null) { - throw new IllegalArgumentException( - "Expected the field `linkedContent` to be an array in the JSON string but got `null`"); - } else if (!jsonObj.get("entries").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `entries` to be an array in the JSON string but got `%s`", - jsonObj.get("entries").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!PrefixEntries.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'PrefixEntries' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(PrefixEntries.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, PrefixEntries value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional 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 { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public PrefixEntries read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - PrefixEntries 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( - java.util.Locale.ROOT, - "The field `%s` has unknown primitive type. Value: %s", - entry.getKey(), - entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - }.nullSafe(); - } - } - - /** - * Create an instance of PrefixEntries given an JSON string - * - * @param jsonString JSON string - * @return An instance of PrefixEntries - * @throws IOException if the JSON string is invalid with respect to PrefixEntries - */ - public static PrefixEntries fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, PrefixEntries.class); - } - - /** - * Convert an instance of PrefixEntries to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/PrefixList.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/PrefixList.java deleted file mode 100644 index b62b30a5..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/PrefixList.java +++ /dev/null @@ -1,597 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.model; - -import cloud.stackit.sdk.iaas.v2alpha1api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.UUID; - -/** Object that represents a prefix list. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class PrefixList { - public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; - - @SerializedName(SERIALIZED_NAME_CREATED_AT) - @javax.annotation.Nullable private OffsetDateTime createdAt; - - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - @javax.annotation.Nullable private String description; - - public static final String SERIALIZED_NAME_ENTRIES = "entries"; - - @SerializedName(SERIALIZED_NAME_ENTRIES) - @javax.annotation.Nullable private List entries = new ArrayList<>(); - - public static final String SERIALIZED_NAME_ETHERTYPE = "ethertype"; - - @SerializedName(SERIALIZED_NAME_ETHERTYPE) - @javax.annotation.Nonnull - private String ethertype; - - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - @javax.annotation.Nullable private UUID id; - - public static final String SERIALIZED_NAME_LABELS = "labels"; - - @SerializedName(SERIALIZED_NAME_LABELS) - @javax.annotation.Nullable private Object labels; - - public static final String SERIALIZED_NAME_MAX_ENTRIES = "maxEntries"; - - @SerializedName(SERIALIZED_NAME_MAX_ENTRIES) - @javax.annotation.Nonnull - private Long maxEntries; - - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - @javax.annotation.Nonnull - private String name; - - public static final String SERIALIZED_NAME_TYPE = "type"; - - @SerializedName(SERIALIZED_NAME_TYPE) - @javax.annotation.Nullable private String type = "custom"; - - public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; - - @SerializedName(SERIALIZED_NAME_UPDATED_AT) - @javax.annotation.Nullable private OffsetDateTime updatedAt; - - public PrefixList() {} - - public PrefixList(OffsetDateTime createdAt, UUID id, String type, OffsetDateTime updatedAt) { - this(); - this.createdAt = createdAt; - this.id = id; - this.type = type; - this.updatedAt = updatedAt; - } - - /** - * Date-time when resource was created. - * - * @return createdAt - */ - @javax.annotation.Nullable public OffsetDateTime getCreatedAt() { - return createdAt; - } - - public PrefixList description(@javax.annotation.Nullable String description) { - this.description = description; - return this; - } - - /** - * Description Object. Allows string up to 255 Characters. - * - * @return description - */ - @javax.annotation.Nullable public String getDescription() { - return description; - } - - public void setDescription(@javax.annotation.Nullable String description) { - this.description = description; - } - - public PrefixList entries(@javax.annotation.Nullable List entries) { - this.entries = entries; - return this; - } - - public PrefixList addEntriesItem(String entriesItem) { - if (this.entries == null) { - this.entries = new ArrayList<>(); - } - this.entries.add(entriesItem); - return this; - } - - /** - * The list of CIDR blocks contained in this prefix list. - * - * @return entries - */ - @javax.annotation.Nullable public List getEntries() { - return entries; - } - - public void setEntries(@javax.annotation.Nullable List entries) { - this.entries = entries; - } - - public PrefixList ethertype(@javax.annotation.Nonnull String ethertype) { - this.ethertype = ethertype; - return this; - } - - /** - * The IP version of this prefix list. Possible values: `ipv4`, `ipv6`. - * - * @return ethertype - */ - @javax.annotation.Nonnull - public String getEthertype() { - return ethertype; - } - - public void setEthertype(@javax.annotation.Nonnull String ethertype) { - this.ethertype = ethertype; - } - - /** - * Universally Unique Identifier (UUID). - * - * @return id - */ - @javax.annotation.Nullable public UUID getId() { - return id; - } - - public PrefixList labels(@javax.annotation.Nullable Object labels) { - this.labels = labels; - return this; - } - - /** - * Object that represents the labels as key-value pairs of a resource. Key constraints: - May - * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must - * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain - * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), - * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 - * and 63 characters. - Must begin and end with an alphanumerical character - * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), - * dots (`.`), and alphanumerics in between. - Keys starting with the prefix - * `stackit-` or having a domain prefix of `stackit.cloud` (including its - * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value - * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not - * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May - * contain dashes (`-`), underscores (`_`), dots (`.`), and - * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are - * excluded from this count. Providing a `null` value for a key will remove that key. - * - * @return labels - */ - @javax.annotation.Nullable public Object getLabels() { - return labels; - } - - public void setLabels(@javax.annotation.Nullable Object labels) { - this.labels = labels; - } - - public PrefixList maxEntries(@javax.annotation.Nonnull Long maxEntries) { - this.maxEntries = maxEntries; - return this; - } - - /** - * Maximum number of entries this prefix list can hold. minimum: 1 maximum: 65535 - * - * @return maxEntries - */ - @javax.annotation.Nonnull - public Long getMaxEntries() { - return maxEntries; - } - - public void setMaxEntries(@javax.annotation.Nonnull Long maxEntries) { - this.maxEntries = maxEntries; - } - - public PrefixList name(@javax.annotation.Nonnull String name) { - this.name = name; - return this; - } - - /** - * The name for a General Object. Matches Names and also UUIDs. - * - * @return name - */ - @javax.annotation.Nonnull - public String getName() { - return name; - } - - public void setName(@javax.annotation.Nonnull String name) { - this.name = name; - } - - /** - * Indicates the type of prefix list. Managed prefix lists are created by the provider and - * cannot be modified or deleted by users. Possible values: `custom`, - * `managed`. - * - * @return type - */ - @javax.annotation.Nullable public String getType() { - return type; - } - - /** - * Date-time when resource was last updated. - * - * @return updatedAt - */ - @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { - return updatedAt; - } - - /** - * 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. - * - * @param key name of the property - * @param value value of the property - * @return the PrefixList instance itself - */ - public PrefixList 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. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - 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; - } - PrefixList prefixList = (PrefixList) o; - return Objects.equals(this.createdAt, prefixList.createdAt) - && Objects.equals(this.description, prefixList.description) - && Objects.equals(this.entries, prefixList.entries) - && Objects.equals(this.ethertype, prefixList.ethertype) - && Objects.equals(this.id, prefixList.id) - && Objects.equals(this.labels, prefixList.labels) - && Objects.equals(this.maxEntries, prefixList.maxEntries) - && Objects.equals(this.name, prefixList.name) - && Objects.equals(this.type, prefixList.type) - && Objects.equals(this.updatedAt, prefixList.updatedAt) - && Objects.equals(this.additionalProperties, prefixList.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash( - createdAt, - description, - entries, - ethertype, - id, - labels, - maxEntries, - name, - type, - updatedAt, - additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class PrefixList {\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" entries: ").append(toIndentedString(entries)).append("\n"); - sb.append(" ethertype: ").append(toIndentedString(ethertype)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); - sb.append(" maxEntries: ").append(toIndentedString(maxEntries)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).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( - Arrays.asList( - "createdAt", - "description", - "entries", - "ethertype", - "id", - "labels", - "maxEntries", - "name", - "type", - "updatedAt")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = - new HashSet(Arrays.asList("ethertype", "maxEntries", "name")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to PrefixList - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!PrefixList.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field(s) %s in PrefixList is not found in the empty JSON string", - PrefixList.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : PrefixList.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field `%s` is not found in the JSON string: %s", - requiredField, - jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) - && !jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `description` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("description").toString())); - } - // ensure the optional json data is an array if present - if (jsonObj.get("entries") != null - && !jsonObj.get("entries").isJsonNull() - && !jsonObj.get("entries").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `entries` to be an array in the JSON string but got `%s`", - jsonObj.get("entries").toString())); - } - if (!jsonObj.get("ethertype").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `ethertype` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("ethertype").toString())); - } - if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) - && !jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `id` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("id").toString())); - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `name` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("name").toString())); - } - if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) - && !jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `type` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("type").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!PrefixList.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'PrefixList' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(PrefixList.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, PrefixList value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional 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 { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public PrefixList read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - PrefixList 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( - java.util.Locale.ROOT, - "The field `%s` has unknown primitive type. Value: %s", - entry.getKey(), - entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - }.nullSafe(); - } - } - - /** - * Create an instance of PrefixList given an JSON string - * - * @param jsonString JSON string - * @return An instance of PrefixList - * @throws IOException if the JSON string is invalid with respect to PrefixList - */ - public static PrefixList fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, PrefixList.class); - } - - /** - * Convert an instance of PrefixList to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/PrefixListListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/PrefixListListResponse.java deleted file mode 100644 index 44649669..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/PrefixListListResponse.java +++ /dev/null @@ -1,324 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.model; - -import cloud.stackit.sdk.iaas.v2alpha1api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** Prefix list response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class PrefixListListResponse { - public static final String SERIALIZED_NAME_ITEMS = "items"; - - @SerializedName(SERIALIZED_NAME_ITEMS) - @javax.annotation.Nonnull - private List items = new ArrayList<>(); - - public PrefixListListResponse() {} - - public PrefixListListResponse items(@javax.annotation.Nonnull List items) { - this.items = items; - return this; - } - - public PrefixListListResponse addItemsItem(PrefixList itemsItem) { - if (this.items == null) { - this.items = new ArrayList<>(); - } - this.items.add(itemsItem); - return this; - } - - /** - * A list of prefix lists. - * - * @return items - */ - @javax.annotation.Nonnull - public List getItems() { - return items; - } - - public void setItems(@javax.annotation.Nonnull List items) { - this.items = items; - } - - /** - * 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. - * - * @param key name of the property - * @param value value of the property - * @return the PrefixListListResponse instance itself - */ - public PrefixListListResponse 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. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - 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; - } - PrefixListListResponse prefixListListResponse = (PrefixListListResponse) o; - return Objects.equals(this.items, prefixListListResponse.items) - && Objects.equals( - this.additionalProperties, prefixListListResponse.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(items, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class PrefixListListResponse {\n"); - sb.append(" items: ").append(toIndentedString(items)).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(Arrays.asList("items")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("items")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to PrefixListListResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!PrefixListListResponse.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field(s) %s in PrefixListListResponse is not found in the empty JSON string", - PrefixListListResponse.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : PrefixListListResponse.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field `%s` is not found in the JSON string: %s", - requiredField, - jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - PrefixList.validateJsonElement(jsonArrayitems.get(i)); - } - ; - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!PrefixListListResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'PrefixListListResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(PrefixListListResponse.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, PrefixListListResponse value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional 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 { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public PrefixListListResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - PrefixListListResponse 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( - java.util.Locale.ROOT, - "The field `%s` has unknown primitive type. Value: %s", - entry.getKey(), - entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - }.nullSafe(); - } - } - - /** - * Create an instance of PrefixListListResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of PrefixListListResponse - * @throws IOException if the JSON string is invalid with respect to PrefixListListResponse - */ - public static PrefixListListResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, PrefixListListResponse.class); - } - - /** - * Convert an instance of PrefixListListResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/RegionalVPC.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/RegionalVPC.java deleted file mode 100644 index 26554048..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/RegionalVPC.java +++ /dev/null @@ -1,318 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.model; - -import cloud.stackit.sdk.iaas.v2alpha1api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** The basic properties of a regional VPC. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class RegionalVPC { - public static final String SERIALIZED_NAME_IPV4 = "ipv4"; - - @SerializedName(SERIALIZED_NAME_IPV4) - @javax.annotation.Nullable private RegionalVPCIPv4 ipv4; - - public static final String SERIALIZED_NAME_STATUS = "status"; - - @SerializedName(SERIALIZED_NAME_STATUS) - @javax.annotation.Nullable private String status; - - public RegionalVPC() {} - - public RegionalVPC(String status) { - this(); - this.status = status; - } - - public RegionalVPC ipv4(@javax.annotation.Nullable RegionalVPCIPv4 ipv4) { - this.ipv4 = ipv4; - return this; - } - - /** - * Get ipv4 - * - * @return ipv4 - */ - @javax.annotation.Nullable public RegionalVPCIPv4 getIpv4() { - return ipv4; - } - - public void setIpv4(@javax.annotation.Nullable RegionalVPCIPv4 ipv4) { - this.ipv4 = ipv4; - } - - /** - * The state of a resource object. Possible values: `CREATING`, `CREATED`, - * `DELETING`, `DELETED`, `FAILED`, `UPDATED`, - * `UPDATING`. - * - * @return status - */ - @javax.annotation.Nullable public String getStatus() { - return status; - } - - /** - * 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. - * - * @param key name of the property - * @param value value of the property - * @return the RegionalVPC instance itself - */ - public RegionalVPC 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. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - 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; - } - RegionalVPC regionalVPC = (RegionalVPC) o; - return Objects.equals(this.ipv4, regionalVPC.ipv4) - && Objects.equals(this.status, regionalVPC.status) - && Objects.equals(this.additionalProperties, regionalVPC.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(ipv4, status, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class RegionalVPC {\n"); - sb.append(" ipv4: ").append(toIndentedString(ipv4)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).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(Arrays.asList("ipv4", "status")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(0); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to RegionalVPC - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!RegionalVPC.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field(s) %s in RegionalVPC is not found in the empty JSON string", - RegionalVPC.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `ipv4` - if (jsonObj.get("ipv4") != null && !jsonObj.get("ipv4").isJsonNull()) { - RegionalVPCIPv4.validateJsonElement(jsonObj.get("ipv4")); - } - if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) - && !jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `status` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("status").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!RegionalVPC.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'RegionalVPC' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(RegionalVPC.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, RegionalVPC value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional 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 { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public RegionalVPC read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - RegionalVPC 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( - java.util.Locale.ROOT, - "The field `%s` has unknown primitive type. Value: %s", - entry.getKey(), - entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - }.nullSafe(); - } - } - - /** - * Create an instance of RegionalVPC given an JSON string - * - * @param jsonString JSON string - * @return An instance of RegionalVPC - * @throws IOException if the JSON string is invalid with respect to RegionalVPC - */ - public static RegionalVPC fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, RegionalVPC.class); - } - - /** - * Convert an instance of RegionalVPC to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/RegionalVPCIPv4.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/RegionalVPCIPv4.java deleted file mode 100644 index 4890fd02..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/RegionalVPCIPv4.java +++ /dev/null @@ -1,321 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.model; - -import cloud.stackit.sdk.iaas.v2alpha1api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** The regional IPv4 config of a VPC. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class RegionalVPCIPv4 { - public static final String SERIALIZED_NAME_DEFAULT_NAMESERVERS = "defaultNameservers"; - - @SerializedName(SERIALIZED_NAME_DEFAULT_NAMESERVERS) - @javax.annotation.Nonnull - private List defaultNameservers = new ArrayList<>(); - - public RegionalVPCIPv4() {} - - public RegionalVPCIPv4 defaultNameservers( - @javax.annotation.Nonnull List defaultNameservers) { - this.defaultNameservers = defaultNameservers; - return this; - } - - public RegionalVPCIPv4 addDefaultNameserversItem(String defaultNameserversItem) { - if (this.defaultNameservers == null) { - this.defaultNameservers = new ArrayList<>(); - } - this.defaultNameservers.add(defaultNameserversItem); - return this; - } - - /** - * Get defaultNameservers - * - * @return defaultNameservers - */ - @javax.annotation.Nonnull - public List getDefaultNameservers() { - return defaultNameservers; - } - - public void setDefaultNameservers(@javax.annotation.Nonnull List defaultNameservers) { - this.defaultNameservers = defaultNameservers; - } - - /** - * 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. - * - * @param key name of the property - * @param value value of the property - * @return the RegionalVPCIPv4 instance itself - */ - public RegionalVPCIPv4 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. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - 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; - } - RegionalVPCIPv4 regionalVPCIPv4 = (RegionalVPCIPv4) o; - return Objects.equals(this.defaultNameservers, regionalVPCIPv4.defaultNameservers) - && Objects.equals(this.additionalProperties, regionalVPCIPv4.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(defaultNameservers, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class RegionalVPCIPv4 {\n"); - sb.append(" defaultNameservers: ") - .append(toIndentedString(defaultNameservers)) - .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(Arrays.asList("defaultNameservers")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("defaultNameservers")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to RegionalVPCIPv4 - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!RegionalVPCIPv4.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field(s) %s in RegionalVPCIPv4 is not found in the empty JSON string", - RegionalVPCIPv4.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : RegionalVPCIPv4.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field `%s` is not found in the JSON string: %s", - requiredField, - jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the required json array is present - if (jsonObj.get("defaultNameservers") == null) { - throw new IllegalArgumentException( - "Expected the field `linkedContent` to be an array in the JSON string but got `null`"); - } else if (!jsonObj.get("defaultNameservers").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `defaultNameservers` to be an array in the JSON string but got `%s`", - jsonObj.get("defaultNameservers").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!RegionalVPCIPv4.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'RegionalVPCIPv4' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(RegionalVPCIPv4.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, RegionalVPCIPv4 value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional 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 { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public RegionalVPCIPv4 read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - RegionalVPCIPv4 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( - java.util.Locale.ROOT, - "The field `%s` has unknown primitive type. Value: %s", - entry.getKey(), - entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - }.nullSafe(); - } - } - - /** - * Create an instance of RegionalVPCIPv4 given an JSON string - * - * @param jsonString JSON string - * @return An instance of RegionalVPCIPv4 - * @throws IOException if the JSON string is invalid with respect to RegionalVPCIPv4 - */ - public static RegionalVPCIPv4 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, RegionalVPCIPv4.class); - } - - /** - * Convert an instance of RegionalVPCIPv4 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/RegionalVPCList.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/RegionalVPCList.java deleted file mode 100644 index b4a6cb9e..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/RegionalVPCList.java +++ /dev/null @@ -1,306 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.model; - -import cloud.stackit.sdk.iaas.v2alpha1api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** Regional VPC list response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class RegionalVPCList { - public static final String SERIALIZED_NAME_REGIONS = "regions"; - - @SerializedName(SERIALIZED_NAME_REGIONS) - @javax.annotation.Nonnull - private Map regions = new HashMap<>(); - - public RegionalVPCList() {} - - public RegionalVPCList regions(@javax.annotation.Nonnull Map regions) { - this.regions = regions; - return this; - } - - public RegionalVPCList putRegionsItem(String key, RegionalVPC regionsItem) { - if (this.regions == null) { - this.regions = new HashMap<>(); - } - this.regions.put(key, regionsItem); - return this; - } - - /** - * Get regions - * - * @return regions - */ - @javax.annotation.Nonnull - public Map getRegions() { - return regions; - } - - public void setRegions(@javax.annotation.Nonnull Map regions) { - this.regions = regions; - } - - /** - * 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. - * - * @param key name of the property - * @param value value of the property - * @return the RegionalVPCList instance itself - */ - public RegionalVPCList 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. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - 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; - } - RegionalVPCList regionalVPCList = (RegionalVPCList) o; - return Objects.equals(this.regions, regionalVPCList.regions) - && Objects.equals(this.additionalProperties, regionalVPCList.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(regions, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class RegionalVPCList {\n"); - sb.append(" regions: ").append(toIndentedString(regions)).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(Arrays.asList("regions")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("regions")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to RegionalVPCList - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!RegionalVPCList.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field(s) %s in RegionalVPCList is not found in the empty JSON string", - RegionalVPCList.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : RegionalVPCList.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field `%s` is not found in the JSON string: %s", - requiredField, - jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!RegionalVPCList.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'RegionalVPCList' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(RegionalVPCList.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, RegionalVPCList value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional 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 { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public RegionalVPCList read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - RegionalVPCList 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( - java.util.Locale.ROOT, - "The field `%s` has unknown primitive type. Value: %s", - entry.getKey(), - entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - }.nullSafe(); - } - } - - /** - * Create an instance of RegionalVPCList given an JSON string - * - * @param jsonString JSON string - * @return An instance of RegionalVPCList - * @throws IOException if the JSON string is invalid with respect to RegionalVPCList - */ - public static RegionalVPCList fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, RegionalVPCList.class); - } - - /** - * Convert an instance of RegionalVPCList to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/RetypeVolumePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/RetypeVolumePayload.java deleted file mode 100644 index d23ef47d..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/RetypeVolumePayload.java +++ /dev/null @@ -1,306 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.model; - -import cloud.stackit.sdk.iaas.v2alpha1api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** RetypeVolumePayload */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class RetypeVolumePayload { - public static final String SERIALIZED_NAME_PERFORMANCE_CLASS = "performanceClass"; - - @SerializedName(SERIALIZED_NAME_PERFORMANCE_CLASS) - @javax.annotation.Nonnull - private String performanceClass; - - public RetypeVolumePayload() {} - - public RetypeVolumePayload performanceClass(@javax.annotation.Nonnull String performanceClass) { - this.performanceClass = performanceClass; - return this; - } - - /** - * The name for a General Object. Matches Names and also UUIDs. - * - * @return performanceClass - */ - @javax.annotation.Nonnull - public String getPerformanceClass() { - return performanceClass; - } - - public void setPerformanceClass(@javax.annotation.Nonnull String performanceClass) { - this.performanceClass = performanceClass; - } - - /** - * 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. - * - * @param key name of the property - * @param value value of the property - * @return the RetypeVolumePayload instance itself - */ - public RetypeVolumePayload 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. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - 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; - } - RetypeVolumePayload retypeVolumePayload = (RetypeVolumePayload) o; - return Objects.equals(this.performanceClass, retypeVolumePayload.performanceClass) - && Objects.equals( - this.additionalProperties, retypeVolumePayload.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(performanceClass, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class RetypeVolumePayload {\n"); - sb.append(" performanceClass: ").append(toIndentedString(performanceClass)).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(Arrays.asList("performanceClass")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("performanceClass")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to RetypeVolumePayload - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!RetypeVolumePayload.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field(s) %s in RetypeVolumePayload is not found in the empty JSON string", - RetypeVolumePayload.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : RetypeVolumePayload.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field `%s` is not found in the JSON string: %s", - requiredField, - jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("performanceClass").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `performanceClass` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("performanceClass").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!RetypeVolumePayload.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'RetypeVolumePayload' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(RetypeVolumePayload.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, RetypeVolumePayload value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional 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 { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public RetypeVolumePayload read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - RetypeVolumePayload 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( - java.util.Locale.ROOT, - "The field `%s` has unknown primitive type. Value: %s", - entry.getKey(), - entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - }.nullSafe(); - } - } - - /** - * Create an instance of RetypeVolumePayload given an JSON string - * - * @param jsonString JSON string - * @return An instance of RetypeVolumePayload - * @throws IOException if the JSON string is invalid with respect to RetypeVolumePayload - */ - public static RetypeVolumePayload fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, RetypeVolumePayload.class); - } - - /** - * Convert an instance of RetypeVolumePayload to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/Route.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/Route.java deleted file mode 100644 index 47da17c9..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/Route.java +++ /dev/null @@ -1,441 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.model; - -import cloud.stackit.sdk.iaas.v2alpha1api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.UUID; - -/** Object represents a network route. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class Route { - public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; - - @SerializedName(SERIALIZED_NAME_CREATED_AT) - @javax.annotation.Nullable private OffsetDateTime createdAt; - - public static final String SERIALIZED_NAME_DESTINATION = "destination"; - - @SerializedName(SERIALIZED_NAME_DESTINATION) - @javax.annotation.Nonnull - private RouteDestination destination; - - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - @javax.annotation.Nullable private UUID id; - - public static final String SERIALIZED_NAME_LABELS = "labels"; - - @SerializedName(SERIALIZED_NAME_LABELS) - @javax.annotation.Nullable private Object labels; - - public static final String SERIALIZED_NAME_NEXTHOP = "nexthop"; - - @SerializedName(SERIALIZED_NAME_NEXTHOP) - @javax.annotation.Nonnull - private RouteNexthop nexthop; - - public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; - - @SerializedName(SERIALIZED_NAME_UPDATED_AT) - @javax.annotation.Nullable private OffsetDateTime updatedAt; - - public Route() {} - - public Route(OffsetDateTime createdAt, UUID id, OffsetDateTime updatedAt) { - this(); - this.createdAt = createdAt; - this.id = id; - this.updatedAt = updatedAt; - } - - /** - * Date-time when resource was created. - * - * @return createdAt - */ - @javax.annotation.Nullable public OffsetDateTime getCreatedAt() { - return createdAt; - } - - public Route destination(@javax.annotation.Nonnull RouteDestination destination) { - this.destination = destination; - return this; - } - - /** - * Get destination - * - * @return destination - */ - @javax.annotation.Nonnull - public RouteDestination getDestination() { - return destination; - } - - public void setDestination(@javax.annotation.Nonnull RouteDestination destination) { - this.destination = destination; - } - - /** - * Universally Unique Identifier (UUID). - * - * @return id - */ - @javax.annotation.Nullable public UUID getId() { - return id; - } - - public Route labels(@javax.annotation.Nullable Object labels) { - this.labels = labels; - return this; - } - - /** - * Object that represents the labels as key-value pairs of a resource. Key constraints: - May - * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must - * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain - * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), - * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 - * and 63 characters. - Must begin and end with an alphanumerical character - * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), - * dots (`.`), and alphanumerics in between. - Keys starting with the prefix - * `stackit-` or having a domain prefix of `stackit.cloud` (including its - * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value - * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not - * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May - * contain dashes (`-`), underscores (`_`), dots (`.`), and - * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are - * excluded from this count. Providing a `null` value for a key will remove that key. - * - * @return labels - */ - @javax.annotation.Nullable public Object getLabels() { - return labels; - } - - public void setLabels(@javax.annotation.Nullable Object labels) { - this.labels = labels; - } - - public Route nexthop(@javax.annotation.Nonnull RouteNexthop nexthop) { - this.nexthop = nexthop; - return this; - } - - /** - * Get nexthop - * - * @return nexthop - */ - @javax.annotation.Nonnull - public RouteNexthop getNexthop() { - return nexthop; - } - - public void setNexthop(@javax.annotation.Nonnull RouteNexthop nexthop) { - this.nexthop = nexthop; - } - - /** - * Date-time when resource was last updated. - * - * @return updatedAt - */ - @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { - return updatedAt; - } - - /** - * 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. - * - * @param key name of the property - * @param value value of the property - * @return the Route instance itself - */ - public Route 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. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - 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; - } - Route route = (Route) o; - return Objects.equals(this.createdAt, route.createdAt) - && Objects.equals(this.destination, route.destination) - && Objects.equals(this.id, route.id) - && Objects.equals(this.labels, route.labels) - && Objects.equals(this.nexthop, route.nexthop) - && Objects.equals(this.updatedAt, route.updatedAt) - && Objects.equals(this.additionalProperties, route.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash( - createdAt, destination, id, labels, nexthop, updatedAt, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Route {\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" destination: ").append(toIndentedString(destination)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); - sb.append(" nexthop: ").append(toIndentedString(nexthop)).append("\n"); - sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).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( - Arrays.asList( - "createdAt", - "destination", - "id", - "labels", - "nexthop", - "updatedAt")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("destination", "nexthop")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to Route - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!Route.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field(s) %s in Route is not found in the empty JSON string", - Route.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Route.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field `%s` is not found in the JSON string: %s", - requiredField, - jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the required field `destination` - RouteDestination.validateJsonElement(jsonObj.get("destination")); - if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) - && !jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `id` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("id").toString())); - } - // validate the required field `nexthop` - RouteNexthop.validateJsonElement(jsonObj.get("nexthop")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Route.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Route' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(Route.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, Route value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional 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 { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public Route read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - Route 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( - java.util.Locale.ROOT, - "The field `%s` has unknown primitive type. Value: %s", - entry.getKey(), - entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - }.nullSafe(); - } - } - - /** - * Create an instance of Route given an JSON string - * - * @param jsonString JSON string - * @return An instance of Route - * @throws IOException if the JSON string is invalid with respect to Route - */ - public static Route fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Route.class); - } - - /** - * Convert an instance of Route to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/RouteDestination.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/RouteDestination.java deleted file mode 100644 index ff3f731f..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/RouteDestination.java +++ /dev/null @@ -1,288 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.model; - -import cloud.stackit.sdk.iaas.v2alpha1api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Map; -import java.util.logging.Level; -import java.util.logging.Logger; - -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class RouteDestination extends AbstractOpenApiSchema { - private static final Logger log = Logger.getLogger(RouteDestination.class.getName()); - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!RouteDestination.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'RouteDestination' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter adapterDestinationCIDRv4 = - gson.getDelegateAdapter(this, TypeToken.get(DestinationCIDRv4.class)); - final TypeAdapter adapterDestinationCIDRv6 = - gson.getDelegateAdapter(this, TypeToken.get(DestinationCIDRv6.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, RouteDestination value) - throws IOException { - if (value == null || value.getActualInstance() == null) { - elementAdapter.write(out, null); - return; - } - - // check if the actual instance is of the type `DestinationCIDRv4` - if (value.getActualInstance() instanceof DestinationCIDRv4) { - JsonElement element = - adapterDestinationCIDRv4.toJsonTree( - (DestinationCIDRv4) value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - // check if the actual instance is of the type `DestinationCIDRv6` - if (value.getActualInstance() instanceof DestinationCIDRv6) { - JsonElement element = - adapterDestinationCIDRv6.toJsonTree( - (DestinationCIDRv6) value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - throw new IOException( - "Failed to serialize as the type doesn't match oneOf schemas: DestinationCIDRv4, DestinationCIDRv6"); - } - - @Override - public RouteDestination read(JsonReader in) throws IOException { - Object deserialized = null; - JsonElement jsonElement = elementAdapter.read(in); - - int match = 0; - ArrayList errorMessages = new ArrayList<>(); - TypeAdapter actualAdapter = elementAdapter; - - // deserialize DestinationCIDRv4 - try { - // validate the JSON object to see if any exception is thrown - DestinationCIDRv4.validateJsonElement(jsonElement); - actualAdapter = adapterDestinationCIDRv4; - match++; - log.log( - Level.FINER, - "Input data matches schema 'DestinationCIDRv4'"); - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - java.util.Locale.ROOT, - "Deserialization for DestinationCIDRv4 failed with `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema 'DestinationCIDRv4'", - e); - } - // deserialize DestinationCIDRv6 - try { - // validate the JSON object to see if any exception is thrown - DestinationCIDRv6.validateJsonElement(jsonElement); - actualAdapter = adapterDestinationCIDRv6; - match++; - log.log( - Level.FINER, - "Input data matches schema 'DestinationCIDRv6'"); - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - java.util.Locale.ROOT, - "Deserialization for DestinationCIDRv6 failed with `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema 'DestinationCIDRv6'", - e); - } - - if (match == 1) { - RouteDestination ret = new RouteDestination(); - ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); - return ret; - } - - throw new IOException( - String.format( - java.util.Locale.ROOT, - "Failed deserialization for RouteDestination: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", - match, - errorMessages, - jsonElement.toString())); - } - }.nullSafe(); - } - } - - // store a list of schema names defined in oneOf - public static final Map> schemas = new HashMap>(); - - public RouteDestination() { - super("oneOf", Boolean.FALSE); - } - - public RouteDestination(Object o) { - super("oneOf", Boolean.FALSE); - setActualInstance(o); - } - - static { - schemas.put("DestinationCIDRv4", DestinationCIDRv4.class); - schemas.put("DestinationCIDRv6", DestinationCIDRv6.class); - } - - @Override - public Map> getSchemas() { - return RouteDestination.schemas; - } - - /** - * Set the instance that matches the oneOf child schema, check the instance parameter is valid - * against the oneOf child schemas: DestinationCIDRv4, DestinationCIDRv6 - * - *

It could be an instance of the 'oneOf' schemas. - */ - @Override - public void setActualInstance(Object instance) { - if (instance instanceof DestinationCIDRv4) { - super.setActualInstance(instance); - return; - } - - if (instance instanceof DestinationCIDRv6) { - super.setActualInstance(instance); - return; - } - - throw new RuntimeException( - "Invalid instance type. Must be DestinationCIDRv4, DestinationCIDRv6"); - } - - /** - * Get the actual instance, which can be the following: DestinationCIDRv4, DestinationCIDRv6 - * - * @return The actual instance (DestinationCIDRv4, DestinationCIDRv6) - */ - @SuppressWarnings("unchecked") - @Override - public Object getActualInstance() { - return super.getActualInstance(); - } - - /** - * Get the actual instance of `DestinationCIDRv4`. If the actual instance is not - * `DestinationCIDRv4`, the ClassCastException will be thrown. - * - * @return The actual instance of `DestinationCIDRv4` - * @throws ClassCastException if the instance is not `DestinationCIDRv4` - */ - public DestinationCIDRv4 getDestinationCIDRv4() throws ClassCastException { - return (DestinationCIDRv4) super.getActualInstance(); - } - - /** - * Get the actual instance of `DestinationCIDRv6`. If the actual instance is not - * `DestinationCIDRv6`, the ClassCastException will be thrown. - * - * @return The actual instance of `DestinationCIDRv6` - * @throws ClassCastException if the instance is not `DestinationCIDRv6` - */ - public DestinationCIDRv6 getDestinationCIDRv6() throws ClassCastException { - return (DestinationCIDRv6) super.getActualInstance(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to RouteDestination - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - // validate oneOf schemas one by one - int validCount = 0; - ArrayList errorMessages = new ArrayList<>(); - // validate the json string with DestinationCIDRv4 - try { - DestinationCIDRv4.validateJsonElement(jsonElement); - validCount++; - } catch (Exception e) { - errorMessages.add( - String.format( - java.util.Locale.ROOT, - "Deserialization for DestinationCIDRv4 failed with `%s`.", - e.getMessage())); - // continue to the next one - } - // validate the json string with DestinationCIDRv6 - try { - DestinationCIDRv6.validateJsonElement(jsonElement); - validCount++; - } catch (Exception e) { - errorMessages.add( - String.format( - java.util.Locale.ROOT, - "Deserialization for DestinationCIDRv6 failed with `%s`.", - e.getMessage())); - // continue to the next one - } - if (validCount != 1) { - throw new IOException( - String.format( - java.util.Locale.ROOT, - "The JSON string is invalid for RouteDestination with oneOf schemas: DestinationCIDRv4, DestinationCIDRv6. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", - validCount, - errorMessages, - jsonElement.toString())); - } - } - - /** - * Create an instance of RouteDestination given an JSON string - * - * @param jsonString JSON string - * @return An instance of RouteDestination - * @throws IOException if the JSON string is invalid with respect to RouteDestination - */ - public static RouteDestination fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, RouteDestination.class); - } - - /** - * Convert an instance of RouteDestination to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/RouteListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/RouteListResponse.java deleted file mode 100644 index 31fb5ad3..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/RouteListResponse.java +++ /dev/null @@ -1,324 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.model; - -import cloud.stackit.sdk.iaas.v2alpha1api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** Route list response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class RouteListResponse { - public static final String SERIALIZED_NAME_ITEMS = "items"; - - @SerializedName(SERIALIZED_NAME_ITEMS) - @javax.annotation.Nonnull - private List items = new ArrayList<>(); - - public RouteListResponse() {} - - public RouteListResponse items(@javax.annotation.Nonnull List items) { - this.items = items; - return this; - } - - public RouteListResponse addItemsItem(Route itemsItem) { - if (this.items == null) { - this.items = new ArrayList<>(); - } - this.items.add(itemsItem); - return this; - } - - /** - * A list of routes. - * - * @return items - */ - @javax.annotation.Nonnull - public List getItems() { - return items; - } - - public void setItems(@javax.annotation.Nonnull List items) { - this.items = items; - } - - /** - * 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. - * - * @param key name of the property - * @param value value of the property - * @return the RouteListResponse instance itself - */ - public RouteListResponse 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. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - 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; - } - RouteListResponse routeListResponse = (RouteListResponse) o; - return Objects.equals(this.items, routeListResponse.items) - && Objects.equals( - this.additionalProperties, routeListResponse.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(items, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class RouteListResponse {\n"); - sb.append(" items: ").append(toIndentedString(items)).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(Arrays.asList("items")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("items")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to RouteListResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!RouteListResponse.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field(s) %s in RouteListResponse is not found in the empty JSON string", - RouteListResponse.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : RouteListResponse.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field `%s` is not found in the JSON string: %s", - requiredField, - jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - Route.validateJsonElement(jsonArrayitems.get(i)); - } - ; - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!RouteListResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'RouteListResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(RouteListResponse.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, RouteListResponse value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional 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 { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public RouteListResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - RouteListResponse 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( - java.util.Locale.ROOT, - "The field `%s` has unknown primitive type. Value: %s", - entry.getKey(), - entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - }.nullSafe(); - } - } - - /** - * Create an instance of RouteListResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of RouteListResponse - * @throws IOException if the JSON string is invalid with respect to RouteListResponse - */ - public static RouteListResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, RouteListResponse.class); - } - - /** - * Convert an instance of RouteListResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/RouteNexthop.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/RouteNexthop.java deleted file mode 100644 index ba1f7586..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/RouteNexthop.java +++ /dev/null @@ -1,402 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.model; - -import cloud.stackit.sdk.iaas.v2alpha1api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Map; -import java.util.logging.Level; -import java.util.logging.Logger; - -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class RouteNexthop extends AbstractOpenApiSchema { - private static final Logger log = Logger.getLogger(RouteNexthop.class.getName()); - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!RouteNexthop.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'RouteNexthop' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter adapterNexthopIPv4 = - gson.getDelegateAdapter(this, TypeToken.get(NexthopIPv4.class)); - final TypeAdapter adapterNexthopIPv6 = - gson.getDelegateAdapter(this, TypeToken.get(NexthopIPv6.class)); - final TypeAdapter adapterNexthopInternet = - gson.getDelegateAdapter(this, TypeToken.get(NexthopInternet.class)); - final TypeAdapter adapterNexthopBlackhole = - gson.getDelegateAdapter(this, TypeToken.get(NexthopBlackhole.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, RouteNexthop value) throws IOException { - if (value == null || value.getActualInstance() == null) { - elementAdapter.write(out, null); - return; - } - - // check if the actual instance is of the type `NexthopIPv4` - if (value.getActualInstance() instanceof NexthopIPv4) { - JsonElement element = - adapterNexthopIPv4.toJsonTree( - (NexthopIPv4) value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - // check if the actual instance is of the type `NexthopIPv6` - if (value.getActualInstance() instanceof NexthopIPv6) { - JsonElement element = - adapterNexthopIPv6.toJsonTree( - (NexthopIPv6) value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - // check if the actual instance is of the type `NexthopInternet` - if (value.getActualInstance() instanceof NexthopInternet) { - JsonElement element = - adapterNexthopInternet.toJsonTree( - (NexthopInternet) value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - // check if the actual instance is of the type `NexthopBlackhole` - if (value.getActualInstance() instanceof NexthopBlackhole) { - JsonElement element = - adapterNexthopBlackhole.toJsonTree( - (NexthopBlackhole) value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - throw new IOException( - "Failed to serialize as the type doesn't match oneOf schemas: NexthopBlackhole, NexthopIPv4, NexthopIPv6, NexthopInternet"); - } - - @Override - public RouteNexthop read(JsonReader in) throws IOException { - Object deserialized = null; - JsonElement jsonElement = elementAdapter.read(in); - - int match = 0; - ArrayList errorMessages = new ArrayList<>(); - TypeAdapter actualAdapter = elementAdapter; - - // deserialize NexthopIPv4 - try { - // validate the JSON object to see if any exception is thrown - NexthopIPv4.validateJsonElement(jsonElement); - actualAdapter = adapterNexthopIPv4; - match++; - log.log(Level.FINER, "Input data matches schema 'NexthopIPv4'"); - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - java.util.Locale.ROOT, - "Deserialization for NexthopIPv4 failed with `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema 'NexthopIPv4'", - e); - } - // deserialize NexthopIPv6 - try { - // validate the JSON object to see if any exception is thrown - NexthopIPv6.validateJsonElement(jsonElement); - actualAdapter = adapterNexthopIPv6; - match++; - log.log(Level.FINER, "Input data matches schema 'NexthopIPv6'"); - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - java.util.Locale.ROOT, - "Deserialization for NexthopIPv6 failed with `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema 'NexthopIPv6'", - e); - } - // deserialize NexthopInternet - try { - // validate the JSON object to see if any exception is thrown - NexthopInternet.validateJsonElement(jsonElement); - actualAdapter = adapterNexthopInternet; - match++; - log.log(Level.FINER, "Input data matches schema 'NexthopInternet'"); - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - java.util.Locale.ROOT, - "Deserialization for NexthopInternet failed with `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema 'NexthopInternet'", - e); - } - // deserialize NexthopBlackhole - try { - // validate the JSON object to see if any exception is thrown - NexthopBlackhole.validateJsonElement(jsonElement); - actualAdapter = adapterNexthopBlackhole; - match++; - log.log( - Level.FINER, - "Input data matches schema 'NexthopBlackhole'"); - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - java.util.Locale.ROOT, - "Deserialization for NexthopBlackhole failed with `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema 'NexthopBlackhole'", - e); - } - - if (match == 1) { - RouteNexthop ret = new RouteNexthop(); - ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); - return ret; - } - - throw new IOException( - String.format( - java.util.Locale.ROOT, - "Failed deserialization for RouteNexthop: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", - match, - errorMessages, - jsonElement.toString())); - } - }.nullSafe(); - } - } - - // store a list of schema names defined in oneOf - public static final Map> schemas = new HashMap>(); - - public RouteNexthop() { - super("oneOf", Boolean.FALSE); - } - - public RouteNexthop(Object o) { - super("oneOf", Boolean.FALSE); - setActualInstance(o); - } - - static { - schemas.put("NexthopIPv4", NexthopIPv4.class); - schemas.put("NexthopIPv6", NexthopIPv6.class); - schemas.put("NexthopInternet", NexthopInternet.class); - schemas.put("NexthopBlackhole", NexthopBlackhole.class); - } - - @Override - public Map> getSchemas() { - return RouteNexthop.schemas; - } - - /** - * Set the instance that matches the oneOf child schema, check the instance parameter is valid - * against the oneOf child schemas: NexthopBlackhole, NexthopIPv4, NexthopIPv6, NexthopInternet - * - *

It could be an instance of the 'oneOf' schemas. - */ - @Override - public void setActualInstance(Object instance) { - if (instance instanceof NexthopIPv4) { - super.setActualInstance(instance); - return; - } - - if (instance instanceof NexthopIPv6) { - super.setActualInstance(instance); - return; - } - - if (instance instanceof NexthopInternet) { - super.setActualInstance(instance); - return; - } - - if (instance instanceof NexthopBlackhole) { - super.setActualInstance(instance); - return; - } - - throw new RuntimeException( - "Invalid instance type. Must be NexthopBlackhole, NexthopIPv4, NexthopIPv6, NexthopInternet"); - } - - /** - * Get the actual instance, which can be the following: NexthopBlackhole, NexthopIPv4, - * NexthopIPv6, NexthopInternet - * - * @return The actual instance (NexthopBlackhole, NexthopIPv4, NexthopIPv6, NexthopInternet) - */ - @SuppressWarnings("unchecked") - @Override - public Object getActualInstance() { - return super.getActualInstance(); - } - - /** - * Get the actual instance of `NexthopIPv4`. If the actual instance is not `NexthopIPv4`, the - * ClassCastException will be thrown. - * - * @return The actual instance of `NexthopIPv4` - * @throws ClassCastException if the instance is not `NexthopIPv4` - */ - public NexthopIPv4 getNexthopIPv4() throws ClassCastException { - return (NexthopIPv4) super.getActualInstance(); - } - - /** - * Get the actual instance of `NexthopIPv6`. If the actual instance is not `NexthopIPv6`, the - * ClassCastException will be thrown. - * - * @return The actual instance of `NexthopIPv6` - * @throws ClassCastException if the instance is not `NexthopIPv6` - */ - public NexthopIPv6 getNexthopIPv6() throws ClassCastException { - return (NexthopIPv6) super.getActualInstance(); - } - - /** - * Get the actual instance of `NexthopInternet`. If the actual instance is not - * `NexthopInternet`, the ClassCastException will be thrown. - * - * @return The actual instance of `NexthopInternet` - * @throws ClassCastException if the instance is not `NexthopInternet` - */ - public NexthopInternet getNexthopInternet() throws ClassCastException { - return (NexthopInternet) super.getActualInstance(); - } - - /** - * Get the actual instance of `NexthopBlackhole`. If the actual instance is not - * `NexthopBlackhole`, the ClassCastException will be thrown. - * - * @return The actual instance of `NexthopBlackhole` - * @throws ClassCastException if the instance is not `NexthopBlackhole` - */ - public NexthopBlackhole getNexthopBlackhole() throws ClassCastException { - return (NexthopBlackhole) super.getActualInstance(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to RouteNexthop - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - // validate oneOf schemas one by one - int validCount = 0; - ArrayList errorMessages = new ArrayList<>(); - // validate the json string with NexthopIPv4 - try { - NexthopIPv4.validateJsonElement(jsonElement); - validCount++; - } catch (Exception e) { - errorMessages.add( - String.format( - java.util.Locale.ROOT, - "Deserialization for NexthopIPv4 failed with `%s`.", - e.getMessage())); - // continue to the next one - } - // validate the json string with NexthopIPv6 - try { - NexthopIPv6.validateJsonElement(jsonElement); - validCount++; - } catch (Exception e) { - errorMessages.add( - String.format( - java.util.Locale.ROOT, - "Deserialization for NexthopIPv6 failed with `%s`.", - e.getMessage())); - // continue to the next one - } - // validate the json string with NexthopInternet - try { - NexthopInternet.validateJsonElement(jsonElement); - validCount++; - } catch (Exception e) { - errorMessages.add( - String.format( - java.util.Locale.ROOT, - "Deserialization for NexthopInternet failed with `%s`.", - e.getMessage())); - // continue to the next one - } - // validate the json string with NexthopBlackhole - try { - NexthopBlackhole.validateJsonElement(jsonElement); - validCount++; - } catch (Exception e) { - errorMessages.add( - String.format( - java.util.Locale.ROOT, - "Deserialization for NexthopBlackhole failed with `%s`.", - e.getMessage())); - // continue to the next one - } - if (validCount != 1) { - throw new IOException( - String.format( - java.util.Locale.ROOT, - "The JSON string is invalid for RouteNexthop with oneOf schemas: NexthopBlackhole, NexthopIPv4, NexthopIPv6, NexthopInternet. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", - validCount, - errorMessages, - jsonElement.toString())); - } - } - - /** - * Create an instance of RouteNexthop given an JSON string - * - * @param jsonString JSON string - * @return An instance of RouteNexthop - * @throws IOException if the JSON string is invalid with respect to RouteNexthop - */ - public static RouteNexthop fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, RouteNexthop.class); - } - - /** - * Convert an instance of RouteNexthop to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/RoutingTable.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/RoutingTable.java deleted file mode 100644 index 7162dfc2..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/RoutingTable.java +++ /dev/null @@ -1,536 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.model; - -import cloud.stackit.sdk.iaas.v2alpha1api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.UUID; - -/** - * An object representing a routing table. Filterable Fields: `dynamicRoutes`, - * `systemRoutes`. - */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class RoutingTable { - public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; - - @SerializedName(SERIALIZED_NAME_CREATED_AT) - @javax.annotation.Nullable private OffsetDateTime createdAt; - - public static final String SERIALIZED_NAME_DEFAULT = "default"; - - @SerializedName(SERIALIZED_NAME_DEFAULT) - @javax.annotation.Nullable private Boolean _default = true; - - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - @javax.annotation.Nullable private String description; - - public static final String SERIALIZED_NAME_DYNAMIC_ROUTES = "dynamicRoutes"; - - @SerializedName(SERIALIZED_NAME_DYNAMIC_ROUTES) - @javax.annotation.Nullable private Boolean dynamicRoutes = true; - - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - @javax.annotation.Nullable private UUID id; - - public static final String SERIALIZED_NAME_LABELS = "labels"; - - @SerializedName(SERIALIZED_NAME_LABELS) - @javax.annotation.Nullable private Object labels; - - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - @javax.annotation.Nonnull - private String name; - - public static final String SERIALIZED_NAME_SYSTEM_ROUTES = "systemRoutes"; - - @SerializedName(SERIALIZED_NAME_SYSTEM_ROUTES) - @javax.annotation.Nullable private Boolean systemRoutes = true; - - public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; - - @SerializedName(SERIALIZED_NAME_UPDATED_AT) - @javax.annotation.Nullable private OffsetDateTime updatedAt; - - public RoutingTable() {} - - public RoutingTable( - OffsetDateTime createdAt, Boolean _default, UUID id, OffsetDateTime updatedAt) { - this(); - this.createdAt = createdAt; - this._default = _default; - this.id = id; - this.updatedAt = updatedAt; - } - - /** - * Date-time when resource was created. - * - * @return createdAt - */ - @javax.annotation.Nullable public OffsetDateTime getCreatedAt() { - return createdAt; - } - - /** - * This is the default routing table. It can't be deleted and is used if the user does not - * specify it otherwise. - * - * @return _default - */ - @javax.annotation.Nullable public Boolean getDefault() { - return _default; - } - - public RoutingTable description(@javax.annotation.Nullable String description) { - this.description = description; - return this; - } - - /** - * Description Object. Allows string up to 255 Characters. - * - * @return description - */ - @javax.annotation.Nullable public String getDescription() { - return description; - } - - public void setDescription(@javax.annotation.Nullable String description) { - this.description = description; - } - - public RoutingTable dynamicRoutes(@javax.annotation.Nullable Boolean dynamicRoutes) { - this.dynamicRoutes = dynamicRoutes; - return this; - } - - /** - * A config setting for a routing table which allows propagation of dynamic routes to this - * routing table. - * - * @return dynamicRoutes - */ - @javax.annotation.Nullable public Boolean getDynamicRoutes() { - return dynamicRoutes; - } - - public void setDynamicRoutes(@javax.annotation.Nullable Boolean dynamicRoutes) { - this.dynamicRoutes = dynamicRoutes; - } - - /** - * Universally Unique Identifier (UUID). - * - * @return id - */ - @javax.annotation.Nullable public UUID getId() { - return id; - } - - public RoutingTable labels(@javax.annotation.Nullable Object labels) { - this.labels = labels; - return this; - } - - /** - * Object that represents the labels as key-value pairs of a resource. Key constraints: - May - * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must - * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain - * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), - * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 - * and 63 characters. - Must begin and end with an alphanumerical character - * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), - * dots (`.`), and alphanumerics in between. - Keys starting with the prefix - * `stackit-` or having a domain prefix of `stackit.cloud` (including its - * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value - * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not - * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May - * contain dashes (`-`), underscores (`_`), dots (`.`), and - * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are - * excluded from this count. Providing a `null` value for a key will remove that key. - * - * @return labels - */ - @javax.annotation.Nullable public Object getLabels() { - return labels; - } - - public void setLabels(@javax.annotation.Nullable Object labels) { - this.labels = labels; - } - - public RoutingTable name(@javax.annotation.Nonnull String name) { - this.name = name; - return this; - } - - /** - * The name for a General Object. Matches Names and also UUIDs. - * - * @return name - */ - @javax.annotation.Nonnull - public String getName() { - return name; - } - - public void setName(@javax.annotation.Nonnull String name) { - this.name = name; - } - - public RoutingTable systemRoutes(@javax.annotation.Nullable Boolean systemRoutes) { - this.systemRoutes = systemRoutes; - return this; - } - - /** - * A config setting for a routing table which allows installation of automatic system routes for - * connectivity between projects in the same SNA. - * - * @return systemRoutes - */ - @javax.annotation.Nullable public Boolean getSystemRoutes() { - return systemRoutes; - } - - public void setSystemRoutes(@javax.annotation.Nullable Boolean systemRoutes) { - this.systemRoutes = systemRoutes; - } - - /** - * Date-time when resource was last updated. - * - * @return updatedAt - */ - @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { - return updatedAt; - } - - /** - * 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. - * - * @param key name of the property - * @param value value of the property - * @return the RoutingTable instance itself - */ - public RoutingTable 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. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - 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; - } - RoutingTable routingTable = (RoutingTable) o; - return Objects.equals(this.createdAt, routingTable.createdAt) - && Objects.equals(this._default, routingTable._default) - && Objects.equals(this.description, routingTable.description) - && Objects.equals(this.dynamicRoutes, routingTable.dynamicRoutes) - && Objects.equals(this.id, routingTable.id) - && Objects.equals(this.labels, routingTable.labels) - && Objects.equals(this.name, routingTable.name) - && Objects.equals(this.systemRoutes, routingTable.systemRoutes) - && Objects.equals(this.updatedAt, routingTable.updatedAt) - && Objects.equals(this.additionalProperties, routingTable.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash( - createdAt, - _default, - description, - dynamicRoutes, - id, - labels, - name, - systemRoutes, - updatedAt, - additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class RoutingTable {\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" _default: ").append(toIndentedString(_default)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" dynamicRoutes: ").append(toIndentedString(dynamicRoutes)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" systemRoutes: ").append(toIndentedString(systemRoutes)).append("\n"); - sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).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( - Arrays.asList( - "createdAt", - "default", - "description", - "dynamicRoutes", - "id", - "labels", - "name", - "systemRoutes", - "updatedAt")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("name")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to RoutingTable - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!RoutingTable.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field(s) %s in RoutingTable is not found in the empty JSON string", - RoutingTable.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : RoutingTable.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field `%s` is not found in the JSON string: %s", - requiredField, - jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) - && !jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `description` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("description").toString())); - } - if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) - && !jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `id` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("id").toString())); - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "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 (!RoutingTable.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'RoutingTable' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(RoutingTable.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, RoutingTable value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional 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 { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public RoutingTable read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - RoutingTable 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( - java.util.Locale.ROOT, - "The field `%s` has unknown primitive type. Value: %s", - entry.getKey(), - entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - }.nullSafe(); - } - } - - /** - * Create an instance of RoutingTable given an JSON string - * - * @param jsonString JSON string - * @return An instance of RoutingTable - * @throws IOException if the JSON string is invalid with respect to RoutingTable - */ - public static RoutingTable fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, RoutingTable.class); - } - - /** - * Convert an instance of RoutingTable to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/RoutingTableListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/RoutingTableListResponse.java deleted file mode 100644 index c0343178..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/RoutingTableListResponse.java +++ /dev/null @@ -1,325 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.model; - -import cloud.stackit.sdk.iaas.v2alpha1api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** Routing table response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class RoutingTableListResponse { - public static final String SERIALIZED_NAME_ITEMS = "items"; - - @SerializedName(SERIALIZED_NAME_ITEMS) - @javax.annotation.Nonnull - private List items = new ArrayList<>(); - - public RoutingTableListResponse() {} - - public RoutingTableListResponse items(@javax.annotation.Nonnull List items) { - this.items = items; - return this; - } - - public RoutingTableListResponse addItemsItem(RoutingTable itemsItem) { - if (this.items == null) { - this.items = new ArrayList<>(); - } - this.items.add(itemsItem); - return this; - } - - /** - * A list of routing tables. - * - * @return items - */ - @javax.annotation.Nonnull - public List getItems() { - return items; - } - - public void setItems(@javax.annotation.Nonnull List items) { - this.items = items; - } - - /** - * 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. - * - * @param key name of the property - * @param value value of the property - * @return the RoutingTableListResponse instance itself - */ - public RoutingTableListResponse 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. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - 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; - } - RoutingTableListResponse routingTableListResponse = (RoutingTableListResponse) o; - return Objects.equals(this.items, routingTableListResponse.items) - && Objects.equals( - this.additionalProperties, routingTableListResponse.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(items, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class RoutingTableListResponse {\n"); - sb.append(" items: ").append(toIndentedString(items)).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(Arrays.asList("items")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("items")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to RoutingTableListResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!RoutingTableListResponse.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field(s) %s in RoutingTableListResponse is not found in the empty JSON string", - RoutingTableListResponse.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : RoutingTableListResponse.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field `%s` is not found in the JSON string: %s", - requiredField, - jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - RoutingTable.validateJsonElement(jsonArrayitems.get(i)); - } - ; - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!RoutingTableListResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'RoutingTableListResponse' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(RoutingTableListResponse.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, RoutingTableListResponse value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional 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 { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public RoutingTableListResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - RoutingTableListResponse 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( - java.util.Locale.ROOT, - "The field `%s` has unknown primitive type. Value: %s", - entry.getKey(), - entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - }.nullSafe(); - } - } - - /** - * Create an instance of RoutingTableListResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of RoutingTableListResponse - * @throws IOException if the JSON string is invalid with respect to RoutingTableListResponse - */ - public static RoutingTableListResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, RoutingTableListResponse.class); - } - - /** - * Convert an instance of RoutingTableListResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/UpdateNetworkIPv4Body.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/UpdateNetworkIPv4Body.java deleted file mode 100644 index cd1753e1..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/UpdateNetworkIPv4Body.java +++ /dev/null @@ -1,355 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.model; - -import cloud.stackit.sdk.iaas.v2alpha1api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import org.openapitools.jackson.nullable.JsonNullable; - -/** The config object for a IPv4 network update. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class UpdateNetworkIPv4Body { - public static final String SERIALIZED_NAME_GATEWAY = "gateway"; - - @SerializedName(SERIALIZED_NAME_GATEWAY) - @javax.annotation.Nullable private String gateway; - - public static final String SERIALIZED_NAME_NAMESERVERS = "nameservers"; - - @SerializedName(SERIALIZED_NAME_NAMESERVERS) - @javax.annotation.Nullable private List nameservers = new ArrayList<>(); - - public UpdateNetworkIPv4Body() {} - - public UpdateNetworkIPv4Body gateway(@javax.annotation.Nullable String gateway) { - this.gateway = gateway; - return this; - } - - /** - * The IPv4 gateway of a network. If not specified the first IP of the network will be assigned - * as the gateway. If 'null' is sent, then the network doesn't have a gateway. - * - * @return gateway - */ - @javax.annotation.Nullable public String getGateway() { - return gateway; - } - - public void setGateway(@javax.annotation.Nullable String gateway) { - this.gateway = gateway; - } - - public UpdateNetworkIPv4Body nameservers(@javax.annotation.Nullable List nameservers) { - this.nameservers = nameservers; - return this; - } - - public UpdateNetworkIPv4Body addNameserversItem(String nameserversItem) { - if (this.nameservers == null) { - this.nameservers = new ArrayList<>(); - } - this.nameservers.add(nameserversItem); - return this; - } - - /** - * A list containing DNS Servers/Nameservers for IPv4. - * - * @return nameservers - */ - @javax.annotation.Nullable public List getNameservers() { - return nameservers; - } - - public void setNameservers(@javax.annotation.Nullable List nameservers) { - this.nameservers = nameservers; - } - - /** - * 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. - * - * @param key name of the property - * @param value value of the property - * @return the UpdateNetworkIPv4Body instance itself - */ - public UpdateNetworkIPv4Body 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. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - 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; - } - UpdateNetworkIPv4Body updateNetworkIPv4Body = (UpdateNetworkIPv4Body) o; - return Objects.equals(this.gateway, updateNetworkIPv4Body.gateway) - && Objects.equals(this.nameservers, updateNetworkIPv4Body.nameservers) - && Objects.equals( - this.additionalProperties, updateNetworkIPv4Body.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b - || (a != null - && b != null - && a.isPresent() - && b.isPresent() - && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(gateway, nameservers, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UpdateNetworkIPv4Body {\n"); - sb.append(" gateway: ").append(toIndentedString(gateway)).append("\n"); - sb.append(" nameservers: ").append(toIndentedString(nameservers)).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(Arrays.asList("gateway", "nameservers")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(0); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UpdateNetworkIPv4Body - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UpdateNetworkIPv4Body.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field(s) %s in UpdateNetworkIPv4Body is not found in the empty JSON string", - UpdateNetworkIPv4Body.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("gateway") != null && !jsonObj.get("gateway").isJsonNull()) - && !jsonObj.get("gateway").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `gateway` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("gateway").toString())); - } - // ensure the optional json data is an array if present - if (jsonObj.get("nameservers") != null - && !jsonObj.get("nameservers").isJsonNull() - && !jsonObj.get("nameservers").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `nameservers` to be an array in the JSON string but got `%s`", - jsonObj.get("nameservers").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UpdateNetworkIPv4Body.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UpdateNetworkIPv4Body' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(UpdateNetworkIPv4Body.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, UpdateNetworkIPv4Body value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional 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 { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public UpdateNetworkIPv4Body read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - UpdateNetworkIPv4Body 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( - java.util.Locale.ROOT, - "The field `%s` has unknown primitive type. Value: %s", - entry.getKey(), - entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - }.nullSafe(); - } - } - - /** - * Create an instance of UpdateNetworkIPv4Body given an JSON string - * - * @param jsonString JSON string - * @return An instance of UpdateNetworkIPv4Body - * @throws IOException if the JSON string is invalid with respect to UpdateNetworkIPv4Body - */ - public static UpdateNetworkIPv4Body fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UpdateNetworkIPv4Body.class); - } - - /** - * Convert an instance of UpdateNetworkIPv4Body to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/UpdateNetworkIPv6Body.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/UpdateNetworkIPv6Body.java deleted file mode 100644 index eef69510..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/UpdateNetworkIPv6Body.java +++ /dev/null @@ -1,355 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.model; - -import cloud.stackit.sdk.iaas.v2alpha1api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import org.openapitools.jackson.nullable.JsonNullable; - -/** The config object for a IPv6 network update. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class UpdateNetworkIPv6Body { - public static final String SERIALIZED_NAME_GATEWAY = "gateway"; - - @SerializedName(SERIALIZED_NAME_GATEWAY) - @javax.annotation.Nullable private String gateway; - - public static final String SERIALIZED_NAME_NAMESERVERS = "nameservers"; - - @SerializedName(SERIALIZED_NAME_NAMESERVERS) - @javax.annotation.Nullable private List nameservers = new ArrayList<>(); - - public UpdateNetworkIPv6Body() {} - - public UpdateNetworkIPv6Body gateway(@javax.annotation.Nullable String gateway) { - this.gateway = gateway; - return this; - } - - /** - * The IPv6 gateway of a network. If not specified the first IP of the network will be assigned - * as the gateway. If 'null' is sent, then the network doesn't have a gateway. - * - * @return gateway - */ - @javax.annotation.Nullable public String getGateway() { - return gateway; - } - - public void setGateway(@javax.annotation.Nullable String gateway) { - this.gateway = gateway; - } - - public UpdateNetworkIPv6Body nameservers(@javax.annotation.Nullable List nameservers) { - this.nameservers = nameservers; - return this; - } - - public UpdateNetworkIPv6Body addNameserversItem(String nameserversItem) { - if (this.nameservers == null) { - this.nameservers = new ArrayList<>(); - } - this.nameservers.add(nameserversItem); - return this; - } - - /** - * A list containing DNS Servers/Nameservers for IPv6. - * - * @return nameservers - */ - @javax.annotation.Nullable public List getNameservers() { - return nameservers; - } - - public void setNameservers(@javax.annotation.Nullable List nameservers) { - this.nameservers = nameservers; - } - - /** - * 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. - * - * @param key name of the property - * @param value value of the property - * @return the UpdateNetworkIPv6Body instance itself - */ - public UpdateNetworkIPv6Body 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. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - 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; - } - UpdateNetworkIPv6Body updateNetworkIPv6Body = (UpdateNetworkIPv6Body) o; - return Objects.equals(this.gateway, updateNetworkIPv6Body.gateway) - && Objects.equals(this.nameservers, updateNetworkIPv6Body.nameservers) - && Objects.equals( - this.additionalProperties, updateNetworkIPv6Body.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b - || (a != null - && b != null - && a.isPresent() - && b.isPresent() - && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(gateway, nameservers, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UpdateNetworkIPv6Body {\n"); - sb.append(" gateway: ").append(toIndentedString(gateway)).append("\n"); - sb.append(" nameservers: ").append(toIndentedString(nameservers)).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(Arrays.asList("gateway", "nameservers")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(0); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UpdateNetworkIPv6Body - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UpdateNetworkIPv6Body.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field(s) %s in UpdateNetworkIPv6Body is not found in the empty JSON string", - UpdateNetworkIPv6Body.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("gateway") != null && !jsonObj.get("gateway").isJsonNull()) - && !jsonObj.get("gateway").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `gateway` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("gateway").toString())); - } - // ensure the optional json data is an array if present - if (jsonObj.get("nameservers") != null - && !jsonObj.get("nameservers").isJsonNull() - && !jsonObj.get("nameservers").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `nameservers` to be an array in the JSON string but got `%s`", - jsonObj.get("nameservers").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UpdateNetworkIPv6Body.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UpdateNetworkIPv6Body' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(UpdateNetworkIPv6Body.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, UpdateNetworkIPv6Body value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional 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 { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public UpdateNetworkIPv6Body read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - UpdateNetworkIPv6Body 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( - java.util.Locale.ROOT, - "The field `%s` has unknown primitive type. Value: %s", - entry.getKey(), - entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - }.nullSafe(); - } - } - - /** - * Create an instance of UpdateNetworkIPv6Body given an JSON string - * - * @param jsonString JSON string - * @return An instance of UpdateNetworkIPv6Body - * @throws IOException if the JSON string is invalid with respect to UpdateNetworkIPv6Body - */ - public static UpdateNetworkIPv6Body fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UpdateNetworkIPv6Body.class); - } - - /** - * Convert an instance of UpdateNetworkIPv6Body to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/UpdateRouteOfRoutingTablePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/UpdateRouteOfRoutingTablePayload.java deleted file mode 100644 index f849e8df..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/UpdateRouteOfRoutingTablePayload.java +++ /dev/null @@ -1,307 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.model; - -import cloud.stackit.sdk.iaas.v2alpha1api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** Object that represents the request body for a route update. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class UpdateRouteOfRoutingTablePayload { - public static final String SERIALIZED_NAME_LABELS = "labels"; - - @SerializedName(SERIALIZED_NAME_LABELS) - @javax.annotation.Nullable private Object labels; - - public UpdateRouteOfRoutingTablePayload() {} - - public UpdateRouteOfRoutingTablePayload labels(@javax.annotation.Nullable Object labels) { - this.labels = labels; - return this; - } - - /** - * Object that represents the labels as key-value pairs of a resource. Key constraints: - May - * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must - * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain - * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), - * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 - * and 63 characters. - Must begin and end with an alphanumerical character - * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), - * dots (`.`), and alphanumerics in between. - Keys starting with the prefix - * `stackit-` or having a domain prefix of `stackit.cloud` (including its - * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value - * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not - * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May - * contain dashes (`-`), underscores (`_`), dots (`.`), and - * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are - * excluded from this count. Providing a `null` value for a key will remove that key. - * - * @return labels - */ - @javax.annotation.Nullable public Object getLabels() { - return labels; - } - - public void setLabels(@javax.annotation.Nullable Object labels) { - this.labels = labels; - } - - /** - * 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. - * - * @param key name of the property - * @param value value of the property - * @return the UpdateRouteOfRoutingTablePayload instance itself - */ - public UpdateRouteOfRoutingTablePayload 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. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - 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; - } - UpdateRouteOfRoutingTablePayload updateRouteOfRoutingTablePayload = - (UpdateRouteOfRoutingTablePayload) o; - return Objects.equals(this.labels, updateRouteOfRoutingTablePayload.labels) - && Objects.equals( - this.additionalProperties, - updateRouteOfRoutingTablePayload.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(labels, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UpdateRouteOfRoutingTablePayload {\n"); - sb.append(" labels: ").append(toIndentedString(labels)).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(Arrays.asList("labels")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(0); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * UpdateRouteOfRoutingTablePayload - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UpdateRouteOfRoutingTablePayload.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field(s) %s in UpdateRouteOfRoutingTablePayload is not found in the empty JSON string", - UpdateRouteOfRoutingTablePayload.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UpdateRouteOfRoutingTablePayload.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UpdateRouteOfRoutingTablePayload' and - // its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(UpdateRouteOfRoutingTablePayload.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, UpdateRouteOfRoutingTablePayload value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional 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 { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public UpdateRouteOfRoutingTablePayload read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - UpdateRouteOfRoutingTablePayload 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( - java.util.Locale.ROOT, - "The field `%s` has unknown primitive type. Value: %s", - entry.getKey(), - entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - }.nullSafe(); - } - } - - /** - * Create an instance of UpdateRouteOfRoutingTablePayload given an JSON string - * - * @param jsonString JSON string - * @return An instance of UpdateRouteOfRoutingTablePayload - * @throws IOException if the JSON string is invalid with respect to - * UpdateRouteOfRoutingTablePayload - */ - public static UpdateRouteOfRoutingTablePayload fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UpdateRouteOfRoutingTablePayload.class); - } - - /** - * Convert an instance of UpdateRouteOfRoutingTablePayload to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/UpdateRoutingTableOfAreaPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/UpdateRoutingTableOfAreaPayload.java deleted file mode 100644 index dda58532..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/UpdateRoutingTableOfAreaPayload.java +++ /dev/null @@ -1,432 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.model; - -import cloud.stackit.sdk.iaas.v2alpha1api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** Object that represents the request body for a routing table update. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class UpdateRoutingTableOfAreaPayload { - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - @javax.annotation.Nullable private String description; - - public static final String SERIALIZED_NAME_DYNAMIC_ROUTES = "dynamicRoutes"; - - @SerializedName(SERIALIZED_NAME_DYNAMIC_ROUTES) - @javax.annotation.Nullable private Boolean dynamicRoutes; - - public static final String SERIALIZED_NAME_LABELS = "labels"; - - @SerializedName(SERIALIZED_NAME_LABELS) - @javax.annotation.Nullable private Object labels; - - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - @javax.annotation.Nullable private String name; - - public static final String SERIALIZED_NAME_SYSTEM_ROUTES = "systemRoutes"; - - @SerializedName(SERIALIZED_NAME_SYSTEM_ROUTES) - @javax.annotation.Nullable private Boolean systemRoutes; - - public UpdateRoutingTableOfAreaPayload() {} - - public UpdateRoutingTableOfAreaPayload description( - @javax.annotation.Nullable String description) { - this.description = description; - return this; - } - - /** - * Description Object. Allows string up to 255 Characters. - * - * @return description - */ - @javax.annotation.Nullable public String getDescription() { - return description; - } - - public void setDescription(@javax.annotation.Nullable String description) { - this.description = description; - } - - public UpdateRoutingTableOfAreaPayload dynamicRoutes( - @javax.annotation.Nullable Boolean dynamicRoutes) { - this.dynamicRoutes = dynamicRoutes; - return this; - } - - /** - * The update config setting for a routing table which allows propagation of dynamic routes to - * this routing table. - * - * @return dynamicRoutes - */ - @javax.annotation.Nullable public Boolean getDynamicRoutes() { - return dynamicRoutes; - } - - public void setDynamicRoutes(@javax.annotation.Nullable Boolean dynamicRoutes) { - this.dynamicRoutes = dynamicRoutes; - } - - public UpdateRoutingTableOfAreaPayload labels(@javax.annotation.Nullable Object labels) { - this.labels = labels; - return this; - } - - /** - * Object that represents the labels as key-value pairs of a resource. Key constraints: - May - * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must - * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain - * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), - * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 - * and 63 characters. - Must begin and end with an alphanumerical character - * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), - * dots (`.`), and alphanumerics in between. - Keys starting with the prefix - * `stackit-` or having a domain prefix of `stackit.cloud` (including its - * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value - * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not - * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May - * contain dashes (`-`), underscores (`_`), dots (`.`), and - * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are - * excluded from this count. Providing a `null` value for a key will remove that key. - * - * @return labels - */ - @javax.annotation.Nullable public Object getLabels() { - return labels; - } - - public void setLabels(@javax.annotation.Nullable Object labels) { - this.labels = labels; - } - - public UpdateRoutingTableOfAreaPayload name(@javax.annotation.Nullable String name) { - this.name = name; - return this; - } - - /** - * The name for a General Object. Matches Names and also UUIDs. - * - * @return name - */ - @javax.annotation.Nullable public String getName() { - return name; - } - - public void setName(@javax.annotation.Nullable String name) { - this.name = name; - } - - public UpdateRoutingTableOfAreaPayload systemRoutes( - @javax.annotation.Nullable Boolean systemRoutes) { - this.systemRoutes = systemRoutes; - return this; - } - - /** - * The update config setting for a routing table which allows installation of automatic system - * routes for connectivity between projects in the same SNA. - * - * @return systemRoutes - */ - @javax.annotation.Nullable public Boolean getSystemRoutes() { - return systemRoutes; - } - - public void setSystemRoutes(@javax.annotation.Nullable Boolean systemRoutes) { - this.systemRoutes = systemRoutes; - } - - /** - * 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. - * - * @param key name of the property - * @param value value of the property - * @return the UpdateRoutingTableOfAreaPayload instance itself - */ - public UpdateRoutingTableOfAreaPayload 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. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - 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; - } - UpdateRoutingTableOfAreaPayload updateRoutingTableOfAreaPayload = - (UpdateRoutingTableOfAreaPayload) o; - return Objects.equals(this.description, updateRoutingTableOfAreaPayload.description) - && Objects.equals(this.dynamicRoutes, updateRoutingTableOfAreaPayload.dynamicRoutes) - && Objects.equals(this.labels, updateRoutingTableOfAreaPayload.labels) - && Objects.equals(this.name, updateRoutingTableOfAreaPayload.name) - && Objects.equals(this.systemRoutes, updateRoutingTableOfAreaPayload.systemRoutes) - && Objects.equals( - this.additionalProperties, - updateRoutingTableOfAreaPayload.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash( - description, dynamicRoutes, labels, name, systemRoutes, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UpdateRoutingTableOfAreaPayload {\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" dynamicRoutes: ").append(toIndentedString(dynamicRoutes)).append("\n"); - sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" systemRoutes: ").append(toIndentedString(systemRoutes)).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( - Arrays.asList( - "description", "dynamicRoutes", "labels", "name", "systemRoutes")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(0); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * UpdateRoutingTableOfAreaPayload - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UpdateRoutingTableOfAreaPayload.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field(s) %s in UpdateRoutingTableOfAreaPayload is not found in the empty JSON string", - UpdateRoutingTableOfAreaPayload.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) - && !jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `description` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("description").toString())); - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) - && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "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 (!UpdateRoutingTableOfAreaPayload.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UpdateRoutingTableOfAreaPayload' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(UpdateRoutingTableOfAreaPayload.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, UpdateRoutingTableOfAreaPayload value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional 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 { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public UpdateRoutingTableOfAreaPayload read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - UpdateRoutingTableOfAreaPayload 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( - java.util.Locale.ROOT, - "The field `%s` has unknown primitive type. Value: %s", - entry.getKey(), - entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - }.nullSafe(); - } - } - - /** - * Create an instance of UpdateRoutingTableOfAreaPayload given an JSON string - * - * @param jsonString JSON string - * @return An instance of UpdateRoutingTableOfAreaPayload - * @throws IOException if the JSON string is invalid with respect to - * UpdateRoutingTableOfAreaPayload - */ - public static UpdateRoutingTableOfAreaPayload fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UpdateRoutingTableOfAreaPayload.class); - } - - /** - * Convert an instance of UpdateRoutingTableOfAreaPayload to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/UpdateVPCNetworkRangePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/UpdateVPCNetworkRangePayload.java deleted file mode 100644 index 6ca0b84e..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/UpdateVPCNetworkRangePayload.java +++ /dev/null @@ -1,234 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.model; - -import cloud.stackit.sdk.iaas.v2alpha1api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Map; -import java.util.logging.Level; -import java.util.logging.Logger; - -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class UpdateVPCNetworkRangePayload extends AbstractOpenApiSchema { - private static final Logger log = - Logger.getLogger(UpdateVPCNetworkRangePayload.class.getName()); - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UpdateVPCNetworkRangePayload.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UpdateVPCNetworkRangePayload' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter adapterV1UpdateVPCNetworkRangeIPv4 = - gson.getDelegateAdapter(this, TypeToken.get(V1UpdateVPCNetworkRangeIPv4.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, UpdateVPCNetworkRangePayload value) - throws IOException { - if (value == null || value.getActualInstance() == null) { - elementAdapter.write(out, null); - return; - } - - // check if the actual instance is of the type - // `V1UpdateVPCNetworkRangeIPv4` - if (value.getActualInstance() instanceof V1UpdateVPCNetworkRangeIPv4) { - JsonElement element = - adapterV1UpdateVPCNetworkRangeIPv4.toJsonTree( - (V1UpdateVPCNetworkRangeIPv4) - value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - throw new IOException( - "Failed to serialize as the type doesn't match oneOf schemas: V1UpdateVPCNetworkRangeIPv4"); - } - - @Override - public UpdateVPCNetworkRangePayload read(JsonReader in) throws IOException { - Object deserialized = null; - JsonElement jsonElement = elementAdapter.read(in); - - int match = 0; - ArrayList errorMessages = new ArrayList<>(); - TypeAdapter actualAdapter = elementAdapter; - - // deserialize V1UpdateVPCNetworkRangeIPv4 - try { - // validate the JSON object to see if any exception is thrown - V1UpdateVPCNetworkRangeIPv4.validateJsonElement(jsonElement); - actualAdapter = adapterV1UpdateVPCNetworkRangeIPv4; - match++; - log.log( - Level.FINER, - "Input data matches schema 'V1UpdateVPCNetworkRangeIPv4'"); - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - java.util.Locale.ROOT, - "Deserialization for V1UpdateVPCNetworkRangeIPv4 failed with `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema 'V1UpdateVPCNetworkRangeIPv4'", - e); - } - - if (match == 1) { - UpdateVPCNetworkRangePayload ret = - new UpdateVPCNetworkRangePayload(); - ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); - return ret; - } - - throw new IOException( - String.format( - java.util.Locale.ROOT, - "Failed deserialization for UpdateVPCNetworkRangePayload: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", - match, - errorMessages, - jsonElement.toString())); - } - }.nullSafe(); - } - } - - // store a list of schema names defined in oneOf - public static final Map> schemas = new HashMap>(); - - public UpdateVPCNetworkRangePayload() { - super("oneOf", Boolean.FALSE); - } - - public UpdateVPCNetworkRangePayload(Object o) { - super("oneOf", Boolean.FALSE); - setActualInstance(o); - } - - static { - schemas.put("V1UpdateVPCNetworkRangeIPv4", V1UpdateVPCNetworkRangeIPv4.class); - } - - @Override - public Map> getSchemas() { - return UpdateVPCNetworkRangePayload.schemas; - } - - /** - * Set the instance that matches the oneOf child schema, check the instance parameter is valid - * against the oneOf child schemas: V1UpdateVPCNetworkRangeIPv4 - * - *

It could be an instance of the 'oneOf' schemas. - */ - @Override - public void setActualInstance(Object instance) { - if (instance instanceof V1UpdateVPCNetworkRangeIPv4) { - super.setActualInstance(instance); - return; - } - - throw new RuntimeException("Invalid instance type. Must be V1UpdateVPCNetworkRangeIPv4"); - } - - /** - * Get the actual instance, which can be the following: V1UpdateVPCNetworkRangeIPv4 - * - * @return The actual instance (V1UpdateVPCNetworkRangeIPv4) - */ - @SuppressWarnings("unchecked") - @Override - public Object getActualInstance() { - return super.getActualInstance(); - } - - /** - * Get the actual instance of `V1UpdateVPCNetworkRangeIPv4`. If the actual instance is not - * `V1UpdateVPCNetworkRangeIPv4`, the ClassCastException will be thrown. - * - * @return The actual instance of `V1UpdateVPCNetworkRangeIPv4` - * @throws ClassCastException if the instance is not `V1UpdateVPCNetworkRangeIPv4` - */ - public V1UpdateVPCNetworkRangeIPv4 getV1UpdateVPCNetworkRangeIPv4() throws ClassCastException { - return (V1UpdateVPCNetworkRangeIPv4) super.getActualInstance(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * UpdateVPCNetworkRangePayload - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - // validate oneOf schemas one by one - int validCount = 0; - ArrayList errorMessages = new ArrayList<>(); - // validate the json string with V1UpdateVPCNetworkRangeIPv4 - try { - V1UpdateVPCNetworkRangeIPv4.validateJsonElement(jsonElement); - validCount++; - } catch (Exception e) { - errorMessages.add( - String.format( - java.util.Locale.ROOT, - "Deserialization for V1UpdateVPCNetworkRangeIPv4 failed with `%s`.", - e.getMessage())); - // continue to the next one - } - if (validCount != 1) { - throw new IOException( - String.format( - java.util.Locale.ROOT, - "The JSON string is invalid for UpdateVPCNetworkRangePayload with oneOf schemas: V1UpdateVPCNetworkRangeIPv4. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", - validCount, - errorMessages, - jsonElement.toString())); - } - } - - /** - * Create an instance of UpdateVPCNetworkRangePayload given an JSON string - * - * @param jsonString JSON string - * @return An instance of UpdateVPCNetworkRangePayload - * @throws IOException if the JSON string is invalid with respect to - * UpdateVPCNetworkRangePayload - */ - public static UpdateVPCNetworkRangePayload fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UpdateVPCNetworkRangePayload.class); - } - - /** - * Convert an instance of UpdateVPCNetworkRangePayload to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/UpdateVPCRegionPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/UpdateVPCRegionPayload.java deleted file mode 100644 index 909e5daf..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/UpdateVPCRegionPayload.java +++ /dev/null @@ -1,320 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.model; - -import cloud.stackit.sdk.iaas.v2alpha1api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** The basic properties of a regional VPC. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class UpdateVPCRegionPayload { - public static final String SERIALIZED_NAME_IPV4 = "ipv4"; - - @SerializedName(SERIALIZED_NAME_IPV4) - @javax.annotation.Nullable private RegionalVPCIPv4 ipv4; - - public static final String SERIALIZED_NAME_STATUS = "status"; - - @SerializedName(SERIALIZED_NAME_STATUS) - @javax.annotation.Nullable private String status; - - public UpdateVPCRegionPayload() {} - - public UpdateVPCRegionPayload(String status) { - this(); - this.status = status; - } - - public UpdateVPCRegionPayload ipv4(@javax.annotation.Nullable RegionalVPCIPv4 ipv4) { - this.ipv4 = ipv4; - return this; - } - - /** - * Get ipv4 - * - * @return ipv4 - */ - @javax.annotation.Nullable public RegionalVPCIPv4 getIpv4() { - return ipv4; - } - - public void setIpv4(@javax.annotation.Nullable RegionalVPCIPv4 ipv4) { - this.ipv4 = ipv4; - } - - /** - * The state of a resource object. Possible values: `CREATING`, `CREATED`, - * `DELETING`, `DELETED`, `FAILED`, `UPDATED`, - * `UPDATING`. - * - * @return status - */ - @javax.annotation.Nullable public String getStatus() { - return status; - } - - /** - * 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. - * - * @param key name of the property - * @param value value of the property - * @return the UpdateVPCRegionPayload instance itself - */ - public UpdateVPCRegionPayload 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. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - 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; - } - UpdateVPCRegionPayload updateVPCRegionPayload = (UpdateVPCRegionPayload) o; - return Objects.equals(this.ipv4, updateVPCRegionPayload.ipv4) - && Objects.equals(this.status, updateVPCRegionPayload.status) - && Objects.equals( - this.additionalProperties, updateVPCRegionPayload.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(ipv4, status, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UpdateVPCRegionPayload {\n"); - sb.append(" ipv4: ").append(toIndentedString(ipv4)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).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(Arrays.asList("ipv4", "status")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(0); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UpdateVPCRegionPayload - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UpdateVPCRegionPayload.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field(s) %s in UpdateVPCRegionPayload is not found in the empty JSON string", - UpdateVPCRegionPayload.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `ipv4` - if (jsonObj.get("ipv4") != null && !jsonObj.get("ipv4").isJsonNull()) { - RegionalVPCIPv4.validateJsonElement(jsonObj.get("ipv4")); - } - if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) - && !jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `status` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("status").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UpdateVPCRegionPayload.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UpdateVPCRegionPayload' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(UpdateVPCRegionPayload.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, UpdateVPCRegionPayload value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional 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 { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public UpdateVPCRegionPayload read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - UpdateVPCRegionPayload 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( - java.util.Locale.ROOT, - "The field `%s` has unknown primitive type. Value: %s", - entry.getKey(), - entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - }.nullSafe(); - } - } - - /** - * Create an instance of UpdateVPCRegionPayload given an JSON string - * - * @param jsonString JSON string - * @return An instance of UpdateVPCRegionPayload - * @throws IOException if the JSON string is invalid with respect to UpdateVPCRegionPayload - */ - public static UpdateVPCRegionPayload fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UpdateVPCRegionPayload.class); - } - - /** - * Convert an instance of UpdateVPCRegionPayload to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/UpdateVPCRoutingTablePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/UpdateVPCRoutingTablePayload.java deleted file mode 100644 index 6271b162..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/UpdateVPCRoutingTablePayload.java +++ /dev/null @@ -1,430 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.model; - -import cloud.stackit.sdk.iaas.v2alpha1api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** Object that represents the request body for a routing table update. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class UpdateVPCRoutingTablePayload { - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - @javax.annotation.Nullable private String description; - - public static final String SERIALIZED_NAME_DYNAMIC_ROUTES = "dynamicRoutes"; - - @SerializedName(SERIALIZED_NAME_DYNAMIC_ROUTES) - @javax.annotation.Nullable private Boolean dynamicRoutes; - - public static final String SERIALIZED_NAME_LABELS = "labels"; - - @SerializedName(SERIALIZED_NAME_LABELS) - @javax.annotation.Nullable private Object labels; - - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - @javax.annotation.Nullable private String name; - - public static final String SERIALIZED_NAME_SYSTEM_ROUTES = "systemRoutes"; - - @SerializedName(SERIALIZED_NAME_SYSTEM_ROUTES) - @javax.annotation.Nullable private Boolean systemRoutes; - - public UpdateVPCRoutingTablePayload() {} - - public UpdateVPCRoutingTablePayload description(@javax.annotation.Nullable String description) { - this.description = description; - return this; - } - - /** - * Description Object. Allows string up to 255 Characters. - * - * @return description - */ - @javax.annotation.Nullable public String getDescription() { - return description; - } - - public void setDescription(@javax.annotation.Nullable String description) { - this.description = description; - } - - public UpdateVPCRoutingTablePayload dynamicRoutes( - @javax.annotation.Nullable Boolean dynamicRoutes) { - this.dynamicRoutes = dynamicRoutes; - return this; - } - - /** - * The update config setting for a routing table which allows propagation of dynamic routes to - * this routing table. - * - * @return dynamicRoutes - */ - @javax.annotation.Nullable public Boolean getDynamicRoutes() { - return dynamicRoutes; - } - - public void setDynamicRoutes(@javax.annotation.Nullable Boolean dynamicRoutes) { - this.dynamicRoutes = dynamicRoutes; - } - - public UpdateVPCRoutingTablePayload labels(@javax.annotation.Nullable Object labels) { - this.labels = labels; - return this; - } - - /** - * Object that represents the labels as key-value pairs of a resource. Key constraints: - May - * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must - * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain - * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), - * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 - * and 63 characters. - Must begin and end with an alphanumerical character - * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), - * dots (`.`), and alphanumerics in between. - Keys starting with the prefix - * `stackit-` or having a domain prefix of `stackit.cloud` (including its - * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value - * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not - * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May - * contain dashes (`-`), underscores (`_`), dots (`.`), and - * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are - * excluded from this count. Providing a `null` value for a key will remove that key. - * - * @return labels - */ - @javax.annotation.Nullable public Object getLabels() { - return labels; - } - - public void setLabels(@javax.annotation.Nullable Object labels) { - this.labels = labels; - } - - public UpdateVPCRoutingTablePayload name(@javax.annotation.Nullable String name) { - this.name = name; - return this; - } - - /** - * The name for a General Object. Matches Names and also UUIDs. - * - * @return name - */ - @javax.annotation.Nullable public String getName() { - return name; - } - - public void setName(@javax.annotation.Nullable String name) { - this.name = name; - } - - public UpdateVPCRoutingTablePayload systemRoutes( - @javax.annotation.Nullable Boolean systemRoutes) { - this.systemRoutes = systemRoutes; - return this; - } - - /** - * The update config setting for a routing table which allows installation of automatic system - * routes for connectivity between projects in the same SNA. - * - * @return systemRoutes - */ - @javax.annotation.Nullable public Boolean getSystemRoutes() { - return systemRoutes; - } - - public void setSystemRoutes(@javax.annotation.Nullable Boolean systemRoutes) { - this.systemRoutes = systemRoutes; - } - - /** - * 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. - * - * @param key name of the property - * @param value value of the property - * @return the UpdateVPCRoutingTablePayload instance itself - */ - public UpdateVPCRoutingTablePayload 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. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - 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; - } - UpdateVPCRoutingTablePayload updateVPCRoutingTablePayload = - (UpdateVPCRoutingTablePayload) o; - return Objects.equals(this.description, updateVPCRoutingTablePayload.description) - && Objects.equals(this.dynamicRoutes, updateVPCRoutingTablePayload.dynamicRoutes) - && Objects.equals(this.labels, updateVPCRoutingTablePayload.labels) - && Objects.equals(this.name, updateVPCRoutingTablePayload.name) - && Objects.equals(this.systemRoutes, updateVPCRoutingTablePayload.systemRoutes) - && Objects.equals( - this.additionalProperties, - updateVPCRoutingTablePayload.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash( - description, dynamicRoutes, labels, name, systemRoutes, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UpdateVPCRoutingTablePayload {\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" dynamicRoutes: ").append(toIndentedString(dynamicRoutes)).append("\n"); - sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" systemRoutes: ").append(toIndentedString(systemRoutes)).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( - Arrays.asList( - "description", "dynamicRoutes", "labels", "name", "systemRoutes")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(0); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * UpdateVPCRoutingTablePayload - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UpdateVPCRoutingTablePayload.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field(s) %s in UpdateVPCRoutingTablePayload is not found in the empty JSON string", - UpdateVPCRoutingTablePayload.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) - && !jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `description` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("description").toString())); - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) - && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "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 (!UpdateVPCRoutingTablePayload.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UpdateVPCRoutingTablePayload' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(UpdateVPCRoutingTablePayload.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, UpdateVPCRoutingTablePayload value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional 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 { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public UpdateVPCRoutingTablePayload read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - UpdateVPCRoutingTablePayload 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( - java.util.Locale.ROOT, - "The field `%s` has unknown primitive type. Value: %s", - entry.getKey(), - entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - }.nullSafe(); - } - } - - /** - * Create an instance of UpdateVPCRoutingTablePayload given an JSON string - * - * @param jsonString JSON string - * @return An instance of UpdateVPCRoutingTablePayload - * @throws IOException if the JSON string is invalid with respect to - * UpdateVPCRoutingTablePayload - */ - public static UpdateVPCRoutingTablePayload fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UpdateVPCRoutingTablePayload.class); - } - - /** - * Convert an instance of UpdateVPCRoutingTablePayload to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/UpdateVPCStaticRoutePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/UpdateVPCStaticRoutePayload.java deleted file mode 100644 index 347fd0e6..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/UpdateVPCStaticRoutePayload.java +++ /dev/null @@ -1,303 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.model; - -import cloud.stackit.sdk.iaas.v2alpha1api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** Object that represents the request body for a route update. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class UpdateVPCStaticRoutePayload { - public static final String SERIALIZED_NAME_LABELS = "labels"; - - @SerializedName(SERIALIZED_NAME_LABELS) - @javax.annotation.Nullable private Object labels; - - public UpdateVPCStaticRoutePayload() {} - - public UpdateVPCStaticRoutePayload labels(@javax.annotation.Nullable Object labels) { - this.labels = labels; - return this; - } - - /** - * Object that represents the labels as key-value pairs of a resource. Key constraints: - May - * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must - * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain - * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), - * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 - * and 63 characters. - Must begin and end with an alphanumerical character - * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), - * dots (`.`), and alphanumerics in between. - Keys starting with the prefix - * `stackit-` or having a domain prefix of `stackit.cloud` (including its - * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value - * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not - * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May - * contain dashes (`-`), underscores (`_`), dots (`.`), and - * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are - * excluded from this count. Providing a `null` value for a key will remove that key. - * - * @return labels - */ - @javax.annotation.Nullable public Object getLabels() { - return labels; - } - - public void setLabels(@javax.annotation.Nullable Object labels) { - this.labels = labels; - } - - /** - * 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. - * - * @param key name of the property - * @param value value of the property - * @return the UpdateVPCStaticRoutePayload instance itself - */ - public UpdateVPCStaticRoutePayload 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. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - 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; - } - UpdateVPCStaticRoutePayload updateVPCStaticRoutePayload = (UpdateVPCStaticRoutePayload) o; - return Objects.equals(this.labels, updateVPCStaticRoutePayload.labels) - && Objects.equals( - this.additionalProperties, - updateVPCStaticRoutePayload.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(labels, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UpdateVPCStaticRoutePayload {\n"); - sb.append(" labels: ").append(toIndentedString(labels)).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(Arrays.asList("labels")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(0); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * UpdateVPCStaticRoutePayload - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UpdateVPCStaticRoutePayload.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field(s) %s in UpdateVPCStaticRoutePayload is not found in the empty JSON string", - UpdateVPCStaticRoutePayload.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UpdateVPCStaticRoutePayload.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UpdateVPCStaticRoutePayload' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(UpdateVPCStaticRoutePayload.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, UpdateVPCStaticRoutePayload value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional 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 { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public UpdateVPCStaticRoutePayload read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - UpdateVPCStaticRoutePayload 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( - java.util.Locale.ROOT, - "The field `%s` has unknown primitive type. Value: %s", - entry.getKey(), - entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - }.nullSafe(); - } - } - - /** - * Create an instance of UpdateVPCStaticRoutePayload given an JSON string - * - * @param jsonString JSON string - * @return An instance of UpdateVPCStaticRoutePayload - * @throws IOException if the JSON string is invalid with respect to UpdateVPCStaticRoutePayload - */ - public static UpdateVPCStaticRoutePayload fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UpdateVPCStaticRoutePayload.class); - } - - /** - * Convert an instance of UpdateVPCStaticRoutePayload to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/V1UpdateVPCNetworkRangeIPv4.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/V1UpdateVPCNetworkRangeIPv4.java deleted file mode 100644 index ac0c6613..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/V1UpdateVPCNetworkRangeIPv4.java +++ /dev/null @@ -1,575 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.model; - -import cloud.stackit.sdk.iaas.v2alpha1api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** Contains the IPv4 properties of a VPC network range update. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class V1UpdateVPCNetworkRangeIPv4 { - public static final String SERIALIZED_NAME_DEFAULT_PREFIX_LEN = "defaultPrefixLen"; - - @SerializedName(SERIALIZED_NAME_DEFAULT_PREFIX_LEN) - @javax.annotation.Nullable private Long defaultPrefixLen; - - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - @javax.annotation.Nullable private String description; - - /** The IP version of the network range being updated. */ - @JsonAdapter(IpVersionEnum.Adapter.class) - public enum IpVersionEnum { - IPV4("ipv4"), - - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - IpVersionEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static IpVersionEnum fromValue(String value) { - for (IpVersionEnum b : IpVersionEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final IpVersionEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public IpVersionEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return IpVersionEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - IpVersionEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_IP_VERSION = "ipVersion"; - - @SerializedName(SERIALIZED_NAME_IP_VERSION) - @javax.annotation.Nonnull - private IpVersionEnum ipVersion; - - public static final String SERIALIZED_NAME_LABELS = "labels"; - - @SerializedName(SERIALIZED_NAME_LABELS) - @javax.annotation.Nullable private Object labels; - - public static final String SERIALIZED_NAME_MAX_PREFIX_LEN = "maxPrefixLen"; - - @SerializedName(SERIALIZED_NAME_MAX_PREFIX_LEN) - @javax.annotation.Nullable private Long maxPrefixLen; - - public static final String SERIALIZED_NAME_MIN_PREFIX_LEN = "minPrefixLen"; - - @SerializedName(SERIALIZED_NAME_MIN_PREFIX_LEN) - @javax.annotation.Nullable private Long minPrefixLen; - - public static final String SERIALIZED_NAME_NAMESERVERS = "nameservers"; - - @SerializedName(SERIALIZED_NAME_NAMESERVERS) - @javax.annotation.Nullable private List nameservers = new ArrayList<>(); - - public V1UpdateVPCNetworkRangeIPv4() {} - - public V1UpdateVPCNetworkRangeIPv4 defaultPrefixLen( - @javax.annotation.Nullable Long defaultPrefixLen) { - this.defaultPrefixLen = defaultPrefixLen; - return this; - } - - /** - * The default prefix length for network ranges in the VPC. minimum: 24 maximum: 29 - * - * @return defaultPrefixLen - */ - @javax.annotation.Nullable public Long getDefaultPrefixLen() { - return defaultPrefixLen; - } - - public void setDefaultPrefixLen(@javax.annotation.Nullable Long defaultPrefixLen) { - this.defaultPrefixLen = defaultPrefixLen; - } - - public V1UpdateVPCNetworkRangeIPv4 description(@javax.annotation.Nullable String description) { - this.description = description; - return this; - } - - /** - * Description Object. Allows string up to 255 Characters. - * - * @return description - */ - @javax.annotation.Nullable public String getDescription() { - return description; - } - - public void setDescription(@javax.annotation.Nullable String description) { - this.description = description; - } - - public V1UpdateVPCNetworkRangeIPv4 ipVersion( - @javax.annotation.Nonnull IpVersionEnum ipVersion) { - this.ipVersion = ipVersion; - return this; - } - - /** - * The IP version of the network range being updated. - * - * @return ipVersion - */ - @javax.annotation.Nonnull - public IpVersionEnum getIpVersion() { - return ipVersion; - } - - public void setIpVersion(@javax.annotation.Nonnull IpVersionEnum ipVersion) { - this.ipVersion = ipVersion; - } - - public V1UpdateVPCNetworkRangeIPv4 labels(@javax.annotation.Nullable Object labels) { - this.labels = labels; - return this; - } - - /** - * Object that represents the labels as key-value pairs of a resource. Key constraints: - May - * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must - * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain - * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), - * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 - * and 63 characters. - Must begin and end with an alphanumerical character - * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), - * dots (`.`), and alphanumerics in between. - Keys starting with the prefix - * `stackit-` or having a domain prefix of `stackit.cloud` (including its - * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value - * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not - * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May - * contain dashes (`-`), underscores (`_`), dots (`.`), and - * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are - * excluded from this count. Providing a `null` value for a key will remove that key. - * - * @return labels - */ - @javax.annotation.Nullable public Object getLabels() { - return labels; - } - - public void setLabels(@javax.annotation.Nullable Object labels) { - this.labels = labels; - } - - public V1UpdateVPCNetworkRangeIPv4 maxPrefixLen(@javax.annotation.Nullable Long maxPrefixLen) { - this.maxPrefixLen = maxPrefixLen; - return this; - } - - /** - * The maximal prefix length for network ranges in the VPC. minimum: 24 maximum: 29 - * - * @return maxPrefixLen - */ - @javax.annotation.Nullable public Long getMaxPrefixLen() { - return maxPrefixLen; - } - - public void setMaxPrefixLen(@javax.annotation.Nullable Long maxPrefixLen) { - this.maxPrefixLen = maxPrefixLen; - } - - public V1UpdateVPCNetworkRangeIPv4 minPrefixLen(@javax.annotation.Nullable Long minPrefixLen) { - this.minPrefixLen = minPrefixLen; - return this; - } - - /** - * The minimal prefix length for network ranges in the VPC. minimum: 8 maximum: 29 - * - * @return minPrefixLen - */ - @javax.annotation.Nullable public Long getMinPrefixLen() { - return minPrefixLen; - } - - public void setMinPrefixLen(@javax.annotation.Nullable Long minPrefixLen) { - this.minPrefixLen = minPrefixLen; - } - - public V1UpdateVPCNetworkRangeIPv4 nameservers( - @javax.annotation.Nullable List nameservers) { - this.nameservers = nameservers; - return this; - } - - public V1UpdateVPCNetworkRangeIPv4 addNameserversItem(String nameserversItem) { - if (this.nameservers == null) { - this.nameservers = new ArrayList<>(); - } - this.nameservers.add(nameserversItem); - return this; - } - - /** - * A list containing DNS Servers/Nameservers for IPv4. - * - * @return nameservers - */ - @javax.annotation.Nullable public List getNameservers() { - return nameservers; - } - - public void setNameservers(@javax.annotation.Nullable List nameservers) { - this.nameservers = nameservers; - } - - /** - * 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. - * - * @param key name of the property - * @param value value of the property - * @return the V1UpdateVPCNetworkRangeIPv4 instance itself - */ - public V1UpdateVPCNetworkRangeIPv4 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. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - 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; - } - V1UpdateVPCNetworkRangeIPv4 v1UpdateVPCNetworkRangeIPv4 = (V1UpdateVPCNetworkRangeIPv4) o; - return Objects.equals(this.defaultPrefixLen, v1UpdateVPCNetworkRangeIPv4.defaultPrefixLen) - && Objects.equals(this.description, v1UpdateVPCNetworkRangeIPv4.description) - && Objects.equals(this.ipVersion, v1UpdateVPCNetworkRangeIPv4.ipVersion) - && Objects.equals(this.labels, v1UpdateVPCNetworkRangeIPv4.labels) - && Objects.equals(this.maxPrefixLen, v1UpdateVPCNetworkRangeIPv4.maxPrefixLen) - && Objects.equals(this.minPrefixLen, v1UpdateVPCNetworkRangeIPv4.minPrefixLen) - && Objects.equals(this.nameservers, v1UpdateVPCNetworkRangeIPv4.nameservers) - && Objects.equals( - this.additionalProperties, - v1UpdateVPCNetworkRangeIPv4.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash( - defaultPrefixLen, - description, - ipVersion, - labels, - maxPrefixLen, - minPrefixLen, - nameservers, - additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1UpdateVPCNetworkRangeIPv4 {\n"); - sb.append(" defaultPrefixLen: ").append(toIndentedString(defaultPrefixLen)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" ipVersion: ").append(toIndentedString(ipVersion)).append("\n"); - sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); - sb.append(" maxPrefixLen: ").append(toIndentedString(maxPrefixLen)).append("\n"); - sb.append(" minPrefixLen: ").append(toIndentedString(minPrefixLen)).append("\n"); - sb.append(" nameservers: ").append(toIndentedString(nameservers)).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( - Arrays.asList( - "defaultPrefixLen", - "description", - "ipVersion", - "labels", - "maxPrefixLen", - "minPrefixLen", - "nameservers")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("ipVersion")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * V1UpdateVPCNetworkRangeIPv4 - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!V1UpdateVPCNetworkRangeIPv4.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field(s) %s in V1UpdateVPCNetworkRangeIPv4 is not found in the empty JSON string", - V1UpdateVPCNetworkRangeIPv4.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1UpdateVPCNetworkRangeIPv4.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field `%s` is not found in the JSON string: %s", - requiredField, - jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) - && !jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `description` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("description").toString())); - } - if (!jsonObj.get("ipVersion").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `ipVersion` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("ipVersion").toString())); - } - // validate the required field `ipVersion` - IpVersionEnum.validateJsonElement(jsonObj.get("ipVersion")); - // ensure the optional json data is an array if present - if (jsonObj.get("nameservers") != null - && !jsonObj.get("nameservers").isJsonNull() - && !jsonObj.get("nameservers").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `nameservers` to be an array in the JSON string but got `%s`", - jsonObj.get("nameservers").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1UpdateVPCNetworkRangeIPv4.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1UpdateVPCNetworkRangeIPv4' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(V1UpdateVPCNetworkRangeIPv4.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, V1UpdateVPCNetworkRangeIPv4 value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional 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 { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public V1UpdateVPCNetworkRangeIPv4 read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - V1UpdateVPCNetworkRangeIPv4 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( - java.util.Locale.ROOT, - "The field `%s` has unknown primitive type. Value: %s", - entry.getKey(), - entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - }.nullSafe(); - } - } - - /** - * Create an instance of V1UpdateVPCNetworkRangeIPv4 given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1UpdateVPCNetworkRangeIPv4 - * @throws IOException if the JSON string is invalid with respect to V1UpdateVPCNetworkRangeIPv4 - */ - public static V1UpdateVPCNetworkRangeIPv4 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1UpdateVPCNetworkRangeIPv4.class); - } - - /** - * Convert an instance of V1UpdateVPCNetworkRangeIPv4 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/VPC.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/VPC.java deleted file mode 100644 index eae14495..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/VPC.java +++ /dev/null @@ -1,529 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.model; - -import cloud.stackit.sdk.iaas.v2alpha1api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.UUID; - -/** Object that represents a VPC. Filterable Fields: `name`. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class VPC { - public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; - - @SerializedName(SERIALIZED_NAME_CREATED_AT) - @javax.annotation.Nonnull - private OffsetDateTime createdAt; - - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - @javax.annotation.Nonnull - private String description; - - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - @javax.annotation.Nonnull - private UUID id; - - public static final String SERIALIZED_NAME_LABELS = "labels"; - - @SerializedName(SERIALIZED_NAME_LABELS) - @javax.annotation.Nonnull - private Object labels; - - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - @javax.annotation.Nonnull - private String name; - - public static final String SERIALIZED_NAME_PROJECT_ID = "projectId"; - - @SerializedName(SERIALIZED_NAME_PROJECT_ID) - @javax.annotation.Nonnull - private UUID projectId; - - public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; - - @SerializedName(SERIALIZED_NAME_UPDATED_AT) - @javax.annotation.Nonnull - private OffsetDateTime updatedAt; - - public VPC() {} - - public VPC createdAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { - this.createdAt = createdAt; - return this; - } - - /** - * Date-time when resource was created. - * - * @return createdAt - */ - @javax.annotation.Nonnull - public OffsetDateTime getCreatedAt() { - return createdAt; - } - - public void setCreatedAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { - this.createdAt = createdAt; - } - - public VPC description(@javax.annotation.Nonnull String description) { - this.description = description; - return this; - } - - /** - * Description Object. Allows string up to 255 Characters. - * - * @return description - */ - @javax.annotation.Nonnull - public String getDescription() { - return description; - } - - public void setDescription(@javax.annotation.Nonnull String description) { - this.description = description; - } - - public VPC id(@javax.annotation.Nonnull UUID id) { - this.id = id; - return this; - } - - /** - * Universally Unique Identifier (UUID). - * - * @return id - */ - @javax.annotation.Nonnull - public UUID getId() { - return id; - } - - public void setId(@javax.annotation.Nonnull UUID id) { - this.id = id; - } - - public VPC labels(@javax.annotation.Nonnull Object labels) { - this.labels = labels; - return this; - } - - /** - * Object that represents the labels as key-value pairs of a resource. Key constraints: - May - * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must - * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain - * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), - * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 - * and 63 characters. - Must begin and end with an alphanumerical character - * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), - * dots (`.`), and alphanumerics in between. - Keys starting with the prefix - * `stackit-` or having a domain prefix of `stackit.cloud` (including its - * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value - * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not - * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May - * contain dashes (`-`), underscores (`_`), dots (`.`), and - * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are - * excluded from this count. Providing a `null` value for a key will remove that key. - * - * @return labels - */ - @javax.annotation.Nonnull - public Object getLabels() { - return labels; - } - - public void setLabels(@javax.annotation.Nonnull Object labels) { - this.labels = labels; - } - - public VPC name(@javax.annotation.Nonnull String name) { - this.name = name; - return this; - } - - /** - * The name for a General Object. Matches Names and also UUIDs. - * - * @return name - */ - @javax.annotation.Nonnull - public String getName() { - return name; - } - - public void setName(@javax.annotation.Nonnull String name) { - this.name = name; - } - - public VPC projectId(@javax.annotation.Nonnull UUID projectId) { - this.projectId = projectId; - return this; - } - - /** - * Universally Unique Identifier (UUID). - * - * @return projectId - */ - @javax.annotation.Nonnull - public UUID getProjectId() { - return projectId; - } - - public void setProjectId(@javax.annotation.Nonnull UUID projectId) { - this.projectId = projectId; - } - - public VPC updatedAt(@javax.annotation.Nonnull OffsetDateTime updatedAt) { - this.updatedAt = updatedAt; - return this; - } - - /** - * Date-time when resource was last updated. - * - * @return updatedAt - */ - @javax.annotation.Nonnull - public OffsetDateTime getUpdatedAt() { - return updatedAt; - } - - public void setUpdatedAt(@javax.annotation.Nonnull OffsetDateTime updatedAt) { - this.updatedAt = updatedAt; - } - - /** - * 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. - * - * @param key name of the property - * @param value value of the property - * @return the VPC instance itself - */ - public VPC 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. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - 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; - } - VPC VPC = (VPC) o; - return Objects.equals(this.createdAt, VPC.createdAt) - && Objects.equals(this.description, VPC.description) - && Objects.equals(this.id, VPC.id) - && Objects.equals(this.labels, VPC.labels) - && Objects.equals(this.name, VPC.name) - && Objects.equals(this.projectId, VPC.projectId) - && Objects.equals(this.updatedAt, VPC.updatedAt) - && Objects.equals(this.additionalProperties, VPC.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash( - createdAt, - description, - id, - labels, - name, - projectId, - updatedAt, - additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class VPC {\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" projectId: ").append(toIndentedString(projectId)).append("\n"); - sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).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( - Arrays.asList( - "createdAt", - "description", - "id", - "labels", - "name", - "projectId", - "updatedAt")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = - new HashSet( - Arrays.asList( - "createdAt", - "description", - "id", - "labels", - "name", - "projectId", - "updatedAt")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to VPC - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!VPC.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field(s) %s in VPC is not found in the empty JSON string", - VPC.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : VPC.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field `%s` is not found in the JSON string: %s", - requiredField, - jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `description` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("description").toString())); - } - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `id` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("id").toString())); - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `name` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("name").toString())); - } - if (!jsonObj.get("projectId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `projectId` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("projectId").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!VPC.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'VPC' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(VPC.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, VPC value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional 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 { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public VPC read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - VPC 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( - java.util.Locale.ROOT, - "The field `%s` has unknown primitive type. Value: %s", - entry.getKey(), - entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - }.nullSafe(); - } - } - - /** - * Create an instance of VPC given an JSON string - * - * @param jsonString JSON string - * @return An instance of VPC - * @throws IOException if the JSON string is invalid with respect to VPC - */ - public static VPC fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, VPC.class); - } - - /** - * Convert an instance of VPC to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/VPCBaseNetworkRange.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/VPCBaseNetworkRange.java deleted file mode 100644 index fc64e6d1..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/VPCBaseNetworkRange.java +++ /dev/null @@ -1,436 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.model; - -import cloud.stackit.sdk.iaas.v2alpha1api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.UUID; - -/** Contains the common properties of a VPC network range. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class VPCBaseNetworkRange { - public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; - - @SerializedName(SERIALIZED_NAME_CREATED_AT) - @javax.annotation.Nullable private OffsetDateTime createdAt; - - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - @javax.annotation.Nullable private String description; - - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - @javax.annotation.Nullable private UUID id; - - public static final String SERIALIZED_NAME_LABELS = "labels"; - - @SerializedName(SERIALIZED_NAME_LABELS) - @javax.annotation.Nullable private Object labels; - - public static final String SERIALIZED_NAME_STATUS = "status"; - - @SerializedName(SERIALIZED_NAME_STATUS) - @javax.annotation.Nullable private String status; - - public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; - - @SerializedName(SERIALIZED_NAME_UPDATED_AT) - @javax.annotation.Nullable private OffsetDateTime updatedAt; - - public VPCBaseNetworkRange() {} - - public VPCBaseNetworkRange(OffsetDateTime createdAt, UUID id, OffsetDateTime updatedAt) { - this(); - this.createdAt = createdAt; - this.id = id; - this.updatedAt = updatedAt; - } - - /** - * Date-time when resource was created. - * - * @return createdAt - */ - @javax.annotation.Nullable public OffsetDateTime getCreatedAt() { - return createdAt; - } - - public VPCBaseNetworkRange description(@javax.annotation.Nullable String description) { - this.description = description; - return this; - } - - /** - * Description Object. Allows string up to 255 Characters. - * - * @return description - */ - @javax.annotation.Nullable public String getDescription() { - return description; - } - - public void setDescription(@javax.annotation.Nullable String description) { - this.description = description; - } - - /** - * Universally Unique Identifier (UUID). - * - * @return id - */ - @javax.annotation.Nullable public UUID getId() { - return id; - } - - public VPCBaseNetworkRange labels(@javax.annotation.Nullable Object labels) { - this.labels = labels; - return this; - } - - /** - * Object that represents the labels as key-value pairs of a resource. Key constraints: - May - * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must - * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain - * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), - * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 - * and 63 characters. - Must begin and end with an alphanumerical character - * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), - * dots (`.`), and alphanumerics in between. - Keys starting with the prefix - * `stackit-` or having a domain prefix of `stackit.cloud` (including its - * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value - * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not - * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May - * contain dashes (`-`), underscores (`_`), dots (`.`), and - * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are - * excluded from this count. Providing a `null` value for a key will remove that key. - * - * @return labels - */ - @javax.annotation.Nullable public Object getLabels() { - return labels; - } - - public void setLabels(@javax.annotation.Nullable Object labels) { - this.labels = labels; - } - - public VPCBaseNetworkRange status(@javax.annotation.Nullable String status) { - this.status = status; - return this; - } - - /** - * The state of a resource object. Possible values: `CREATING`, `CREATED`, - * `DELETING`, `DELETED`, `FAILED`, `UPDATED`, - * `UPDATING`. - * - * @return status - */ - @javax.annotation.Nullable public String getStatus() { - return status; - } - - public void setStatus(@javax.annotation.Nullable String status) { - this.status = status; - } - - /** - * Date-time when resource was last updated. - * - * @return updatedAt - */ - @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { - return updatedAt; - } - - /** - * 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. - * - * @param key name of the property - * @param value value of the property - * @return the VPCBaseNetworkRange instance itself - */ - public VPCBaseNetworkRange 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. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - 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; - } - VPCBaseNetworkRange vpCBaseNetworkRange = (VPCBaseNetworkRange) o; - return Objects.equals(this.createdAt, vpCBaseNetworkRange.createdAt) - && Objects.equals(this.description, vpCBaseNetworkRange.description) - && Objects.equals(this.id, vpCBaseNetworkRange.id) - && Objects.equals(this.labels, vpCBaseNetworkRange.labels) - && Objects.equals(this.status, vpCBaseNetworkRange.status) - && Objects.equals(this.updatedAt, vpCBaseNetworkRange.updatedAt) - && Objects.equals( - this.additionalProperties, vpCBaseNetworkRange.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash( - createdAt, description, id, labels, status, updatedAt, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class VPCBaseNetworkRange {\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).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( - Arrays.asList( - "createdAt", "description", "id", "labels", "status", "updatedAt")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(0); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to VPCBaseNetworkRange - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!VPCBaseNetworkRange.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field(s) %s in VPCBaseNetworkRange is not found in the empty JSON string", - VPCBaseNetworkRange.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) - && !jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `description` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("description").toString())); - } - if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) - && !jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `id` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("id").toString())); - } - if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) - && !jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `status` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("status").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!VPCBaseNetworkRange.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'VPCBaseNetworkRange' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(VPCBaseNetworkRange.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, VPCBaseNetworkRange value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional 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 { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public VPCBaseNetworkRange read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - VPCBaseNetworkRange 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( - java.util.Locale.ROOT, - "The field `%s` has unknown primitive type. Value: %s", - entry.getKey(), - entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - }.nullSafe(); - } - } - - /** - * Create an instance of VPCBaseNetworkRange given an JSON string - * - * @param jsonString JSON string - * @return An instance of VPCBaseNetworkRange - * @throws IOException if the JSON string is invalid with respect to VPCBaseNetworkRange - */ - public static VPCBaseNetworkRange fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, VPCBaseNetworkRange.class); - } - - /** - * Convert an instance of VPCBaseNetworkRange to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/VPCList.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/VPCList.java deleted file mode 100644 index d3d7f713..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/VPCList.java +++ /dev/null @@ -1,322 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.model; - -import cloud.stackit.sdk.iaas.v2alpha1api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** VPC list response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class VPCList { - public static final String SERIALIZED_NAME_ITEMS = "items"; - - @SerializedName(SERIALIZED_NAME_ITEMS) - @javax.annotation.Nonnull - private List items = new ArrayList<>(); - - public VPCList() {} - - public VPCList items(@javax.annotation.Nonnull List items) { - this.items = items; - return this; - } - - public VPCList addItemsItem(VPC itemsItem) { - if (this.items == null) { - this.items = new ArrayList<>(); - } - this.items.add(itemsItem); - return this; - } - - /** - * A list of VPCs. - * - * @return items - */ - @javax.annotation.Nonnull - public List getItems() { - return items; - } - - public void setItems(@javax.annotation.Nonnull List items) { - this.items = items; - } - - /** - * 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. - * - * @param key name of the property - * @param value value of the property - * @return the VPCList instance itself - */ - public VPCList 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. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - 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; - } - VPCList vpCList = (VPCList) o; - return Objects.equals(this.items, vpCList.items) - && Objects.equals(this.additionalProperties, vpCList.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(items, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class VPCList {\n"); - sb.append(" items: ").append(toIndentedString(items)).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(Arrays.asList("items")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("items")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to VPCList - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!VPCList.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field(s) %s in VPCList is not found in the empty JSON string", - VPCList.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : VPCList.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field `%s` is not found in the JSON string: %s", - requiredField, - jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - VPC.validateJsonElement(jsonArrayitems.get(i)); - } - ; - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!VPCList.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'VPCList' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(VPCList.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, VPCList value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional 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 { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public VPCList read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - VPCList 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( - java.util.Locale.ROOT, - "The field `%s` has unknown primitive type. Value: %s", - entry.getKey(), - entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - }.nullSafe(); - } - } - - /** - * Create an instance of VPCList given an JSON string - * - * @param jsonString JSON string - * @return An instance of VPCList - * @throws IOException if the JSON string is invalid with respect to VPCList - */ - public static VPCList fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, VPCList.class); - } - - /** - * Convert an instance of VPCList to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/VPCNetworkRange.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/VPCNetworkRange.java deleted file mode 100644 index 29f9f987..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/VPCNetworkRange.java +++ /dev/null @@ -1,288 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.model; - -import cloud.stackit.sdk.iaas.v2alpha1api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Map; -import java.util.logging.Level; -import java.util.logging.Logger; - -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class VPCNetworkRange extends AbstractOpenApiSchema { - private static final Logger log = Logger.getLogger(VPCNetworkRange.class.getName()); - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!VPCNetworkRange.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'VPCNetworkRange' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter adapterVPCNetworkRangeIPv4 = - gson.getDelegateAdapter(this, TypeToken.get(VPCNetworkRangeIPv4.class)); - final TypeAdapter adapterVPCNetworkRangeIPv6 = - gson.getDelegateAdapter(this, TypeToken.get(VPCNetworkRangeIPv6.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, VPCNetworkRange value) - throws IOException { - if (value == null || value.getActualInstance() == null) { - elementAdapter.write(out, null); - return; - } - - // check if the actual instance is of the type `VPCNetworkRangeIPv4` - if (value.getActualInstance() instanceof VPCNetworkRangeIPv4) { - JsonElement element = - adapterVPCNetworkRangeIPv4.toJsonTree( - (VPCNetworkRangeIPv4) value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - // check if the actual instance is of the type `VPCNetworkRangeIPv6` - if (value.getActualInstance() instanceof VPCNetworkRangeIPv6) { - JsonElement element = - adapterVPCNetworkRangeIPv6.toJsonTree( - (VPCNetworkRangeIPv6) value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - throw new IOException( - "Failed to serialize as the type doesn't match oneOf schemas: VPCNetworkRangeIPv4, VPCNetworkRangeIPv6"); - } - - @Override - public VPCNetworkRange read(JsonReader in) throws IOException { - Object deserialized = null; - JsonElement jsonElement = elementAdapter.read(in); - - int match = 0; - ArrayList errorMessages = new ArrayList<>(); - TypeAdapter actualAdapter = elementAdapter; - - // deserialize VPCNetworkRangeIPv4 - try { - // validate the JSON object to see if any exception is thrown - VPCNetworkRangeIPv4.validateJsonElement(jsonElement); - actualAdapter = adapterVPCNetworkRangeIPv4; - match++; - log.log( - Level.FINER, - "Input data matches schema 'VPCNetworkRangeIPv4'"); - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - java.util.Locale.ROOT, - "Deserialization for VPCNetworkRangeIPv4 failed with `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema 'VPCNetworkRangeIPv4'", - e); - } - // deserialize VPCNetworkRangeIPv6 - try { - // validate the JSON object to see if any exception is thrown - VPCNetworkRangeIPv6.validateJsonElement(jsonElement); - actualAdapter = adapterVPCNetworkRangeIPv6; - match++; - log.log( - Level.FINER, - "Input data matches schema 'VPCNetworkRangeIPv6'"); - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - java.util.Locale.ROOT, - "Deserialization for VPCNetworkRangeIPv6 failed with `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema 'VPCNetworkRangeIPv6'", - e); - } - - if (match == 1) { - VPCNetworkRange ret = new VPCNetworkRange(); - ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); - return ret; - } - - throw new IOException( - String.format( - java.util.Locale.ROOT, - "Failed deserialization for VPCNetworkRange: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", - match, - errorMessages, - jsonElement.toString())); - } - }.nullSafe(); - } - } - - // store a list of schema names defined in oneOf - public static final Map> schemas = new HashMap>(); - - public VPCNetworkRange() { - super("oneOf", Boolean.FALSE); - } - - public VPCNetworkRange(Object o) { - super("oneOf", Boolean.FALSE); - setActualInstance(o); - } - - static { - schemas.put("VPCNetworkRangeIPv4", VPCNetworkRangeIPv4.class); - schemas.put("VPCNetworkRangeIPv6", VPCNetworkRangeIPv6.class); - } - - @Override - public Map> getSchemas() { - return VPCNetworkRange.schemas; - } - - /** - * Set the instance that matches the oneOf child schema, check the instance parameter is valid - * against the oneOf child schemas: VPCNetworkRangeIPv4, VPCNetworkRangeIPv6 - * - *

It could be an instance of the 'oneOf' schemas. - */ - @Override - public void setActualInstance(Object instance) { - if (instance instanceof VPCNetworkRangeIPv4) { - super.setActualInstance(instance); - return; - } - - if (instance instanceof VPCNetworkRangeIPv6) { - super.setActualInstance(instance); - return; - } - - throw new RuntimeException( - "Invalid instance type. Must be VPCNetworkRangeIPv4, VPCNetworkRangeIPv6"); - } - - /** - * Get the actual instance, which can be the following: VPCNetworkRangeIPv4, VPCNetworkRangeIPv6 - * - * @return The actual instance (VPCNetworkRangeIPv4, VPCNetworkRangeIPv6) - */ - @SuppressWarnings("unchecked") - @Override - public Object getActualInstance() { - return super.getActualInstance(); - } - - /** - * Get the actual instance of `VPCNetworkRangeIPv4`. If the actual instance is not - * `VPCNetworkRangeIPv4`, the ClassCastException will be thrown. - * - * @return The actual instance of `VPCNetworkRangeIPv4` - * @throws ClassCastException if the instance is not `VPCNetworkRangeIPv4` - */ - public VPCNetworkRangeIPv4 getVPCNetworkRangeIPv4() throws ClassCastException { - return (VPCNetworkRangeIPv4) super.getActualInstance(); - } - - /** - * Get the actual instance of `VPCNetworkRangeIPv6`. If the actual instance is not - * `VPCNetworkRangeIPv6`, the ClassCastException will be thrown. - * - * @return The actual instance of `VPCNetworkRangeIPv6` - * @throws ClassCastException if the instance is not `VPCNetworkRangeIPv6` - */ - public VPCNetworkRangeIPv6 getVPCNetworkRangeIPv6() throws ClassCastException { - return (VPCNetworkRangeIPv6) super.getActualInstance(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to VPCNetworkRange - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - // validate oneOf schemas one by one - int validCount = 0; - ArrayList errorMessages = new ArrayList<>(); - // validate the json string with VPCNetworkRangeIPv4 - try { - VPCNetworkRangeIPv4.validateJsonElement(jsonElement); - validCount++; - } catch (Exception e) { - errorMessages.add( - String.format( - java.util.Locale.ROOT, - "Deserialization for VPCNetworkRangeIPv4 failed with `%s`.", - e.getMessage())); - // continue to the next one - } - // validate the json string with VPCNetworkRangeIPv6 - try { - VPCNetworkRangeIPv6.validateJsonElement(jsonElement); - validCount++; - } catch (Exception e) { - errorMessages.add( - String.format( - java.util.Locale.ROOT, - "Deserialization for VPCNetworkRangeIPv6 failed with `%s`.", - e.getMessage())); - // continue to the next one - } - if (validCount != 1) { - throw new IOException( - String.format( - java.util.Locale.ROOT, - "The JSON string is invalid for VPCNetworkRange with oneOf schemas: VPCNetworkRangeIPv4, VPCNetworkRangeIPv6. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", - validCount, - errorMessages, - jsonElement.toString())); - } - } - - /** - * Create an instance of VPCNetworkRange given an JSON string - * - * @param jsonString JSON string - * @return An instance of VPCNetworkRange - * @throws IOException if the JSON string is invalid with respect to VPCNetworkRange - */ - public static VPCNetworkRange fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, VPCNetworkRange.class); - } - - /** - * Convert an instance of VPCNetworkRange to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/VPCNetworkRangeIPv4.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/VPCNetworkRangeIPv4.java deleted file mode 100644 index 3fcd1991..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/VPCNetworkRangeIPv4.java +++ /dev/null @@ -1,720 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.model; - -import cloud.stackit.sdk.iaas.v2alpha1api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.UUID; - -/** Contains the IPv4 properties of a VPC network range. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class VPCNetworkRangeIPv4 { - public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; - - @SerializedName(SERIALIZED_NAME_CREATED_AT) - @javax.annotation.Nullable private OffsetDateTime createdAt; - - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - @javax.annotation.Nullable private String description; - - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - @javax.annotation.Nullable private UUID id; - - public static final String SERIALIZED_NAME_LABELS = "labels"; - - @SerializedName(SERIALIZED_NAME_LABELS) - @javax.annotation.Nullable private Object labels; - - public static final String SERIALIZED_NAME_STATUS = "status"; - - @SerializedName(SERIALIZED_NAME_STATUS) - @javax.annotation.Nullable private String status; - - public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; - - @SerializedName(SERIALIZED_NAME_UPDATED_AT) - @javax.annotation.Nullable private OffsetDateTime updatedAt; - - public static final String SERIALIZED_NAME_DEFAULT_PREFIX_LEN = "defaultPrefixLen"; - - @SerializedName(SERIALIZED_NAME_DEFAULT_PREFIX_LEN) - @javax.annotation.Nullable private Long defaultPrefixLen = 25l; - - /** Gets or Sets ipVersion */ - @JsonAdapter(IpVersionEnum.Adapter.class) - public enum IpVersionEnum { - IPV4("ipv4"), - - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - IpVersionEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static IpVersionEnum fromValue(String value) { - for (IpVersionEnum b : IpVersionEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final IpVersionEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public IpVersionEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return IpVersionEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - IpVersionEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_IP_VERSION = "ipVersion"; - - @SerializedName(SERIALIZED_NAME_IP_VERSION) - @javax.annotation.Nonnull - private IpVersionEnum ipVersion; - - public static final String SERIALIZED_NAME_MAX_PREFIX_LEN = "maxPrefixLen"; - - @SerializedName(SERIALIZED_NAME_MAX_PREFIX_LEN) - @javax.annotation.Nullable private Long maxPrefixLen = 29l; - - public static final String SERIALIZED_NAME_MIN_PREFIX_LEN = "minPrefixLen"; - - @SerializedName(SERIALIZED_NAME_MIN_PREFIX_LEN) - @javax.annotation.Nullable private Long minPrefixLen = 24l; - - public static final String SERIALIZED_NAME_NAMESERVERS = "nameservers"; - - @SerializedName(SERIALIZED_NAME_NAMESERVERS) - @javax.annotation.Nullable private List nameservers; - - public static final String SERIALIZED_NAME_PREFIX = "prefix"; - - @SerializedName(SERIALIZED_NAME_PREFIX) - @javax.annotation.Nonnull - private String prefix; - - public VPCNetworkRangeIPv4() {} - - public VPCNetworkRangeIPv4(OffsetDateTime createdAt, UUID id, OffsetDateTime updatedAt) { - this(); - this.createdAt = createdAt; - this.id = id; - this.updatedAt = updatedAt; - } - - /** - * Date-time when resource was created. - * - * @return createdAt - */ - @javax.annotation.Nullable public OffsetDateTime getCreatedAt() { - return createdAt; - } - - public VPCNetworkRangeIPv4 description(@javax.annotation.Nullable String description) { - this.description = description; - return this; - } - - /** - * Description Object. Allows string up to 255 Characters. - * - * @return description - */ - @javax.annotation.Nullable public String getDescription() { - return description; - } - - public void setDescription(@javax.annotation.Nullable String description) { - this.description = description; - } - - /** - * Universally Unique Identifier (UUID). - * - * @return id - */ - @javax.annotation.Nullable public UUID getId() { - return id; - } - - public VPCNetworkRangeIPv4 labels(@javax.annotation.Nullable Object labels) { - this.labels = labels; - return this; - } - - /** - * Object that represents the labels as key-value pairs of a resource. Key constraints: - May - * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must - * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain - * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), - * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 - * and 63 characters. - Must begin and end with an alphanumerical character - * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), - * dots (`.`), and alphanumerics in between. - Keys starting with the prefix - * `stackit-` or having a domain prefix of `stackit.cloud` (including its - * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value - * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not - * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May - * contain dashes (`-`), underscores (`_`), dots (`.`), and - * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are - * excluded from this count. Providing a `null` value for a key will remove that key. - * - * @return labels - */ - @javax.annotation.Nullable public Object getLabels() { - return labels; - } - - public void setLabels(@javax.annotation.Nullable Object labels) { - this.labels = labels; - } - - public VPCNetworkRangeIPv4 status(@javax.annotation.Nullable String status) { - this.status = status; - return this; - } - - /** - * The state of a resource object. Possible values: `CREATING`, `CREATED`, - * `DELETING`, `DELETED`, `FAILED`, `UPDATED`, - * `UPDATING`. - * - * @return status - */ - @javax.annotation.Nullable public String getStatus() { - return status; - } - - public void setStatus(@javax.annotation.Nullable String status) { - this.status = status; - } - - /** - * Date-time when resource was last updated. - * - * @return updatedAt - */ - @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { - return updatedAt; - } - - public VPCNetworkRangeIPv4 defaultPrefixLen(@javax.annotation.Nullable Long defaultPrefixLen) { - this.defaultPrefixLen = defaultPrefixLen; - return this; - } - - /** - * The default prefix length for network ranges in the VPC. minimum: 24 maximum: 29 - * - * @return defaultPrefixLen - */ - @javax.annotation.Nullable public Long getDefaultPrefixLen() { - return defaultPrefixLen; - } - - public void setDefaultPrefixLen(@javax.annotation.Nullable Long defaultPrefixLen) { - this.defaultPrefixLen = defaultPrefixLen; - } - - public VPCNetworkRangeIPv4 ipVersion(@javax.annotation.Nonnull IpVersionEnum ipVersion) { - this.ipVersion = ipVersion; - return this; - } - - /** - * Get ipVersion - * - * @return ipVersion - */ - @javax.annotation.Nonnull - public IpVersionEnum getIpVersion() { - return ipVersion; - } - - public void setIpVersion(@javax.annotation.Nonnull IpVersionEnum ipVersion) { - this.ipVersion = ipVersion; - } - - public VPCNetworkRangeIPv4 maxPrefixLen(@javax.annotation.Nullable Long maxPrefixLen) { - this.maxPrefixLen = maxPrefixLen; - return this; - } - - /** - * The maximal prefix length for network ranges in the VPC. minimum: 24 maximum: 29 - * - * @return maxPrefixLen - */ - @javax.annotation.Nullable public Long getMaxPrefixLen() { - return maxPrefixLen; - } - - public void setMaxPrefixLen(@javax.annotation.Nullable Long maxPrefixLen) { - this.maxPrefixLen = maxPrefixLen; - } - - public VPCNetworkRangeIPv4 minPrefixLen(@javax.annotation.Nullable Long minPrefixLen) { - this.minPrefixLen = minPrefixLen; - return this; - } - - /** - * The minimal prefix length for network ranges in the VPC. minimum: 8 maximum: 29 - * - * @return minPrefixLen - */ - @javax.annotation.Nullable public Long getMinPrefixLen() { - return minPrefixLen; - } - - public void setMinPrefixLen(@javax.annotation.Nullable Long minPrefixLen) { - this.minPrefixLen = minPrefixLen; - } - - public VPCNetworkRangeIPv4 nameservers(@javax.annotation.Nullable List nameservers) { - this.nameservers = nameservers; - return this; - } - - public VPCNetworkRangeIPv4 addNameserversItem(String nameserversItem) { - if (this.nameservers == null) { - this.nameservers = new ArrayList<>(); - } - this.nameservers.add(nameserversItem); - return this; - } - - /** - * A list containing DNS Servers/Nameservers for IPv4. - * - * @return nameservers - */ - @javax.annotation.Nullable public List getNameservers() { - return nameservers; - } - - public void setNameservers(@javax.annotation.Nullable List nameservers) { - this.nameservers = nameservers; - } - - public VPCNetworkRangeIPv4 prefix(@javax.annotation.Nonnull String prefix) { - this.prefix = prefix; - return this; - } - - /** - * Classless Inter-Domain Routing (CIDR). - * - * @return prefix - */ - @javax.annotation.Nonnull - public String getPrefix() { - return prefix; - } - - public void setPrefix(@javax.annotation.Nonnull String prefix) { - this.prefix = prefix; - } - - /** - * 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. - * - * @param key name of the property - * @param value value of the property - * @return the VPCNetworkRangeIPv4 instance itself - */ - public VPCNetworkRangeIPv4 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. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - 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; - } - VPCNetworkRangeIPv4 vpCNetworkRangeIPv4 = (VPCNetworkRangeIPv4) o; - return Objects.equals(this.createdAt, vpCNetworkRangeIPv4.createdAt) - && Objects.equals(this.description, vpCNetworkRangeIPv4.description) - && Objects.equals(this.id, vpCNetworkRangeIPv4.id) - && Objects.equals(this.labels, vpCNetworkRangeIPv4.labels) - && Objects.equals(this.status, vpCNetworkRangeIPv4.status) - && Objects.equals(this.updatedAt, vpCNetworkRangeIPv4.updatedAt) - && Objects.equals(this.defaultPrefixLen, vpCNetworkRangeIPv4.defaultPrefixLen) - && Objects.equals(this.ipVersion, vpCNetworkRangeIPv4.ipVersion) - && Objects.equals(this.maxPrefixLen, vpCNetworkRangeIPv4.maxPrefixLen) - && Objects.equals(this.minPrefixLen, vpCNetworkRangeIPv4.minPrefixLen) - && Objects.equals(this.nameservers, vpCNetworkRangeIPv4.nameservers) - && Objects.equals(this.prefix, vpCNetworkRangeIPv4.prefix) - && Objects.equals( - this.additionalProperties, vpCNetworkRangeIPv4.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash( - createdAt, - description, - id, - labels, - status, - updatedAt, - defaultPrefixLen, - ipVersion, - maxPrefixLen, - minPrefixLen, - nameservers, - prefix, - additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class VPCNetworkRangeIPv4 {\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); - sb.append(" defaultPrefixLen: ").append(toIndentedString(defaultPrefixLen)).append("\n"); - sb.append(" ipVersion: ").append(toIndentedString(ipVersion)).append("\n"); - sb.append(" maxPrefixLen: ").append(toIndentedString(maxPrefixLen)).append("\n"); - sb.append(" minPrefixLen: ").append(toIndentedString(minPrefixLen)).append("\n"); - sb.append(" nameservers: ").append(toIndentedString(nameservers)).append("\n"); - sb.append(" prefix: ").append(toIndentedString(prefix)).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( - Arrays.asList( - "createdAt", - "description", - "id", - "labels", - "status", - "updatedAt", - "defaultPrefixLen", - "ipVersion", - "maxPrefixLen", - "minPrefixLen", - "nameservers", - "prefix")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("ipVersion", "prefix")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to VPCNetworkRangeIPv4 - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!VPCNetworkRangeIPv4.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field(s) %s in VPCNetworkRangeIPv4 is not found in the empty JSON string", - VPCNetworkRangeIPv4.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : VPCNetworkRangeIPv4.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field `%s` is not found in the JSON string: %s", - requiredField, - jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) - && !jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `description` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("description").toString())); - } - if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) - && !jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `id` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("id").toString())); - } - if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) - && !jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `status` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("status").toString())); - } - if (!jsonObj.get("ipVersion").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `ipVersion` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("ipVersion").toString())); - } - // OVERRIDE: this if block fixes oneOf issues - if (!"ipv4".equals(jsonObj.get("ipVersion").getAsString())) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expectd the field `ipVersion` to have value `ipv4` but got `%s`", - jsonObj.get("ipVersion"))); - } - // validate the required field `ipVersion` - IpVersionEnum.validateJsonElement(jsonObj.get("ipVersion")); - // ensure the optional json data is an array if present - if (jsonObj.get("nameservers") != null - && !jsonObj.get("nameservers").isJsonNull() - && !jsonObj.get("nameservers").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `nameservers` to be an array in the JSON string but got `%s`", - jsonObj.get("nameservers").toString())); - } - if (!jsonObj.get("prefix").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `prefix` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("prefix").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!VPCNetworkRangeIPv4.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'VPCNetworkRangeIPv4' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(VPCNetworkRangeIPv4.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, VPCNetworkRangeIPv4 value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional 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 { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public VPCNetworkRangeIPv4 read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - VPCNetworkRangeIPv4 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( - java.util.Locale.ROOT, - "The field `%s` has unknown primitive type. Value: %s", - entry.getKey(), - entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - }.nullSafe(); - } - } - - /** - * Create an instance of VPCNetworkRangeIPv4 given an JSON string - * - * @param jsonString JSON string - * @return An instance of VPCNetworkRangeIPv4 - * @throws IOException if the JSON string is invalid with respect to VPCNetworkRangeIPv4 - */ - public static VPCNetworkRangeIPv4 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, VPCNetworkRangeIPv4.class); - } - - /** - * Convert an instance of VPCNetworkRangeIPv4 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/VPCNetworkRangeIPv6.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/VPCNetworkRangeIPv6.java deleted file mode 100644 index fa2cd3c1..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/VPCNetworkRangeIPv6.java +++ /dev/null @@ -1,720 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.model; - -import cloud.stackit.sdk.iaas.v2alpha1api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.UUID; - -/** Contains the IPv6 properties of a VPC network range. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class VPCNetworkRangeIPv6 { - public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; - - @SerializedName(SERIALIZED_NAME_CREATED_AT) - @javax.annotation.Nullable private OffsetDateTime createdAt; - - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - @javax.annotation.Nullable private String description; - - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - @javax.annotation.Nullable private UUID id; - - public static final String SERIALIZED_NAME_LABELS = "labels"; - - @SerializedName(SERIALIZED_NAME_LABELS) - @javax.annotation.Nullable private Object labels; - - public static final String SERIALIZED_NAME_STATUS = "status"; - - @SerializedName(SERIALIZED_NAME_STATUS) - @javax.annotation.Nullable private String status; - - public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; - - @SerializedName(SERIALIZED_NAME_UPDATED_AT) - @javax.annotation.Nullable private OffsetDateTime updatedAt; - - public static final String SERIALIZED_NAME_DEFAULT_PREFIX_LEN = "defaultPrefixLen"; - - @SerializedName(SERIALIZED_NAME_DEFAULT_PREFIX_LEN) - @javax.annotation.Nullable private Long defaultPrefixLen; - - /** Gets or Sets ipVersion */ - @JsonAdapter(IpVersionEnum.Adapter.class) - public enum IpVersionEnum { - IPV6("ipv6"), - - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - IpVersionEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static IpVersionEnum fromValue(String value) { - for (IpVersionEnum b : IpVersionEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final IpVersionEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public IpVersionEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return IpVersionEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - IpVersionEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_IP_VERSION = "ipVersion"; - - @SerializedName(SERIALIZED_NAME_IP_VERSION) - @javax.annotation.Nonnull - private IpVersionEnum ipVersion; - - public static final String SERIALIZED_NAME_MAX_PREFIX_LEN = "maxPrefixLen"; - - @SerializedName(SERIALIZED_NAME_MAX_PREFIX_LEN) - @javax.annotation.Nullable private Long maxPrefixLen; - - public static final String SERIALIZED_NAME_MIN_PREFIX_LEN = "minPrefixLen"; - - @SerializedName(SERIALIZED_NAME_MIN_PREFIX_LEN) - @javax.annotation.Nullable private Long minPrefixLen; - - public static final String SERIALIZED_NAME_NAMESERVERS = "nameservers"; - - @SerializedName(SERIALIZED_NAME_NAMESERVERS) - @javax.annotation.Nullable private List nameservers; - - public static final String SERIALIZED_NAME_PREFIX = "prefix"; - - @SerializedName(SERIALIZED_NAME_PREFIX) - @javax.annotation.Nonnull - private String prefix; - - public VPCNetworkRangeIPv6() {} - - public VPCNetworkRangeIPv6(OffsetDateTime createdAt, UUID id, OffsetDateTime updatedAt) { - this(); - this.createdAt = createdAt; - this.id = id; - this.updatedAt = updatedAt; - } - - /** - * Date-time when resource was created. - * - * @return createdAt - */ - @javax.annotation.Nullable public OffsetDateTime getCreatedAt() { - return createdAt; - } - - public VPCNetworkRangeIPv6 description(@javax.annotation.Nullable String description) { - this.description = description; - return this; - } - - /** - * Description Object. Allows string up to 255 Characters. - * - * @return description - */ - @javax.annotation.Nullable public String getDescription() { - return description; - } - - public void setDescription(@javax.annotation.Nullable String description) { - this.description = description; - } - - /** - * Universally Unique Identifier (UUID). - * - * @return id - */ - @javax.annotation.Nullable public UUID getId() { - return id; - } - - public VPCNetworkRangeIPv6 labels(@javax.annotation.Nullable Object labels) { - this.labels = labels; - return this; - } - - /** - * Object that represents the labels as key-value pairs of a resource. Key constraints: - May - * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must - * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain - * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), - * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 - * and 63 characters. - Must begin and end with an alphanumerical character - * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), - * dots (`.`), and alphanumerics in between. - Keys starting with the prefix - * `stackit-` or having a domain prefix of `stackit.cloud` (including its - * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value - * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not - * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May - * contain dashes (`-`), underscores (`_`), dots (`.`), and - * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are - * excluded from this count. Providing a `null` value for a key will remove that key. - * - * @return labels - */ - @javax.annotation.Nullable public Object getLabels() { - return labels; - } - - public void setLabels(@javax.annotation.Nullable Object labels) { - this.labels = labels; - } - - public VPCNetworkRangeIPv6 status(@javax.annotation.Nullable String status) { - this.status = status; - return this; - } - - /** - * The state of a resource object. Possible values: `CREATING`, `CREATED`, - * `DELETING`, `DELETED`, `FAILED`, `UPDATED`, - * `UPDATING`. - * - * @return status - */ - @javax.annotation.Nullable public String getStatus() { - return status; - } - - public void setStatus(@javax.annotation.Nullable String status) { - this.status = status; - } - - /** - * Date-time when resource was last updated. - * - * @return updatedAt - */ - @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { - return updatedAt; - } - - public VPCNetworkRangeIPv6 defaultPrefixLen(@javax.annotation.Nullable Long defaultPrefixLen) { - this.defaultPrefixLen = defaultPrefixLen; - return this; - } - - /** - * The ipv6 prefix lengths for subnets or network ranges in the VPC. minimum: 0 maximum: 128 - * - * @return defaultPrefixLen - */ - @javax.annotation.Nullable public Long getDefaultPrefixLen() { - return defaultPrefixLen; - } - - public void setDefaultPrefixLen(@javax.annotation.Nullable Long defaultPrefixLen) { - this.defaultPrefixLen = defaultPrefixLen; - } - - public VPCNetworkRangeIPv6 ipVersion(@javax.annotation.Nonnull IpVersionEnum ipVersion) { - this.ipVersion = ipVersion; - return this; - } - - /** - * Get ipVersion - * - * @return ipVersion - */ - @javax.annotation.Nonnull - public IpVersionEnum getIpVersion() { - return ipVersion; - } - - public void setIpVersion(@javax.annotation.Nonnull IpVersionEnum ipVersion) { - this.ipVersion = ipVersion; - } - - public VPCNetworkRangeIPv6 maxPrefixLen(@javax.annotation.Nullable Long maxPrefixLen) { - this.maxPrefixLen = maxPrefixLen; - return this; - } - - /** - * The ipv6 prefix lengths for subnets or network ranges in the VPC. minimum: 0 maximum: 128 - * - * @return maxPrefixLen - */ - @javax.annotation.Nullable public Long getMaxPrefixLen() { - return maxPrefixLen; - } - - public void setMaxPrefixLen(@javax.annotation.Nullable Long maxPrefixLen) { - this.maxPrefixLen = maxPrefixLen; - } - - public VPCNetworkRangeIPv6 minPrefixLen(@javax.annotation.Nullable Long minPrefixLen) { - this.minPrefixLen = minPrefixLen; - return this; - } - - /** - * The ipv6 prefix lengths for subnets or network ranges in the VPC. minimum: 0 maximum: 128 - * - * @return minPrefixLen - */ - @javax.annotation.Nullable public Long getMinPrefixLen() { - return minPrefixLen; - } - - public void setMinPrefixLen(@javax.annotation.Nullable Long minPrefixLen) { - this.minPrefixLen = minPrefixLen; - } - - public VPCNetworkRangeIPv6 nameservers(@javax.annotation.Nullable List nameservers) { - this.nameservers = nameservers; - return this; - } - - public VPCNetworkRangeIPv6 addNameserversItem(String nameserversItem) { - if (this.nameservers == null) { - this.nameservers = new ArrayList<>(); - } - this.nameservers.add(nameserversItem); - return this; - } - - /** - * A list containing DNS Servers/Nameservers for IPv6. - * - * @return nameservers - */ - @javax.annotation.Nullable public List getNameservers() { - return nameservers; - } - - public void setNameservers(@javax.annotation.Nullable List nameservers) { - this.nameservers = nameservers; - } - - public VPCNetworkRangeIPv6 prefix(@javax.annotation.Nonnull String prefix) { - this.prefix = prefix; - return this; - } - - /** - * Classless Inter-Domain Routing (CIDR) for IPv6. - * - * @return prefix - */ - @javax.annotation.Nonnull - public String getPrefix() { - return prefix; - } - - public void setPrefix(@javax.annotation.Nonnull String prefix) { - this.prefix = prefix; - } - - /** - * 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. - * - * @param key name of the property - * @param value value of the property - * @return the VPCNetworkRangeIPv6 instance itself - */ - public VPCNetworkRangeIPv6 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. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - 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; - } - VPCNetworkRangeIPv6 vpCNetworkRangeIPv6 = (VPCNetworkRangeIPv6) o; - return Objects.equals(this.createdAt, vpCNetworkRangeIPv6.createdAt) - && Objects.equals(this.description, vpCNetworkRangeIPv6.description) - && Objects.equals(this.id, vpCNetworkRangeIPv6.id) - && Objects.equals(this.labels, vpCNetworkRangeIPv6.labels) - && Objects.equals(this.status, vpCNetworkRangeIPv6.status) - && Objects.equals(this.updatedAt, vpCNetworkRangeIPv6.updatedAt) - && Objects.equals(this.defaultPrefixLen, vpCNetworkRangeIPv6.defaultPrefixLen) - && Objects.equals(this.ipVersion, vpCNetworkRangeIPv6.ipVersion) - && Objects.equals(this.maxPrefixLen, vpCNetworkRangeIPv6.maxPrefixLen) - && Objects.equals(this.minPrefixLen, vpCNetworkRangeIPv6.minPrefixLen) - && Objects.equals(this.nameservers, vpCNetworkRangeIPv6.nameservers) - && Objects.equals(this.prefix, vpCNetworkRangeIPv6.prefix) - && Objects.equals( - this.additionalProperties, vpCNetworkRangeIPv6.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash( - createdAt, - description, - id, - labels, - status, - updatedAt, - defaultPrefixLen, - ipVersion, - maxPrefixLen, - minPrefixLen, - nameservers, - prefix, - additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class VPCNetworkRangeIPv6 {\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); - sb.append(" defaultPrefixLen: ").append(toIndentedString(defaultPrefixLen)).append("\n"); - sb.append(" ipVersion: ").append(toIndentedString(ipVersion)).append("\n"); - sb.append(" maxPrefixLen: ").append(toIndentedString(maxPrefixLen)).append("\n"); - sb.append(" minPrefixLen: ").append(toIndentedString(minPrefixLen)).append("\n"); - sb.append(" nameservers: ").append(toIndentedString(nameservers)).append("\n"); - sb.append(" prefix: ").append(toIndentedString(prefix)).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( - Arrays.asList( - "createdAt", - "description", - "id", - "labels", - "status", - "updatedAt", - "defaultPrefixLen", - "ipVersion", - "maxPrefixLen", - "minPrefixLen", - "nameservers", - "prefix")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("ipVersion", "prefix")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to VPCNetworkRangeIPv6 - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!VPCNetworkRangeIPv6.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field(s) %s in VPCNetworkRangeIPv6 is not found in the empty JSON string", - VPCNetworkRangeIPv6.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : VPCNetworkRangeIPv6.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field `%s` is not found in the JSON string: %s", - requiredField, - jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) - && !jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `description` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("description").toString())); - } - if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) - && !jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `id` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("id").toString())); - } - if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) - && !jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `status` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("status").toString())); - } - if (!jsonObj.get("ipVersion").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `ipVersion` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("ipVersion").toString())); - } - // OVERRIDE: this if block fixes oneOf issues - if (!"ipv6".equals(jsonObj.get("ipVersion").getAsString())) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expectd the field `ipVersion` to have value `ipv6` but got `%s`", - jsonObj.get("ipVersion"))); - } - // validate the required field `ipVersion` - IpVersionEnum.validateJsonElement(jsonObj.get("ipVersion")); - // ensure the optional json data is an array if present - if (jsonObj.get("nameservers") != null - && !jsonObj.get("nameservers").isJsonNull() - && !jsonObj.get("nameservers").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `nameservers` to be an array in the JSON string but got `%s`", - jsonObj.get("nameservers").toString())); - } - if (!jsonObj.get("prefix").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `prefix` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("prefix").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!VPCNetworkRangeIPv6.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'VPCNetworkRangeIPv6' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(VPCNetworkRangeIPv6.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, VPCNetworkRangeIPv6 value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional 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 { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public VPCNetworkRangeIPv6 read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - VPCNetworkRangeIPv6 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( - java.util.Locale.ROOT, - "The field `%s` has unknown primitive type. Value: %s", - entry.getKey(), - entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - }.nullSafe(); - } - } - - /** - * Create an instance of VPCNetworkRangeIPv6 given an JSON string - * - * @param jsonString JSON string - * @return An instance of VPCNetworkRangeIPv6 - * @throws IOException if the JSON string is invalid with respect to VPCNetworkRangeIPv6 - */ - public static VPCNetworkRangeIPv6 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, VPCNetworkRangeIPv6.class); - } - - /** - * Convert an instance of VPCNetworkRangeIPv6 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/VPCNetworkRangeList.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/VPCNetworkRangeList.java deleted file mode 100644 index eb1b225c..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/VPCNetworkRangeList.java +++ /dev/null @@ -1,324 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.model; - -import cloud.stackit.sdk.iaas.v2alpha1api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** VPC Network Range list response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class VPCNetworkRangeList { - public static final String SERIALIZED_NAME_ITEMS = "items"; - - @SerializedName(SERIALIZED_NAME_ITEMS) - @javax.annotation.Nonnull - private List items = new ArrayList<>(); - - public VPCNetworkRangeList() {} - - public VPCNetworkRangeList items(@javax.annotation.Nonnull List items) { - this.items = items; - return this; - } - - public VPCNetworkRangeList addItemsItem(VPCNetworkRange itemsItem) { - if (this.items == null) { - this.items = new ArrayList<>(); - } - this.items.add(itemsItem); - return this; - } - - /** - * A list of VPC network ranges. - * - * @return items - */ - @javax.annotation.Nonnull - public List getItems() { - return items; - } - - public void setItems(@javax.annotation.Nonnull List items) { - this.items = items; - } - - /** - * 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. - * - * @param key name of the property - * @param value value of the property - * @return the VPCNetworkRangeList instance itself - */ - public VPCNetworkRangeList 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. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - 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; - } - VPCNetworkRangeList vpCNetworkRangeList = (VPCNetworkRangeList) o; - return Objects.equals(this.items, vpCNetworkRangeList.items) - && Objects.equals( - this.additionalProperties, vpCNetworkRangeList.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(items, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class VPCNetworkRangeList {\n"); - sb.append(" items: ").append(toIndentedString(items)).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(Arrays.asList("items")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("items")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to VPCNetworkRangeList - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!VPCNetworkRangeList.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field(s) %s in VPCNetworkRangeList is not found in the empty JSON string", - VPCNetworkRangeList.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : VPCNetworkRangeList.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field `%s` is not found in the JSON string: %s", - requiredField, - jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - VPCNetworkRange.validateJsonElement(jsonArrayitems.get(i)); - } - ; - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!VPCNetworkRangeList.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'VPCNetworkRangeList' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(VPCNetworkRangeList.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, VPCNetworkRangeList value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional 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 { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public VPCNetworkRangeList read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - VPCNetworkRangeList 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( - java.util.Locale.ROOT, - "The field `%s` has unknown primitive type. Value: %s", - entry.getKey(), - entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - }.nullSafe(); - } - } - - /** - * Create an instance of VPCNetworkRangeList given an JSON string - * - * @param jsonString JSON string - * @return An instance of VPCNetworkRangeList - * @throws IOException if the JSON string is invalid with respect to VPCNetworkRangeList - */ - public static VPCNetworkRangeList fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, VPCNetworkRangeList.class); - } - - /** - * Convert an instance of VPCNetworkRangeList to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/VPCRoutingTable.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/VPCRoutingTable.java deleted file mode 100644 index 1efffd14..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/VPCRoutingTable.java +++ /dev/null @@ -1,516 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.model; - -import cloud.stackit.sdk.iaas.v2alpha1api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.UUID; - -/** - * An object representing a VPC routing table. Filterable Fields: `createdAt`, - * `dynamicRoutes`, `name`, `systemRoutes`, `updatedAt`. - */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class VPCRoutingTable { - public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; - - @SerializedName(SERIALIZED_NAME_CREATED_AT) - @javax.annotation.Nullable private OffsetDateTime createdAt; - - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - @javax.annotation.Nullable private String description; - - public static final String SERIALIZED_NAME_DYNAMIC_ROUTES = "dynamicRoutes"; - - @SerializedName(SERIALIZED_NAME_DYNAMIC_ROUTES) - @javax.annotation.Nullable private Boolean dynamicRoutes = true; - - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - @javax.annotation.Nullable private UUID id; - - public static final String SERIALIZED_NAME_LABELS = "labels"; - - @SerializedName(SERIALIZED_NAME_LABELS) - @javax.annotation.Nullable private Object labels; - - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - @javax.annotation.Nonnull - private String name; - - public static final String SERIALIZED_NAME_SYSTEM_ROUTES = "systemRoutes"; - - @SerializedName(SERIALIZED_NAME_SYSTEM_ROUTES) - @javax.annotation.Nullable private Boolean systemRoutes = true; - - public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; - - @SerializedName(SERIALIZED_NAME_UPDATED_AT) - @javax.annotation.Nullable private OffsetDateTime updatedAt; - - public VPCRoutingTable() {} - - public VPCRoutingTable(OffsetDateTime createdAt, UUID id, OffsetDateTime updatedAt) { - this(); - this.createdAt = createdAt; - this.id = id; - this.updatedAt = updatedAt; - } - - /** - * Date-time when resource was created. - * - * @return createdAt - */ - @javax.annotation.Nullable public OffsetDateTime getCreatedAt() { - return createdAt; - } - - public VPCRoutingTable description(@javax.annotation.Nullable String description) { - this.description = description; - return this; - } - - /** - * Description Object. Allows string up to 255 Characters. - * - * @return description - */ - @javax.annotation.Nullable public String getDescription() { - return description; - } - - public void setDescription(@javax.annotation.Nullable String description) { - this.description = description; - } - - public VPCRoutingTable dynamicRoutes(@javax.annotation.Nullable Boolean dynamicRoutes) { - this.dynamicRoutes = dynamicRoutes; - return this; - } - - /** - * A config setting for a routing table which allows propagation of dynamic routes to this - * routing table. - * - * @return dynamicRoutes - */ - @javax.annotation.Nullable public Boolean getDynamicRoutes() { - return dynamicRoutes; - } - - public void setDynamicRoutes(@javax.annotation.Nullable Boolean dynamicRoutes) { - this.dynamicRoutes = dynamicRoutes; - } - - /** - * Universally Unique Identifier (UUID). - * - * @return id - */ - @javax.annotation.Nullable public UUID getId() { - return id; - } - - public VPCRoutingTable labels(@javax.annotation.Nullable Object labels) { - this.labels = labels; - return this; - } - - /** - * Object that represents the labels as key-value pairs of a resource. Key constraints: - May - * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must - * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain - * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), - * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 - * and 63 characters. - Must begin and end with an alphanumerical character - * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), - * dots (`.`), and alphanumerics in between. - Keys starting with the prefix - * `stackit-` or having a domain prefix of `stackit.cloud` (including its - * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value - * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not - * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May - * contain dashes (`-`), underscores (`_`), dots (`.`), and - * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are - * excluded from this count. Providing a `null` value for a key will remove that key. - * - * @return labels - */ - @javax.annotation.Nullable public Object getLabels() { - return labels; - } - - public void setLabels(@javax.annotation.Nullable Object labels) { - this.labels = labels; - } - - public VPCRoutingTable name(@javax.annotation.Nonnull String name) { - this.name = name; - return this; - } - - /** - * The name for a General Object. Matches Names and also UUIDs. - * - * @return name - */ - @javax.annotation.Nonnull - public String getName() { - return name; - } - - public void setName(@javax.annotation.Nonnull String name) { - this.name = name; - } - - public VPCRoutingTable systemRoutes(@javax.annotation.Nullable Boolean systemRoutes) { - this.systemRoutes = systemRoutes; - return this; - } - - /** - * A config setting for a routing table which allows installation of automatic system routes for - * connectivity between projects in the same SNA. - * - * @return systemRoutes - */ - @javax.annotation.Nullable public Boolean getSystemRoutes() { - return systemRoutes; - } - - public void setSystemRoutes(@javax.annotation.Nullable Boolean systemRoutes) { - this.systemRoutes = systemRoutes; - } - - /** - * Date-time when resource was last updated. - * - * @return updatedAt - */ - @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { - return updatedAt; - } - - /** - * 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. - * - * @param key name of the property - * @param value value of the property - * @return the VPCRoutingTable instance itself - */ - public VPCRoutingTable 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. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - 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; - } - VPCRoutingTable vpCRoutingTable = (VPCRoutingTable) o; - return Objects.equals(this.createdAt, vpCRoutingTable.createdAt) - && Objects.equals(this.description, vpCRoutingTable.description) - && Objects.equals(this.dynamicRoutes, vpCRoutingTable.dynamicRoutes) - && Objects.equals(this.id, vpCRoutingTable.id) - && Objects.equals(this.labels, vpCRoutingTable.labels) - && Objects.equals(this.name, vpCRoutingTable.name) - && Objects.equals(this.systemRoutes, vpCRoutingTable.systemRoutes) - && Objects.equals(this.updatedAt, vpCRoutingTable.updatedAt) - && Objects.equals(this.additionalProperties, vpCRoutingTable.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash( - createdAt, - description, - dynamicRoutes, - id, - labels, - name, - systemRoutes, - updatedAt, - additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class VPCRoutingTable {\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" dynamicRoutes: ").append(toIndentedString(dynamicRoutes)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" systemRoutes: ").append(toIndentedString(systemRoutes)).append("\n"); - sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).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( - Arrays.asList( - "createdAt", - "description", - "dynamicRoutes", - "id", - "labels", - "name", - "systemRoutes", - "updatedAt")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("name")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to VPCRoutingTable - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!VPCRoutingTable.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field(s) %s in VPCRoutingTable is not found in the empty JSON string", - VPCRoutingTable.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : VPCRoutingTable.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field `%s` is not found in the JSON string: %s", - requiredField, - jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) - && !jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `description` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("description").toString())); - } - if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) - && !jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `id` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("id").toString())); - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "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 (!VPCRoutingTable.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'VPCRoutingTable' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(VPCRoutingTable.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, VPCRoutingTable value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional 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 { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public VPCRoutingTable read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - VPCRoutingTable 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( - java.util.Locale.ROOT, - "The field `%s` has unknown primitive type. Value: %s", - entry.getKey(), - entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - }.nullSafe(); - } - } - - /** - * Create an instance of VPCRoutingTable given an JSON string - * - * @param jsonString JSON string - * @return An instance of VPCRoutingTable - * @throws IOException if the JSON string is invalid with respect to VPCRoutingTable - */ - public static VPCRoutingTable fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, VPCRoutingTable.class); - } - - /** - * Convert an instance of VPCRoutingTable to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/VPCRoutingTableList.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/VPCRoutingTableList.java deleted file mode 100644 index 06c04c7d..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/VPCRoutingTableList.java +++ /dev/null @@ -1,324 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.model; - -import cloud.stackit.sdk.iaas.v2alpha1api.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** VPC Routing table response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") -public class VPCRoutingTableList { - public static final String SERIALIZED_NAME_ITEMS = "items"; - - @SerializedName(SERIALIZED_NAME_ITEMS) - @javax.annotation.Nonnull - private List items = new ArrayList<>(); - - public VPCRoutingTableList() {} - - public VPCRoutingTableList items(@javax.annotation.Nonnull List items) { - this.items = items; - return this; - } - - public VPCRoutingTableList addItemsItem(VPCRoutingTable itemsItem) { - if (this.items == null) { - this.items = new ArrayList<>(); - } - this.items.add(itemsItem); - return this; - } - - /** - * A list of VPC routing tables. - * - * @return items - */ - @javax.annotation.Nonnull - public List getItems() { - return items; - } - - public void setItems(@javax.annotation.Nonnull List items) { - this.items = items; - } - - /** - * 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. - * - * @param key name of the property - * @param value value of the property - * @return the VPCRoutingTableList instance itself - */ - public VPCRoutingTableList 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. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - 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; - } - VPCRoutingTableList vpCRoutingTableList = (VPCRoutingTableList) o; - return Objects.equals(this.items, vpCRoutingTableList.items) - && Objects.equals( - this.additionalProperties, vpCRoutingTableList.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(items, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class VPCRoutingTableList {\n"); - sb.append(" items: ").append(toIndentedString(items)).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(Arrays.asList("items")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("items")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to VPCRoutingTableList - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!VPCRoutingTableList.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field(s) %s in VPCRoutingTableList is not found in the empty JSON string", - VPCRoutingTableList.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : VPCRoutingTableList.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "The required field `%s` is not found in the JSON string: %s", - requiredField, - jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - VPCRoutingTable.validateJsonElement(jsonArrayitems.get(i)); - } - ; - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!VPCRoutingTableList.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'VPCRoutingTableList' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(VPCRoutingTableList.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, VPCRoutingTableList value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional 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 { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public VPCRoutingTableList read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - VPCRoutingTableList 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( - java.util.Locale.ROOT, - "The field `%s` has unknown primitive type. Value: %s", - entry.getKey(), - entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty( - entry.getKey(), - gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - }.nullSafe(); - } - } - - /** - * Create an instance of VPCRoutingTableList given an JSON string - * - * @param jsonString JSON string - * @return An instance of VPCRoutingTableList - * @throws IOException if the JSON string is invalid with respect to VPCRoutingTableList - */ - public static VPCRoutingTableList fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, VPCRoutingTableList.class); - } - - /** - * Convert an instance of VPCRoutingTableList to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateNicPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateNicPayload.java index 8c9ab8d5..0ba1ac56 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateNicPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateNicPayload.java @@ -24,6 +24,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; @@ -41,6 +42,11 @@ public class CreateNicPayload { @SerializedName(SERIALIZED_NAME_ALLOWED_ADDRESSES) @javax.annotation.Nullable private List allowedAddresses = new ArrayList<>(); + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + + @SerializedName(SERIALIZED_NAME_CREATED_AT) + @javax.annotation.Nullable private OffsetDateTime createdAt; + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; @SerializedName(SERIALIZED_NAME_DESCRIPTION) @@ -106,17 +112,31 @@ public class CreateNicPayload { @SerializedName(SERIALIZED_NAME_TYPE) @javax.annotation.Nullable private String type; + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable private OffsetDateTime updatedAt; + public CreateNicPayload() {} public CreateNicPayload( - UUID device, UUID id, String mac, UUID networkId, String status, String type) { + OffsetDateTime createdAt, + UUID device, + UUID id, + String mac, + UUID networkId, + String status, + String type, + OffsetDateTime updatedAt) { this(); + this.createdAt = createdAt; this.device = device; this.id = id; this.mac = mac; this.networkId = networkId; this.status = status; this.type = type; + this.updatedAt = updatedAt; } public CreateNicPayload allowedAddresses( @@ -147,6 +167,15 @@ public void setAllowedAddresses( this.allowedAddresses = allowedAddresses; } + /** + * Date-time when resource was created. + * + * @return createdAt + */ + @javax.annotation.Nullable public OffsetDateTime getCreatedAt() { + return createdAt; + } + public CreateNicPayload description(@javax.annotation.Nullable String description) { this.description = description; return this; @@ -350,6 +379,15 @@ public void setSecurityGroups(@javax.annotation.Nullable List securityGrou return type; } + /** + * Date-time when resource was last updated. + * + * @return updatedAt + */ + @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + /** * A container for additional, undeclared properties. This is a holder for any undeclared * properties as specified with the 'additionalProperties' keyword in the OAS document. @@ -404,6 +442,7 @@ public boolean equals(Object o) { } CreateNicPayload createNicPayload = (CreateNicPayload) o; return Objects.equals(this.allowedAddresses, createNicPayload.allowedAddresses) + && Objects.equals(this.createdAt, createNicPayload.createdAt) && Objects.equals(this.description, createNicPayload.description) && Objects.equals(this.device, createNicPayload.device) && Objects.equals(this.id, createNicPayload.id) @@ -417,6 +456,7 @@ public boolean equals(Object o) { && Objects.equals(this.securityGroups, createNicPayload.securityGroups) && Objects.equals(this.status, createNicPayload.status) && Objects.equals(this.type, createNicPayload.type) + && Objects.equals(this.updatedAt, createNicPayload.updatedAt) && Objects.equals(this.additionalProperties, createNicPayload.additionalProperties); } @@ -424,6 +464,7 @@ public boolean equals(Object o) { public int hashCode() { return Objects.hash( allowedAddresses, + createdAt, description, device, id, @@ -437,6 +478,7 @@ public int hashCode() { securityGroups, status, type, + updatedAt, additionalProperties); } @@ -445,6 +487,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class CreateNicPayload {\n"); sb.append(" allowedAddresses: ").append(toIndentedString(allowedAddresses)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" device: ").append(toIndentedString(device)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); @@ -458,6 +501,7 @@ public String toString() { sb.append(" securityGroups: ").append(toIndentedString(securityGroups)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); @@ -485,6 +529,7 @@ private String toIndentedString(Object o) { new HashSet( Arrays.asList( "allowedAddresses", + "createdAt", "description", "device", "id", @@ -497,7 +542,8 @@ private String toIndentedString(Object o) { "nicSecurity", "securityGroups", "status", - "type")); + "type", + "updatedAt")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(0); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreatePublicIPPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreatePublicIPPayload.java index 867752c5..34e530a0 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreatePublicIPPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreatePublicIPPayload.java @@ -23,6 +23,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; @@ -35,6 +36,11 @@ /** Object that represents a public IP. */ @javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") public class CreatePublicIPPayload { + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + + @SerializedName(SERIALIZED_NAME_CREATED_AT) + @javax.annotation.Nullable private OffsetDateTime createdAt; + public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @@ -55,12 +61,29 @@ public class CreatePublicIPPayload { @SerializedName(SERIALIZED_NAME_NETWORK_INTERFACE) @javax.annotation.Nullable private UUID networkInterface; + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable private OffsetDateTime updatedAt; + public CreatePublicIPPayload() {} - public CreatePublicIPPayload(UUID id, String ip) { + public CreatePublicIPPayload( + OffsetDateTime createdAt, UUID id, String ip, OffsetDateTime updatedAt) { this(); + this.createdAt = createdAt; this.id = id; this.ip = ip; + this.updatedAt = updatedAt; + } + + /** + * Date-time when resource was created. + * + * @return createdAt + */ + @javax.annotation.Nullable public OffsetDateTime getCreatedAt() { + return createdAt; } /** @@ -132,6 +155,15 @@ public void setNetworkInterface(@javax.annotation.Nullable UUID networkInterface this.networkInterface = networkInterface; } + /** + * Date-time when resource was last updated. + * + * @return updatedAt + */ + @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + /** * A container for additional, undeclared properties. This is a holder for any undeclared * properties as specified with the 'additionalProperties' keyword in the OAS document. @@ -185,10 +217,12 @@ public boolean equals(Object o) { return false; } CreatePublicIPPayload createPublicIPPayload = (CreatePublicIPPayload) o; - return Objects.equals(this.id, createPublicIPPayload.id) + return Objects.equals(this.createdAt, createPublicIPPayload.createdAt) + && Objects.equals(this.id, createPublicIPPayload.id) && Objects.equals(this.ip, createPublicIPPayload.ip) && Objects.equals(this.labels, createPublicIPPayload.labels) && Objects.equals(this.networkInterface, createPublicIPPayload.networkInterface) + && Objects.equals(this.updatedAt, createPublicIPPayload.updatedAt) && Objects.equals( this.additionalProperties, createPublicIPPayload.additionalProperties); } @@ -204,7 +238,8 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(id, ip, labels, networkInterface, additionalProperties); + return Objects.hash( + createdAt, id, ip, labels, networkInterface, updatedAt, additionalProperties); } private static int hashCodeNullable(JsonNullable a) { @@ -218,10 +253,12 @@ private static int hashCodeNullable(JsonNullable a) { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class CreatePublicIPPayload {\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" ip: ").append(toIndentedString(ip)).append("\n"); sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); sb.append(" networkInterface: ").append(toIndentedString(networkInterface)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); @@ -246,7 +283,14 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = - new HashSet(Arrays.asList("id", "ip", "labels", "networkInterface")); + new HashSet( + Arrays.asList( + "createdAt", + "id", + "ip", + "labels", + "networkInterface", + "updatedAt")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(0); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NIC.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NIC.java index e10738e7..88433dc7 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NIC.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NIC.java @@ -24,6 +24,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; @@ -41,6 +42,11 @@ public class NIC { @SerializedName(SERIALIZED_NAME_ALLOWED_ADDRESSES) @javax.annotation.Nullable private List allowedAddresses = new ArrayList<>(); + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + + @SerializedName(SERIALIZED_NAME_CREATED_AT) + @javax.annotation.Nullable private OffsetDateTime createdAt; + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; @SerializedName(SERIALIZED_NAME_DESCRIPTION) @@ -106,16 +112,31 @@ public class NIC { @SerializedName(SERIALIZED_NAME_TYPE) @javax.annotation.Nullable private String type; + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable private OffsetDateTime updatedAt; + public NIC() {} - public NIC(UUID device, UUID id, String mac, UUID networkId, String status, String type) { + public NIC( + OffsetDateTime createdAt, + UUID device, + UUID id, + String mac, + UUID networkId, + String status, + String type, + OffsetDateTime updatedAt) { this(); + this.createdAt = createdAt; this.device = device; this.id = id; this.mac = mac; this.networkId = networkId; this.status = status; this.type = type; + this.updatedAt = updatedAt; } public NIC allowedAddresses( @@ -146,6 +167,15 @@ public void setAllowedAddresses( this.allowedAddresses = allowedAddresses; } + /** + * Date-time when resource was created. + * + * @return createdAt + */ + @javax.annotation.Nullable public OffsetDateTime getCreatedAt() { + return createdAt; + } + public NIC description(@javax.annotation.Nullable String description) { this.description = description; return this; @@ -349,6 +379,15 @@ public void setSecurityGroups(@javax.annotation.Nullable List securityGrou return type; } + /** + * Date-time when resource was last updated. + * + * @return updatedAt + */ + @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + /** * A container for additional, undeclared properties. This is a holder for any undeclared * properties as specified with the 'additionalProperties' keyword in the OAS document. @@ -403,6 +442,7 @@ public boolean equals(Object o) { } NIC NIC = (NIC) o; return Objects.equals(this.allowedAddresses, NIC.allowedAddresses) + && Objects.equals(this.createdAt, NIC.createdAt) && Objects.equals(this.description, NIC.description) && Objects.equals(this.device, NIC.device) && Objects.equals(this.id, NIC.id) @@ -416,6 +456,7 @@ public boolean equals(Object o) { && Objects.equals(this.securityGroups, NIC.securityGroups) && Objects.equals(this.status, NIC.status) && Objects.equals(this.type, NIC.type) + && Objects.equals(this.updatedAt, NIC.updatedAt) && Objects.equals(this.additionalProperties, NIC.additionalProperties); } @@ -423,6 +464,7 @@ public boolean equals(Object o) { public int hashCode() { return Objects.hash( allowedAddresses, + createdAt, description, device, id, @@ -436,6 +478,7 @@ public int hashCode() { securityGroups, status, type, + updatedAt, additionalProperties); } @@ -444,6 +487,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class NIC {\n"); sb.append(" allowedAddresses: ").append(toIndentedString(allowedAddresses)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" device: ").append(toIndentedString(device)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); @@ -457,6 +501,7 @@ public String toString() { sb.append(" securityGroups: ").append(toIndentedString(securityGroups)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); @@ -484,6 +529,7 @@ private String toIndentedString(Object o) { new HashSet( Arrays.asList( "allowedAddresses", + "createdAt", "description", "device", "id", @@ -496,7 +542,8 @@ private String toIndentedString(Object o) { "nicSecurity", "securityGroups", "status", - "type")); + "type", + "updatedAt")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(0); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/PublicIp.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/PublicIp.java index 6cdeb4ef..2fc22194 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/PublicIp.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/PublicIp.java @@ -23,6 +23,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; @@ -35,6 +36,11 @@ /** Object that represents a public IP. */ @javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") public class PublicIp { + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + + @SerializedName(SERIALIZED_NAME_CREATED_AT) + @javax.annotation.Nullable private OffsetDateTime createdAt; + public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @@ -55,12 +61,28 @@ public class PublicIp { @SerializedName(SERIALIZED_NAME_NETWORK_INTERFACE) @javax.annotation.Nullable private UUID networkInterface; + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable private OffsetDateTime updatedAt; + public PublicIp() {} - public PublicIp(UUID id, String ip) { + public PublicIp(OffsetDateTime createdAt, UUID id, String ip, OffsetDateTime updatedAt) { this(); + this.createdAt = createdAt; this.id = id; this.ip = ip; + this.updatedAt = updatedAt; + } + + /** + * Date-time when resource was created. + * + * @return createdAt + */ + @javax.annotation.Nullable public OffsetDateTime getCreatedAt() { + return createdAt; } /** @@ -131,6 +153,15 @@ public void setNetworkInterface(@javax.annotation.Nullable UUID networkInterface this.networkInterface = networkInterface; } + /** + * Date-time when resource was last updated. + * + * @return updatedAt + */ + @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + /** * A container for additional, undeclared properties. This is a holder for any undeclared * properties as specified with the 'additionalProperties' keyword in the OAS document. @@ -184,10 +215,12 @@ public boolean equals(Object o) { return false; } PublicIp publicIp = (PublicIp) o; - return Objects.equals(this.id, publicIp.id) + return Objects.equals(this.createdAt, publicIp.createdAt) + && Objects.equals(this.id, publicIp.id) && Objects.equals(this.ip, publicIp.ip) && Objects.equals(this.labels, publicIp.labels) && Objects.equals(this.networkInterface, publicIp.networkInterface) + && Objects.equals(this.updatedAt, publicIp.updatedAt) && Objects.equals(this.additionalProperties, publicIp.additionalProperties); } @@ -202,7 +235,8 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(id, ip, labels, networkInterface, additionalProperties); + return Objects.hash( + createdAt, id, ip, labels, networkInterface, updatedAt, additionalProperties); } private static int hashCodeNullable(JsonNullable a) { @@ -216,10 +250,12 @@ private static int hashCodeNullable(JsonNullable a) { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class PublicIp {\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" ip: ").append(toIndentedString(ip)).append("\n"); sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); sb.append(" networkInterface: ").append(toIndentedString(networkInterface)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); @@ -244,7 +280,14 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = - new HashSet(Arrays.asList("id", "ip", "labels", "networkInterface")); + new HashSet( + Arrays.asList( + "createdAt", + "id", + "ip", + "labels", + "networkInterface", + "updatedAt")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(0); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ServerNetwork.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ServerNetwork.java index fe727811..49279540 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ServerNetwork.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ServerNetwork.java @@ -24,6 +24,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; @@ -41,6 +42,11 @@ public class ServerNetwork { @SerializedName(SERIALIZED_NAME_ALLOWED_ADDRESSES) @javax.annotation.Nullable private List allowedAddresses = new ArrayList<>(); + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + + @SerializedName(SERIALIZED_NAME_CREATED_AT) + @javax.annotation.Nullable private OffsetDateTime createdAt; + public static final String SERIALIZED_NAME_IPV4 = "ipv4"; @SerializedName(SERIALIZED_NAME_IPV4) @@ -91,8 +97,19 @@ public class ServerNetwork { @SerializedName(SERIALIZED_NAME_SECURITY_GROUPS) @javax.annotation.Nullable private List securityGroups = new ArrayList<>(); + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable private OffsetDateTime updatedAt; + public ServerNetwork() {} + public ServerNetwork(OffsetDateTime createdAt, OffsetDateTime updatedAt) { + this(); + this.createdAt = createdAt; + this.updatedAt = updatedAt; + } + public ServerNetwork allowedAddresses( @javax.annotation.Nullable List allowedAddresses) { this.allowedAddresses = allowedAddresses; @@ -121,6 +138,15 @@ public void setAllowedAddresses( this.allowedAddresses = allowedAddresses; } + /** + * Date-time when resource was created. + * + * @return createdAt + */ + @javax.annotation.Nullable public OffsetDateTime getCreatedAt() { + return createdAt; + } + public ServerNetwork ipv4(@javax.annotation.Nullable String ipv4) { this.ipv4 = ipv4; return this; @@ -296,6 +322,15 @@ public void setSecurityGroups(@javax.annotation.Nullable List securityGrou this.securityGroups = securityGroups; } + /** + * Date-time when resource was last updated. + * + * @return updatedAt + */ + @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + /** * A container for additional, undeclared properties. This is a holder for any undeclared * properties as specified with the 'additionalProperties' keyword in the OAS document. @@ -350,6 +385,7 @@ public boolean equals(Object o) { } ServerNetwork serverNetwork = (ServerNetwork) o; return Objects.equals(this.allowedAddresses, serverNetwork.allowedAddresses) + && Objects.equals(this.createdAt, serverNetwork.createdAt) && Objects.equals(this.ipv4, serverNetwork.ipv4) && Objects.equals(this.ipv6, serverNetwork.ipv6) && Objects.equals(this.mac, serverNetwork.mac) @@ -359,6 +395,7 @@ public boolean equals(Object o) { && Objects.equals(this.nicSecurity, serverNetwork.nicSecurity) && Objects.equals(this.publicIp, serverNetwork.publicIp) && Objects.equals(this.securityGroups, serverNetwork.securityGroups) + && Objects.equals(this.updatedAt, serverNetwork.updatedAt) && Objects.equals(this.additionalProperties, serverNetwork.additionalProperties); } @@ -366,6 +403,7 @@ public boolean equals(Object o) { public int hashCode() { return Objects.hash( allowedAddresses, + createdAt, ipv4, ipv6, mac, @@ -375,6 +413,7 @@ public int hashCode() { nicSecurity, publicIp, securityGroups, + updatedAt, additionalProperties); } @@ -383,6 +422,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ServerNetwork {\n"); sb.append(" allowedAddresses: ").append(toIndentedString(allowedAddresses)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); sb.append(" ipv4: ").append(toIndentedString(ipv4)).append("\n"); sb.append(" ipv6: ").append(toIndentedString(ipv6)).append("\n"); sb.append(" mac: ").append(toIndentedString(mac)).append("\n"); @@ -392,6 +432,7 @@ public String toString() { sb.append(" nicSecurity: ").append(toIndentedString(nicSecurity)).append("\n"); sb.append(" publicIp: ").append(toIndentedString(publicIp)).append("\n"); sb.append(" securityGroups: ").append(toIndentedString(securityGroups)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); @@ -419,6 +460,7 @@ private String toIndentedString(Object o) { new HashSet( Arrays.asList( "allowedAddresses", + "createdAt", "ipv4", "ipv6", "mac", @@ -427,7 +469,8 @@ private String toIndentedString(Object o) { "nicId", "nicSecurity", "publicIp", - "securityGroups")); + "securityGroups", + "updatedAt")); // a set of required properties/fields (JSON key names) openapiRequiredFields = diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdatePublicIPPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdatePublicIPPayload.java index 9b9c73f9..4b02b00b 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdatePublicIPPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdatePublicIPPayload.java @@ -23,6 +23,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; @@ -35,6 +36,11 @@ /** Object that represents a public IP. */ @javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") public class UpdatePublicIPPayload { + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + + @SerializedName(SERIALIZED_NAME_CREATED_AT) + @javax.annotation.Nullable private OffsetDateTime createdAt; + public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @@ -55,12 +61,29 @@ public class UpdatePublicIPPayload { @SerializedName(SERIALIZED_NAME_NETWORK_INTERFACE) @javax.annotation.Nullable private UUID networkInterface; + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable private OffsetDateTime updatedAt; + public UpdatePublicIPPayload() {} - public UpdatePublicIPPayload(UUID id, String ip) { + public UpdatePublicIPPayload( + OffsetDateTime createdAt, UUID id, String ip, OffsetDateTime updatedAt) { this(); + this.createdAt = createdAt; this.id = id; this.ip = ip; + this.updatedAt = updatedAt; + } + + /** + * Date-time when resource was created. + * + * @return createdAt + */ + @javax.annotation.Nullable public OffsetDateTime getCreatedAt() { + return createdAt; } /** @@ -132,6 +155,15 @@ public void setNetworkInterface(@javax.annotation.Nullable UUID networkInterface this.networkInterface = networkInterface; } + /** + * Date-time when resource was last updated. + * + * @return updatedAt + */ + @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + /** * A container for additional, undeclared properties. This is a holder for any undeclared * properties as specified with the 'additionalProperties' keyword in the OAS document. @@ -185,10 +217,12 @@ public boolean equals(Object o) { return false; } UpdatePublicIPPayload updatePublicIPPayload = (UpdatePublicIPPayload) o; - return Objects.equals(this.id, updatePublicIPPayload.id) + return Objects.equals(this.createdAt, updatePublicIPPayload.createdAt) + && Objects.equals(this.id, updatePublicIPPayload.id) && Objects.equals(this.ip, updatePublicIPPayload.ip) && Objects.equals(this.labels, updatePublicIPPayload.labels) && Objects.equals(this.networkInterface, updatePublicIPPayload.networkInterface) + && Objects.equals(this.updatedAt, updatePublicIPPayload.updatedAt) && Objects.equals( this.additionalProperties, updatePublicIPPayload.additionalProperties); } @@ -204,7 +238,8 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(id, ip, labels, networkInterface, additionalProperties); + return Objects.hash( + createdAt, id, ip, labels, networkInterface, updatedAt, additionalProperties); } private static int hashCodeNullable(JsonNullable a) { @@ -218,10 +253,12 @@ private static int hashCodeNullable(JsonNullable a) { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class UpdatePublicIPPayload {\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" ip: ").append(toIndentedString(ip)).append("\n"); sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); sb.append(" networkInterface: ").append(toIndentedString(networkInterface)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); @@ -246,7 +283,14 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = - new HashSet(Arrays.asList("id", "ip", "labels", "networkInterface")); + new HashSet( + Arrays.asList( + "createdAt", + "id", + "ip", + "labels", + "networkInterface", + "updatedAt")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(0); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateNicPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateNicPayload.java index 510d3693..373dcb3a 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateNicPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateNicPayload.java @@ -24,6 +24,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; @@ -41,6 +42,11 @@ public class CreateNicPayload { @SerializedName(SERIALIZED_NAME_ALLOWED_ADDRESSES) @javax.annotation.Nullable private List allowedAddresses = new ArrayList<>(); + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + + @SerializedName(SERIALIZED_NAME_CREATED_AT) + @javax.annotation.Nullable private OffsetDateTime createdAt; + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; @SerializedName(SERIALIZED_NAME_DESCRIPTION) @@ -106,17 +112,31 @@ public class CreateNicPayload { @SerializedName(SERIALIZED_NAME_TYPE) @javax.annotation.Nullable private String type; + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable private OffsetDateTime updatedAt; + public CreateNicPayload() {} public CreateNicPayload( - UUID device, UUID id, String mac, UUID networkId, String status, String type) { + OffsetDateTime createdAt, + UUID device, + UUID id, + String mac, + UUID networkId, + String status, + String type, + OffsetDateTime updatedAt) { this(); + this.createdAt = createdAt; this.device = device; this.id = id; this.mac = mac; this.networkId = networkId; this.status = status; this.type = type; + this.updatedAt = updatedAt; } public CreateNicPayload allowedAddresses( @@ -147,6 +167,15 @@ public void setAllowedAddresses( this.allowedAddresses = allowedAddresses; } + /** + * Date-time when resource was created. + * + * @return createdAt + */ + @javax.annotation.Nullable public OffsetDateTime getCreatedAt() { + return createdAt; + } + public CreateNicPayload description(@javax.annotation.Nullable String description) { this.description = description; return this; @@ -350,6 +379,15 @@ public void setSecurityGroups(@javax.annotation.Nullable List securityGrou return type; } + /** + * Date-time when resource was last updated. + * + * @return updatedAt + */ + @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + /** * A container for additional, undeclared properties. This is a holder for any undeclared * properties as specified with the 'additionalProperties' keyword in the OAS document. @@ -404,6 +442,7 @@ public boolean equals(Object o) { } CreateNicPayload createNicPayload = (CreateNicPayload) o; return Objects.equals(this.allowedAddresses, createNicPayload.allowedAddresses) + && Objects.equals(this.createdAt, createNicPayload.createdAt) && Objects.equals(this.description, createNicPayload.description) && Objects.equals(this.device, createNicPayload.device) && Objects.equals(this.id, createNicPayload.id) @@ -417,6 +456,7 @@ public boolean equals(Object o) { && Objects.equals(this.securityGroups, createNicPayload.securityGroups) && Objects.equals(this.status, createNicPayload.status) && Objects.equals(this.type, createNicPayload.type) + && Objects.equals(this.updatedAt, createNicPayload.updatedAt) && Objects.equals(this.additionalProperties, createNicPayload.additionalProperties); } @@ -424,6 +464,7 @@ public boolean equals(Object o) { public int hashCode() { return Objects.hash( allowedAddresses, + createdAt, description, device, id, @@ -437,6 +478,7 @@ public int hashCode() { securityGroups, status, type, + updatedAt, additionalProperties); } @@ -445,6 +487,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class CreateNicPayload {\n"); sb.append(" allowedAddresses: ").append(toIndentedString(allowedAddresses)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" device: ").append(toIndentedString(device)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); @@ -458,6 +501,7 @@ public String toString() { sb.append(" securityGroups: ").append(toIndentedString(securityGroups)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); @@ -485,6 +529,7 @@ private String toIndentedString(Object o) { new HashSet( Arrays.asList( "allowedAddresses", + "createdAt", "description", "device", "id", @@ -497,7 +542,8 @@ private String toIndentedString(Object o) { "nicSecurity", "securityGroups", "status", - "type")); + "type", + "updatedAt")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(0); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreatePublicIPPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreatePublicIPPayload.java index 52050a4e..7948433c 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreatePublicIPPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreatePublicIPPayload.java @@ -23,6 +23,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; @@ -35,6 +36,11 @@ /** Object that represents a public IP. */ @javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") public class CreatePublicIPPayload { + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + + @SerializedName(SERIALIZED_NAME_CREATED_AT) + @javax.annotation.Nullable private OffsetDateTime createdAt; + public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @@ -55,12 +61,29 @@ public class CreatePublicIPPayload { @SerializedName(SERIALIZED_NAME_NETWORK_INTERFACE) @javax.annotation.Nullable private UUID networkInterface; + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable private OffsetDateTime updatedAt; + public CreatePublicIPPayload() {} - public CreatePublicIPPayload(UUID id, String ip) { + public CreatePublicIPPayload( + OffsetDateTime createdAt, UUID id, String ip, OffsetDateTime updatedAt) { this(); + this.createdAt = createdAt; this.id = id; this.ip = ip; + this.updatedAt = updatedAt; + } + + /** + * Date-time when resource was created. + * + * @return createdAt + */ + @javax.annotation.Nullable public OffsetDateTime getCreatedAt() { + return createdAt; } /** @@ -132,6 +155,15 @@ public void setNetworkInterface(@javax.annotation.Nullable UUID networkInterface this.networkInterface = networkInterface; } + /** + * Date-time when resource was last updated. + * + * @return updatedAt + */ + @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + /** * A container for additional, undeclared properties. This is a holder for any undeclared * properties as specified with the 'additionalProperties' keyword in the OAS document. @@ -185,10 +217,12 @@ public boolean equals(Object o) { return false; } CreatePublicIPPayload createPublicIPPayload = (CreatePublicIPPayload) o; - return Objects.equals(this.id, createPublicIPPayload.id) + return Objects.equals(this.createdAt, createPublicIPPayload.createdAt) + && Objects.equals(this.id, createPublicIPPayload.id) && Objects.equals(this.ip, createPublicIPPayload.ip) && Objects.equals(this.labels, createPublicIPPayload.labels) && Objects.equals(this.networkInterface, createPublicIPPayload.networkInterface) + && Objects.equals(this.updatedAt, createPublicIPPayload.updatedAt) && Objects.equals( this.additionalProperties, createPublicIPPayload.additionalProperties); } @@ -204,7 +238,8 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(id, ip, labels, networkInterface, additionalProperties); + return Objects.hash( + createdAt, id, ip, labels, networkInterface, updatedAt, additionalProperties); } private static int hashCodeNullable(JsonNullable a) { @@ -218,10 +253,12 @@ private static int hashCodeNullable(JsonNullable a) { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class CreatePublicIPPayload {\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" ip: ").append(toIndentedString(ip)).append("\n"); sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); sb.append(" networkInterface: ").append(toIndentedString(networkInterface)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); @@ -246,7 +283,14 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = - new HashSet(Arrays.asList("id", "ip", "labels", "networkInterface")); + new HashSet( + Arrays.asList( + "createdAt", + "id", + "ip", + "labels", + "networkInterface", + "updatedAt")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(0); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NIC.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NIC.java index 41578843..f4a02874 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NIC.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NIC.java @@ -24,6 +24,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; @@ -41,6 +42,11 @@ public class NIC { @SerializedName(SERIALIZED_NAME_ALLOWED_ADDRESSES) @javax.annotation.Nullable private List allowedAddresses = new ArrayList<>(); + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + + @SerializedName(SERIALIZED_NAME_CREATED_AT) + @javax.annotation.Nullable private OffsetDateTime createdAt; + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; @SerializedName(SERIALIZED_NAME_DESCRIPTION) @@ -106,16 +112,31 @@ public class NIC { @SerializedName(SERIALIZED_NAME_TYPE) @javax.annotation.Nullable private String type; + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable private OffsetDateTime updatedAt; + public NIC() {} - public NIC(UUID device, UUID id, String mac, UUID networkId, String status, String type) { + public NIC( + OffsetDateTime createdAt, + UUID device, + UUID id, + String mac, + UUID networkId, + String status, + String type, + OffsetDateTime updatedAt) { this(); + this.createdAt = createdAt; this.device = device; this.id = id; this.mac = mac; this.networkId = networkId; this.status = status; this.type = type; + this.updatedAt = updatedAt; } public NIC allowedAddresses( @@ -146,6 +167,15 @@ public void setAllowedAddresses( this.allowedAddresses = allowedAddresses; } + /** + * Date-time when resource was created. + * + * @return createdAt + */ + @javax.annotation.Nullable public OffsetDateTime getCreatedAt() { + return createdAt; + } + public NIC description(@javax.annotation.Nullable String description) { this.description = description; return this; @@ -349,6 +379,15 @@ public void setSecurityGroups(@javax.annotation.Nullable List securityGrou return type; } + /** + * Date-time when resource was last updated. + * + * @return updatedAt + */ + @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + /** * A container for additional, undeclared properties. This is a holder for any undeclared * properties as specified with the 'additionalProperties' keyword in the OAS document. @@ -403,6 +442,7 @@ public boolean equals(Object o) { } NIC NIC = (NIC) o; return Objects.equals(this.allowedAddresses, NIC.allowedAddresses) + && Objects.equals(this.createdAt, NIC.createdAt) && Objects.equals(this.description, NIC.description) && Objects.equals(this.device, NIC.device) && Objects.equals(this.id, NIC.id) @@ -416,6 +456,7 @@ public boolean equals(Object o) { && Objects.equals(this.securityGroups, NIC.securityGroups) && Objects.equals(this.status, NIC.status) && Objects.equals(this.type, NIC.type) + && Objects.equals(this.updatedAt, NIC.updatedAt) && Objects.equals(this.additionalProperties, NIC.additionalProperties); } @@ -423,6 +464,7 @@ public boolean equals(Object o) { public int hashCode() { return Objects.hash( allowedAddresses, + createdAt, description, device, id, @@ -436,6 +478,7 @@ public int hashCode() { securityGroups, status, type, + updatedAt, additionalProperties); } @@ -444,6 +487,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class NIC {\n"); sb.append(" allowedAddresses: ").append(toIndentedString(allowedAddresses)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" device: ").append(toIndentedString(device)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); @@ -457,6 +501,7 @@ public String toString() { sb.append(" securityGroups: ").append(toIndentedString(securityGroups)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); @@ -484,6 +529,7 @@ private String toIndentedString(Object o) { new HashSet( Arrays.asList( "allowedAddresses", + "createdAt", "description", "device", "id", @@ -496,7 +542,8 @@ private String toIndentedString(Object o) { "nicSecurity", "securityGroups", "status", - "type")); + "type", + "updatedAt")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(0); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/PublicIp.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/PublicIp.java index b0511655..0eb12237 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/PublicIp.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/PublicIp.java @@ -23,6 +23,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; @@ -35,6 +36,11 @@ /** Object that represents a public IP. */ @javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") public class PublicIp { + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + + @SerializedName(SERIALIZED_NAME_CREATED_AT) + @javax.annotation.Nullable private OffsetDateTime createdAt; + public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @@ -55,12 +61,28 @@ public class PublicIp { @SerializedName(SERIALIZED_NAME_NETWORK_INTERFACE) @javax.annotation.Nullable private UUID networkInterface; + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable private OffsetDateTime updatedAt; + public PublicIp() {} - public PublicIp(UUID id, String ip) { + public PublicIp(OffsetDateTime createdAt, UUID id, String ip, OffsetDateTime updatedAt) { this(); + this.createdAt = createdAt; this.id = id; this.ip = ip; + this.updatedAt = updatedAt; + } + + /** + * Date-time when resource was created. + * + * @return createdAt + */ + @javax.annotation.Nullable public OffsetDateTime getCreatedAt() { + return createdAt; } /** @@ -131,6 +153,15 @@ public void setNetworkInterface(@javax.annotation.Nullable UUID networkInterface this.networkInterface = networkInterface; } + /** + * Date-time when resource was last updated. + * + * @return updatedAt + */ + @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + /** * A container for additional, undeclared properties. This is a holder for any undeclared * properties as specified with the 'additionalProperties' keyword in the OAS document. @@ -184,10 +215,12 @@ public boolean equals(Object o) { return false; } PublicIp publicIp = (PublicIp) o; - return Objects.equals(this.id, publicIp.id) + return Objects.equals(this.createdAt, publicIp.createdAt) + && Objects.equals(this.id, publicIp.id) && Objects.equals(this.ip, publicIp.ip) && Objects.equals(this.labels, publicIp.labels) && Objects.equals(this.networkInterface, publicIp.networkInterface) + && Objects.equals(this.updatedAt, publicIp.updatedAt) && Objects.equals(this.additionalProperties, publicIp.additionalProperties); } @@ -202,7 +235,8 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(id, ip, labels, networkInterface, additionalProperties); + return Objects.hash( + createdAt, id, ip, labels, networkInterface, updatedAt, additionalProperties); } private static int hashCodeNullable(JsonNullable a) { @@ -216,10 +250,12 @@ private static int hashCodeNullable(JsonNullable a) { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class PublicIp {\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" ip: ").append(toIndentedString(ip)).append("\n"); sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); sb.append(" networkInterface: ").append(toIndentedString(networkInterface)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); @@ -244,7 +280,14 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = - new HashSet(Arrays.asList("id", "ip", "labels", "networkInterface")); + new HashSet( + Arrays.asList( + "createdAt", + "id", + "ip", + "labels", + "networkInterface", + "updatedAt")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(0); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ServerNetwork.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ServerNetwork.java index be063539..cacc0bad 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ServerNetwork.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ServerNetwork.java @@ -24,6 +24,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; @@ -41,6 +42,11 @@ public class ServerNetwork { @SerializedName(SERIALIZED_NAME_ALLOWED_ADDRESSES) @javax.annotation.Nullable private List allowedAddresses = new ArrayList<>(); + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + + @SerializedName(SERIALIZED_NAME_CREATED_AT) + @javax.annotation.Nullable private OffsetDateTime createdAt; + public static final String SERIALIZED_NAME_IPV4 = "ipv4"; @SerializedName(SERIALIZED_NAME_IPV4) @@ -91,8 +97,19 @@ public class ServerNetwork { @SerializedName(SERIALIZED_NAME_SECURITY_GROUPS) @javax.annotation.Nullable private List securityGroups = new ArrayList<>(); + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable private OffsetDateTime updatedAt; + public ServerNetwork() {} + public ServerNetwork(OffsetDateTime createdAt, OffsetDateTime updatedAt) { + this(); + this.createdAt = createdAt; + this.updatedAt = updatedAt; + } + public ServerNetwork allowedAddresses( @javax.annotation.Nullable List allowedAddresses) { this.allowedAddresses = allowedAddresses; @@ -121,6 +138,15 @@ public void setAllowedAddresses( this.allowedAddresses = allowedAddresses; } + /** + * Date-time when resource was created. + * + * @return createdAt + */ + @javax.annotation.Nullable public OffsetDateTime getCreatedAt() { + return createdAt; + } + public ServerNetwork ipv4(@javax.annotation.Nullable String ipv4) { this.ipv4 = ipv4; return this; @@ -296,6 +322,15 @@ public void setSecurityGroups(@javax.annotation.Nullable List securityGrou this.securityGroups = securityGroups; } + /** + * Date-time when resource was last updated. + * + * @return updatedAt + */ + @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + /** * A container for additional, undeclared properties. This is a holder for any undeclared * properties as specified with the 'additionalProperties' keyword in the OAS document. @@ -350,6 +385,7 @@ public boolean equals(Object o) { } ServerNetwork serverNetwork = (ServerNetwork) o; return Objects.equals(this.allowedAddresses, serverNetwork.allowedAddresses) + && Objects.equals(this.createdAt, serverNetwork.createdAt) && Objects.equals(this.ipv4, serverNetwork.ipv4) && Objects.equals(this.ipv6, serverNetwork.ipv6) && Objects.equals(this.mac, serverNetwork.mac) @@ -359,6 +395,7 @@ public boolean equals(Object o) { && Objects.equals(this.nicSecurity, serverNetwork.nicSecurity) && Objects.equals(this.publicIp, serverNetwork.publicIp) && Objects.equals(this.securityGroups, serverNetwork.securityGroups) + && Objects.equals(this.updatedAt, serverNetwork.updatedAt) && Objects.equals(this.additionalProperties, serverNetwork.additionalProperties); } @@ -366,6 +403,7 @@ public boolean equals(Object o) { public int hashCode() { return Objects.hash( allowedAddresses, + createdAt, ipv4, ipv6, mac, @@ -375,6 +413,7 @@ public int hashCode() { nicSecurity, publicIp, securityGroups, + updatedAt, additionalProperties); } @@ -383,6 +422,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ServerNetwork {\n"); sb.append(" allowedAddresses: ").append(toIndentedString(allowedAddresses)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); sb.append(" ipv4: ").append(toIndentedString(ipv4)).append("\n"); sb.append(" ipv6: ").append(toIndentedString(ipv6)).append("\n"); sb.append(" mac: ").append(toIndentedString(mac)).append("\n"); @@ -392,6 +432,7 @@ public String toString() { sb.append(" nicSecurity: ").append(toIndentedString(nicSecurity)).append("\n"); sb.append(" publicIp: ").append(toIndentedString(publicIp)).append("\n"); sb.append(" securityGroups: ").append(toIndentedString(securityGroups)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); @@ -419,6 +460,7 @@ private String toIndentedString(Object o) { new HashSet( Arrays.asList( "allowedAddresses", + "createdAt", "ipv4", "ipv6", "mac", @@ -427,7 +469,8 @@ private String toIndentedString(Object o) { "nicId", "nicSecurity", "publicIp", - "securityGroups")); + "securityGroups", + "updatedAt")); // a set of required properties/fields (JSON key names) openapiRequiredFields = diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdatePublicIPPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdatePublicIPPayload.java index b4b23169..9dcb547c 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdatePublicIPPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdatePublicIPPayload.java @@ -23,6 +23,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; @@ -35,6 +36,11 @@ /** Object that represents a public IP. */ @javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") public class UpdatePublicIPPayload { + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + + @SerializedName(SERIALIZED_NAME_CREATED_AT) + @javax.annotation.Nullable private OffsetDateTime createdAt; + public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @@ -55,12 +61,29 @@ public class UpdatePublicIPPayload { @SerializedName(SERIALIZED_NAME_NETWORK_INTERFACE) @javax.annotation.Nullable private UUID networkInterface; + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable private OffsetDateTime updatedAt; + public UpdatePublicIPPayload() {} - public UpdatePublicIPPayload(UUID id, String ip) { + public UpdatePublicIPPayload( + OffsetDateTime createdAt, UUID id, String ip, OffsetDateTime updatedAt) { this(); + this.createdAt = createdAt; this.id = id; this.ip = ip; + this.updatedAt = updatedAt; + } + + /** + * Date-time when resource was created. + * + * @return createdAt + */ + @javax.annotation.Nullable public OffsetDateTime getCreatedAt() { + return createdAt; } /** @@ -132,6 +155,15 @@ public void setNetworkInterface(@javax.annotation.Nullable UUID networkInterface this.networkInterface = networkInterface; } + /** + * Date-time when resource was last updated. + * + * @return updatedAt + */ + @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + /** * A container for additional, undeclared properties. This is a holder for any undeclared * properties as specified with the 'additionalProperties' keyword in the OAS document. @@ -185,10 +217,12 @@ public boolean equals(Object o) { return false; } UpdatePublicIPPayload updatePublicIPPayload = (UpdatePublicIPPayload) o; - return Objects.equals(this.id, updatePublicIPPayload.id) + return Objects.equals(this.createdAt, updatePublicIPPayload.createdAt) + && Objects.equals(this.id, updatePublicIPPayload.id) && Objects.equals(this.ip, updatePublicIPPayload.ip) && Objects.equals(this.labels, updatePublicIPPayload.labels) && Objects.equals(this.networkInterface, updatePublicIPPayload.networkInterface) + && Objects.equals(this.updatedAt, updatePublicIPPayload.updatedAt) && Objects.equals( this.additionalProperties, updatePublicIPPayload.additionalProperties); } @@ -204,7 +238,8 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(id, ip, labels, networkInterface, additionalProperties); + return Objects.hash( + createdAt, id, ip, labels, networkInterface, updatedAt, additionalProperties); } private static int hashCodeNullable(JsonNullable a) { @@ -218,10 +253,12 @@ private static int hashCodeNullable(JsonNullable a) { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class UpdatePublicIPPayload {\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" ip: ").append(toIndentedString(ip)).append("\n"); sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); sb.append(" networkInterface: ").append(toIndentedString(networkInterface)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); @@ -246,7 +283,14 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = - new HashSet(Arrays.asList("id", "ip", "labels", "networkInterface")); + new HashSet( + Arrays.asList( + "createdAt", + "id", + "ip", + "labels", + "networkInterface", + "updatedAt")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(0); diff --git a/services/iaas/src/test/java/cloud/stackit/sdk/iaas/v2alpha1api/api/DefaultApiTest.java b/services/iaas/src/test/java/cloud/stackit/sdk/iaas/v2alpha1api/api/DefaultApiTest.java deleted file mode 100644 index 9ded143e..00000000 --- a/services/iaas/src/test/java/cloud/stackit/sdk/iaas/v2alpha1api/api/DefaultApiTest.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api; - -import cloud.stackit.sdk.core.KeyFlowAuthenticator; -import cloud.stackit.sdk.core.auth.SetupAuth; -import cloud.stackit.sdk.core.config.CoreConfiguration; -import cloud.stackit.sdk.core.utils.TestUtils; -import java.io.IOException; -import okhttp3.Authenticator; -import okhttp3.OkHttpClient; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public class DefaultApiTest { - @Test - public void TestCustomHttpClient() throws IOException { - // before - CoreConfiguration conf = - new CoreConfiguration().serviceAccountKey(TestUtils.MOCK_SERVICE_ACCOUNT_KEY); - - // when - OkHttpClient httpClient = new OkHttpClient(); - ApiClient apiClient = new ApiClient(httpClient, conf); - - // then - Assertions.assertEquals(httpClient, apiClient.getHttpClient()); - // make sure the http client object is exactly the same object - Assertions.assertSame(httpClient, apiClient.getHttpClient()); - } - - @Test - public void TestNoCustomHttpClient() throws IOException { - // before - CoreConfiguration conf = - new CoreConfiguration().serviceAccountKey(TestUtils.MOCK_SERVICE_ACCOUNT_KEY); - - // when - ApiClient apiClient = new ApiClient(conf); - - // then - /* - * verify a fresh OkHttpClient got created which will have the auth header set - * by the {@link cloud.stackit.sdk.core.KeyFlowAuthenticator} - */ - OkHttpClient httpClient = new OkHttpClient(); - Authenticator authenticator = - new KeyFlowAuthenticator(httpClient, conf, SetupAuth.setupKeyFlow(conf)); - httpClient = httpClient.newBuilder().authenticator(authenticator).build(); - - Assertions.assertNotNull(apiClient.getHttpClient()); - Assertions.assertEquals( - httpClient.authenticator().getClass(), - apiClient.getHttpClient().authenticator().getClass()); - } -} diff --git a/services/iaas/src/test/java/cloud/stackit/sdk/iaas/v2alpha1api/api/IaasApiTest.java b/services/iaas/src/test/java/cloud/stackit/sdk/iaas/v2alpha1api/api/IaasApiTest.java deleted file mode 100644 index 4b307d21..00000000 --- a/services/iaas/src/test/java/cloud/stackit/sdk/iaas/v2alpha1api/api/IaasApiTest.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * STACKIT IaaS API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 2alpha1 - * Contact: stackit-iaas@mail.schwarz - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package cloud.stackit.sdk.iaas.v2alpha1api.api; - -import cloud.stackit.sdk.core.KeyFlowAuthenticator; -import cloud.stackit.sdk.core.auth.SetupAuth; -import cloud.stackit.sdk.core.config.CoreConfiguration; -import cloud.stackit.sdk.core.utils.TestUtils; -import java.io.IOException; -import okhttp3.Authenticator; -import okhttp3.OkHttpClient; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -/** API tests for IaasApi */ -public class IaasApiTest { - @Test - public void TestCustomHttpClient() throws IOException { - // before - CoreConfiguration conf = - new CoreConfiguration().serviceAccountKey(TestUtils.MOCK_SERVICE_ACCOUNT_KEY); - - // when - OkHttpClient httpClient = new OkHttpClient(); - IaasApi api = new IaasApi(httpClient); - - // then - Assertions.assertEquals(httpClient, api.getApiClient().getHttpClient()); - // make sure the http client object is exactly the same object - Assertions.assertSame(httpClient, api.getApiClient().getHttpClient()); - } - - @Test - public void TestNoCustomHttpClient() throws IOException { - // before - CoreConfiguration conf = - new CoreConfiguration().serviceAccountKey(TestUtils.MOCK_SERVICE_ACCOUNT_KEY); - - // when - IaasApi api = new IaasApi(conf); - - // then - /* - * verify a fresh OkHttpClient got created which will have the auth header set - * by the {@link cloud.stackit.sdk.core.KeyFlowAuthenticator} - */ - OkHttpClient httpClient = new OkHttpClient(); - Authenticator authenticator = - new KeyFlowAuthenticator(httpClient, conf, SetupAuth.setupKeyFlow(conf)); - httpClient = httpClient.newBuilder().authenticator(authenticator).build(); - - Assertions.assertNotNull(api.getApiClient().getHttpClient()); - Assertions.assertEquals( - httpClient.authenticator().getClass(), - api.getApiClient().getHttpClient().authenticator().getClass()); - } -}