diff --git a/.github/workflows/sync-crossconnectsv2.yaml b/.github/workflows/sync-crossconnectsv2.yaml
new file mode 100644
index 00000000..6554ac1c
--- /dev/null
+++ b/.github/workflows/sync-crossconnectsv2.yaml
@@ -0,0 +1,96 @@
+name: Sync crossconnectsv2 API spec
+
+on:
+ workflow_dispatch:
+
+jobs:
+ sync:
+ strategy:
+ matrix:
+ java-version: [11.0.21]
+ java-distribution: [temurin]
+ os: [ubuntu-latest]
+ runs-on: ${{ matrix.os }}
+
+ steps:
+ - name: Get current date
+ id: date
+ run: echo "date=$(date +'%Y-%m-%d')" >> "$GITHUB_OUTPUT"
+
+ - name: Install Java
+ uses: actions/setup-java@v4
+ with:
+ java-version: ${{ matrix.java-version }}
+ distribution: ${{ matrix.java-distribution }}
+
+ - name: Checkout code
+ uses: actions/checkout@v4
+
+ - name: GitHub user
+ run: |
+ # https://api.github.com/users/github-actions[bot]
+ git config user.name 'github-actions[bot]'
+ git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
+
+ - name: Fetch latest spec
+ id: fetch
+ run: |
+ make -f Makefile.crossconnectsv2 fetch
+ git add spec/services/crossconnectsv2
+ echo `git commit -m 'sync: fetch ${{ steps.date.outputs.date }} spec'`
+
+ - name: Apply spec patches
+ id: patch
+ if: ${{ always() && steps.fetch.conclusion == 'success' }}
+ run: |
+ make -f Makefile.crossconnectsv2 patch
+ git add spec/services/crossconnectsv2
+ echo `git commit -m 'sync: patch spec with ${{ steps.date.outputs.date }} spec'`
+
+ - name: Generate code
+ id: generate
+ if: ${{ always() && steps.fetch.conclusion == 'success' }}
+ run: |
+ make -f Makefile.crossconnectsv2 generate
+ git add services/crossconnectsv2
+ echo `git commit -m 'sync: generate client with ${{ steps.date.outputs.date }} spec'`
+
+ - name: Create Pull Request
+ id: cpr
+ uses: peter-evans/create-pull-request@v7
+ if: ${{ always() && steps.fetch.conclusion == 'success' }}
+ with:
+ branch: sync/gh
+ branch-suffix: timestamp
+ author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
+ commit-message: "sync: uncommitted changes detected when opening PR"
+ title: "feat: API Sync by GitHub Action for @${{ github.event.sender.login }}"
+ body: |
+ This API Sync PR was triggered by @${{ github.event.sender.login }} through [GitHub Actions workflow_displatch](https://github.com/equinix/equinix-sdk-go/actions?query=event%3Aworkflow_dispatch)
+ on ${{ steps.date.outputs.date }}.
+
+ * latest Swagger is fetched
+ * patches have been applied
+ * generated client has been updated
+ delete-branch: true
+ draft: ${{ steps.patch.conclusion == 'failure' || steps.generate.conclusion == 'failure' }}
+
+ - name: Comment for failed patch
+ uses: mshick/add-pr-comment@v2
+ if: ${{ always() && steps.patch.conclusion == 'failure' && steps.cpr.conclusion == 'success' }}
+ with:
+ issue: ${{ steps.cpr.outputs.pull-request-number }}
+ message: Failed to patch latest spec. Someone with write access must review and, if necessary, fix this PR manually and then convert it from Draft status to Ready for Review.
+
+ - name: Comment for failed generate
+ uses: mshick/add-pr-comment@v2
+ if: ${{ always() && steps.generate.conclusion == 'failure' && steps.cpr.conclusion == 'success' }}
+ with:
+ issue: ${{ steps.cpr.outputs.pull-request-number }}
+ message: Failed to generate code from latest patched spec. Someone with write access must fix this PR manually and then convert it from Draft status to Ready for Review.
+
+ - name: Check outputs
+ if: ${{ always() && steps.cpr.conclusion == 'success' }}
+ run: |
+ echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
+ echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
diff --git a/Makefile.crossconnectsv2 b/Makefile.crossconnectsv2
new file mode 100644
index 00000000..7da7a11b
--- /dev/null
+++ b/Makefile.crossconnectsv2
@@ -0,0 +1,65 @@
+.PHONY: all pull fetch patch generate clean codegen mod docs move-other patch-post fmt test stage
+
+include Makefile
+
+PACKAGE_NAME=crossconnectsv2
+SPEC_BASE_URL:=https://docs.equinix.com/api-catalog/crossconnectsv2
+SPEC_ROOT_FILE:=openapi.yaml
+
+CODE_DIR=services/${PACKAGE_NAME}
+TEMPLATE_DIR=${TEMPLATE_BASE_DIR}/${PACKAGE_NAME}
+SPEC_FETCHED_DIR=${SPEC_BASE_DIR}/${PACKAGE_NAME}/oas3.fetched
+SPEC_PATCH_DIR=${SPEC_BASE_DIR}/${PACKAGE_NAME}/patches
+SPEC_PATCHED_DIR=${SPEC_BASE_DIR}/${PACKAGE_NAME}/oas3.patched
+SPEC_FETCHER=curl
+
+ARTIFACT_ID=${GIT_REPO}-${PACKAGE_NAME}
+
+all: pull fetch patch generate stage
+
+generate: clean codegen patch-post fmt test
+
+pull:
+ ${CRI} pull ${OPENAPI_IMAGE}
+
+fetch:
+ ${SPEC_FETCHER} -o ${SPEC_FETCHED_DIR}/${SPEC_ROOT_FILE} ${SPEC_BASE_URL}/${SPEC_ROOT_FILE}
+
+patch:
+ rm -rf ${SPEC_PATCHED_DIR}
+ cp -r ${SPEC_FETCHED_DIR} ${SPEC_PATCHED_DIR}
+
+ for diff in $(shell set -x; find ${SPEC_PATCH_DIR} -name '*.patch' | sort -n); do \
+ patch --no-backup-if-mismatch -N -t -p1 -i $$diff; \
+ RESULT=$$(($${RESULT} + $$?)); \
+ done; \
+ exit $$RESULT;
+
+patch-post:
+ # patch is idempotent, always starting with the generated files
+ for diff in $(shell find patches/services/${PACKAGE_NAME} -name \*.patch | sort -n); do \
+ patch --no-backup-if-mismatch -N -t -p1 -i $$diff; \
+ done
+
+clean:
+ rm -rf $(CODE_DIR)
+
+codegen:
+ ${OPENAPI_GENERATOR} generate -g java \
+ --http-user-agent "${USER_AGENT}" \
+ -p artifactVersion=${PACKAGE_VERSION} \
+ -p artifactId="${PACKAGE_NAME}" \
+ -p invokerPackage="com.equinix.sdk.${PACKAGE_NAME}" \
+ -p apiPackage="com.equinix.sdk.${PACKAGE_NAME}.api" \
+ -p modelPackage="com.equinix.sdk.${PACKAGE_NAME}.model" \
+ -i ${SPEC_PATCHED_DIR}/${SPEC_ROOT_FILE} \
+ -t ${TEMPLATE_DIR} \
+ -c config/openapi-generator.json \
+ -o ${CODE_DIR} \
+ --git-repo-id ${GIT_REPO} \
+ --git-user-id ${GIT_ORG}
+
+validate:
+ ${OPENAPI_GENERATOR} validate \
+ --recommend \
+ -i ${SPEC_PATCHED_DIR}/${SPEC_ROOT_FILE}
diff --git a/equinix-sdk-java/pom.xml b/equinix-sdk-java/pom.xml
index e3fca044..5c325eb7 100644
--- a/equinix-sdk-java/pom.xml
+++ b/equinix-sdk-java/pom.xml
@@ -18,5 +18,10 @@
fabricv4${project.version}
+
+ com.equinix.sdk
+ crossconnectsv2
+ ${project.version}
+
\ No newline at end of file
diff --git a/examples/crossconnectsv2/README.md b/examples/crossconnectsv2/README.md
new file mode 100644
index 00000000..08d69478
--- /dev/null
+++ b/examples/crossconnectsv2/README.md
@@ -0,0 +1,24 @@
+# crossconnectsv2 examples
+
+Examples for the Equinix Cross Connects v2 service. See [examples/README.md](../README.md) for the
+environment variables and how to run them.
+
+The service only has operations that create or modify orders, so the three order examples below do
+not send anything unless `EQUINIX_EXAMPLE_ALLOW_WRITES=true` is set. They build a realistic request
+and print how to opt in otherwise. Clients here are not expected to match the earlier standalone
+samples 1:1; the examples follow the maintained, spec-generated SDK.
+
+| Example | Shows | Replaces (earlier sample operation) |
+| --- | --- | --- |
+| `OrderCrossConnect` | ordering a standard fiber cross connect between two patch panels (creates an order, guarded) | standard, intracustomer, extended and fiber cross connect orders |
+| `RequestDeinstall` | ordering the removal of an existing cross connect by asset ID (guarded) | cross connect deinstall order |
+| `UpdateOrderContacts` | adding a notification contact to an existing order (modifies an order, guarded) | none |
+| `HandleCrossConnectErrors` | catching `ApiException`, reading status, headers and body, parsing `ErrorDetails`; sends an invalid token so nothing is created | none |
+
+The service has no read operations, so there is no order retrieval example. It also has no list or
+search operations, so there is no pagination example. The earlier sample's lookups (providers,
+locations, types, connection services, patch panels) belong to other services and are not part of this
+one.
+
+`OrderCrossConnect` uses `EQUINIX_EXAMPLE_ALLOW_WRITES`; `RequestDeinstall` also reads
+`EQUINIX_EXAMPLE_ASSET_ID` and `UpdateOrderContacts` reads `EQUINIX_EXAMPLE_ORDER_ID`.
diff --git a/examples/crossconnectsv2/pom.xml b/examples/crossconnectsv2/pom.xml
new file mode 100644
index 00000000..b68e5f92
--- /dev/null
+++ b/examples/crossconnectsv2/pom.xml
@@ -0,0 +1,24 @@
+
+ 4.0.0
+
+ com.equinix.sdk
+ equinix-sdk-java-examples
+ 0.11.0
+
+ examples-crossconnectsv2
+ examples-crossconnectsv2
+
+
+
+ com.equinix.sdk
+ crossconnectsv2
+ ${project.version}
+
+
+ com.equinix.sdk
+ examples-common
+ ${project.version}
+
+
+
diff --git a/examples/crossconnectsv2/src/main/java/com/equinix/sdk/examples/crossconnectsv2/HandleCrossConnectErrors.java b/examples/crossconnectsv2/src/main/java/com/equinix/sdk/examples/crossconnectsv2/HandleCrossConnectErrors.java
new file mode 100644
index 00000000..7af1ba05
--- /dev/null
+++ b/examples/crossconnectsv2/src/main/java/com/equinix/sdk/examples/crossconnectsv2/HandleCrossConnectErrors.java
@@ -0,0 +1,45 @@
+package com.equinix.sdk.examples.crossconnectsv2;
+
+import com.equinix.sdk.crossconnectsv2.ApiClient;
+import com.equinix.sdk.crossconnectsv2.ApiException;
+import com.equinix.sdk.crossconnectsv2.Configuration;
+import com.equinix.sdk.crossconnectsv2.JSON;
+import com.equinix.sdk.crossconnectsv2.api.CrossConnectsApi;
+import com.equinix.sdk.crossconnectsv2.auth.HttpBearerAuth;
+import com.equinix.sdk.crossconnectsv2.model.ErrorDetails;
+import com.equinix.sdk.crossconnectsv2.model.Layer1Create;
+import com.equinix.sdk.examples.ExampleEnv;
+
+/**
+ * Shows how failures surface: every non-2xx response is thrown as an {@link ApiException} carrying the
+ * HTTP status, response headers and raw body, and the body can be parsed into the service's error
+ * model.
+ *
+ *
Deliberately authenticates with an invalid token so that the order request is refused before
+ * anything is created. It needs no credentials and creates no resources.
+ */
+public class HandleCrossConnectErrors {
+ public static void main(String[] args) {
+ ApiClient client = Configuration.getDefaultApiClient();
+ client.setBasePath(ExampleEnv.endpoint());
+ ((HttpBearerAuth) client.getAuthentication("BearerAuth")).setBearerToken("not-a-real-token");
+ CrossConnectsApi api = new CrossConnectsApi(client);
+
+ try {
+ api.orderCrossConnects(new Layer1Create());
+ System.out.println("unexpectedly succeeded");
+ } catch (ApiException e) {
+ System.out.println("HTTP status: " + e.getCode());
+ System.out.println("headers: " + e.getResponseHeaders());
+ try {
+ ErrorDetails error = JSON.getGson().fromJson(e.getResponseBody(), ErrorDetails.class);
+ System.out.println("error code: " + error.getErrorCode());
+ System.out.println("message: " + error.getErrorMessage());
+ System.out.println("correlation: " + error.getCorrelationId());
+ } catch (RuntimeException notJson) {
+ // gateways and proxies can return non-JSON bodies, e.g. for 502/503
+ System.out.println("raw body: " + e.getResponseBody());
+ }
+ }
+ }
+}
diff --git a/examples/crossconnectsv2/src/main/java/com/equinix/sdk/examples/crossconnectsv2/OrderCrossConnect.java b/examples/crossconnectsv2/src/main/java/com/equinix/sdk/examples/crossconnectsv2/OrderCrossConnect.java
new file mode 100644
index 00000000..9f11d7f3
--- /dev/null
+++ b/examples/crossconnectsv2/src/main/java/com/equinix/sdk/examples/crossconnectsv2/OrderCrossConnect.java
@@ -0,0 +1,71 @@
+package com.equinix.sdk.examples.crossconnectsv2;
+
+import com.equinix.sdk.crossconnectsv2.ApiClient;
+import com.equinix.sdk.crossconnectsv2.ApiException;
+import com.equinix.sdk.crossconnectsv2.ApiResponse;
+import com.equinix.sdk.crossconnectsv2.Configuration;
+import com.equinix.sdk.crossconnectsv2.api.CrossConnectsApi;
+import com.equinix.sdk.crossconnectsv2.auth.HttpBearerAuth;
+import com.equinix.sdk.crossconnectsv2.model.ASide;
+import com.equinix.sdk.crossconnectsv2.model.ConnectionServices;
+import com.equinix.sdk.crossconnectsv2.model.ContactRequestRegisteredUser;
+import com.equinix.sdk.crossconnectsv2.model.ConnectorTypes;
+import com.equinix.sdk.crossconnectsv2.model.Layer1Create;
+import com.equinix.sdk.crossconnectsv2.model.Layer1CreateContactsInner;
+import com.equinix.sdk.crossconnectsv2.model.Layer1Details;
+import com.equinix.sdk.crossconnectsv2.model.MediaTypes;
+import com.equinix.sdk.crossconnectsv2.model.PatchPanel;
+import com.equinix.sdk.crossconnectsv2.model.ProtocolTypes;
+import com.equinix.sdk.crossconnectsv2.model.ZSide;
+import com.equinix.sdk.crossconnectsv2.model.ZSideWithPatchPanel;
+import com.equinix.sdk.examples.ExampleEnv;
+import java.math.BigDecimal;
+
+/**
+ * Orders one standard single mode fiber cross connect between two patch panels.
+ *
+ *
Creates an order, which Equinix will then fulfil, so it only sends the request when
+ * EQUINIX_EXAMPLE_ALLOW_WRITES=true. Replace the patch panel IDs and contact below with your own
+ * (look them up in the Lookup API) before enabling it.
+ */
+public class OrderCrossConnect {
+ public static void main(String[] args) throws Exception {
+ ApiClient client = Configuration.getDefaultApiClient();
+ client.setBasePath(ExampleEnv.endpoint());
+ ((HttpBearerAuth) client.getAuthentication("BearerAuth")).setBearerToken(ExampleEnv.token());
+ CrossConnectsApi api = new CrossConnectsApi(client);
+
+ // one entry in details is one cross connect; add more entries to order several in one request
+ Layer1Create order = new Layer1Create()
+ .customerReferenceId("example-order-1")
+ .description("Created from the SDK examples")
+ .addDetailsItem(new Layer1Details()
+ .aSide(new ASide()
+ .connectionService(ConnectionServices.SINGLE_MODE_FIBER)
+ .mediaType(MediaTypes.SINGLE_MODE_FIBER)
+ .protocolType(ProtocolTypes._10_GIG_ETHERNET)
+ .connectorType(ConnectorTypes.FC)
+ .patchPanel(new PatchPanel().id("CP:0104:1199890").portA(new BigDecimal(12)).portB(new BigDecimal(13))))
+ // zSide and contacts are oneOf types: wrap the variant that applies. This one
+ // connects to an existing patch panel; ZSideWithLOA is for a new provider.
+ .zSide(new ZSide(new ZSideWithPatchPanel()
+ .connectorType(ConnectorTypes.LC)
+ .circuitId("1-12312312")
+ .patchPanel(new PatchPanel().id("PP:0104:1190123")))))
+ .addContactsItem(new Layer1CreateContactsInner(new ContactRequestRegisteredUser()
+ .type(ContactRequestRegisteredUser.TypeEnum.NOTIFICATION)
+ .addRegisteredUsersItem("john_doe")));
+
+ if (!WriteGuard.allowed()) {
+ return;
+ }
+
+ try {
+ ApiResponse response = api.orderCrossConnectsWithHttpInfo(order);
+ System.out.println("HTTP status: " + response.getStatusCode());
+ System.out.println("order: " + response.getHeaders().get("Location"));
+ } catch (ApiException e) {
+ System.out.println("order rejected with HTTP " + e.getCode() + ": " + e.getResponseBody());
+ }
+ }
+}
diff --git a/examples/crossconnectsv2/src/main/java/com/equinix/sdk/examples/crossconnectsv2/RequestDeinstall.java b/examples/crossconnectsv2/src/main/java/com/equinix/sdk/examples/crossconnectsv2/RequestDeinstall.java
new file mode 100644
index 00000000..e445ea98
--- /dev/null
+++ b/examples/crossconnectsv2/src/main/java/com/equinix/sdk/examples/crossconnectsv2/RequestDeinstall.java
@@ -0,0 +1,50 @@
+package com.equinix.sdk.examples.crossconnectsv2;
+
+import com.equinix.sdk.crossconnectsv2.ApiClient;
+import com.equinix.sdk.crossconnectsv2.ApiException;
+import com.equinix.sdk.crossconnectsv2.ApiResponse;
+import com.equinix.sdk.crossconnectsv2.Configuration;
+import com.equinix.sdk.crossconnectsv2.api.CrossConnectsApi;
+import com.equinix.sdk.crossconnectsv2.auth.HttpBearerAuth;
+import com.equinix.sdk.crossconnectsv2.model.Layer1DeinstallDetails;
+import com.equinix.sdk.crossconnectsv2.model.Layer1DeinstallRequest;
+import com.equinix.sdk.examples.ExampleEnv;
+import java.time.LocalDate;
+
+/**
+ * Places an order to remove an existing cross connect.
+ *
+ *
Requests the removal of real infrastructure, so it only sends the request when
+ * EQUINIX_EXAMPLE_ALLOW_WRITES=true. Set EQUINIX_EXAMPLE_ASSET_ID to the asset ID of the cross
+ * connect to remove; the removal date is one week from today.
+ */
+public class RequestDeinstall {
+ public static void main(String[] args) throws Exception {
+ ApiClient client = Configuration.getDefaultApiClient();
+ client.setBasePath(ExampleEnv.endpoint());
+ ((HttpBearerAuth) client.getAuthentication("BearerAuth")).setBearerToken(ExampleEnv.token());
+ CrossConnectsApi api = new CrossConnectsApi(client);
+
+ String assetId = System.getenv().getOrDefault("EQUINIX_EXAMPLE_ASSET_ID", "4-1234567890");
+ Layer1DeinstallRequest request = new Layer1DeinstallRequest()
+ .customerReferenceId("example-deinstall-1")
+ .description("Created from the SDK examples")
+ .removalDate(LocalDate.now().plusDays(7))
+ .addDetailsItem(new Layer1DeinstallDetails()
+ .assetId(assetId)
+ // false: do not proceed if Equinix detects live traffic on the connection
+ .proceedWithLiveTraffic(false));
+
+ if (!WriteGuard.allowed()) {
+ return;
+ }
+
+ try {
+ ApiResponse response = api.placeCrossConnectDeinstallationOrderWithHttpInfo(request);
+ System.out.println("HTTP status: " + response.getStatusCode());
+ System.out.println("order: " + response.getHeaders().get("Location"));
+ } catch (ApiException e) {
+ System.out.println("deinstall rejected with HTTP " + e.getCode() + ": " + e.getResponseBody());
+ }
+ }
+}
diff --git a/examples/crossconnectsv2/src/main/java/com/equinix/sdk/examples/crossconnectsv2/UpdateOrderContacts.java b/examples/crossconnectsv2/src/main/java/com/equinix/sdk/examples/crossconnectsv2/UpdateOrderContacts.java
new file mode 100644
index 00000000..a87708b9
--- /dev/null
+++ b/examples/crossconnectsv2/src/main/java/com/equinix/sdk/examples/crossconnectsv2/UpdateOrderContacts.java
@@ -0,0 +1,42 @@
+package com.equinix.sdk.examples.crossconnectsv2;
+
+import com.equinix.sdk.crossconnectsv2.ApiClient;
+import com.equinix.sdk.crossconnectsv2.ApiException;
+import com.equinix.sdk.crossconnectsv2.Configuration;
+import com.equinix.sdk.crossconnectsv2.api.CrossConnectsApi;
+import com.equinix.sdk.crossconnectsv2.auth.HttpBearerAuth;
+import com.equinix.sdk.crossconnectsv2.model.ContactRequestRegisteredUserUpdate;
+import com.equinix.sdk.crossconnectsv2.model.ModifyRequest;
+import com.equinix.sdk.examples.ExampleEnv;
+
+/**
+ * Adds a notification contact to an existing cross connect order.
+ *
+ *
Modifies an order, so it only sends the request when EQUINIX_EXAMPLE_ALLOW_WRITES=true. Set
+ * EQUINIX_EXAMPLE_ORDER_ID to the order to change.
+ */
+public class UpdateOrderContacts {
+ public static void main(String[] args) throws Exception {
+ ApiClient client = Configuration.getDefaultApiClient();
+ client.setBasePath(ExampleEnv.endpoint());
+ ((HttpBearerAuth) client.getAuthentication("BearerAuth")).setBearerToken(ExampleEnv.token());
+ CrossConnectsApi api = new CrossConnectsApi(client);
+
+ String orderId = System.getenv().getOrDefault("EQUINIX_EXAMPLE_ORDER_ID", "1-123456789");
+ ModifyRequest request = new ModifyRequest()
+ .addContactsItem(new ContactRequestRegisteredUserUpdate()
+ .type(ContactRequestRegisteredUserUpdate.TypeEnum.NOTIFICATION)
+ .addRegisteredUsersItem("john_doe"));
+
+ if (!WriteGuard.allowed()) {
+ return;
+ }
+
+ try {
+ api.updateACrossConnectOrder(orderId, request);
+ System.out.println("order " + orderId + " updated");
+ } catch (ApiException e) {
+ System.out.println("update rejected with HTTP " + e.getCode() + ": " + e.getResponseBody());
+ }
+ }
+}
diff --git a/examples/crossconnectsv2/src/main/java/com/equinix/sdk/examples/crossconnectsv2/WriteGuard.java b/examples/crossconnectsv2/src/main/java/com/equinix/sdk/examples/crossconnectsv2/WriteGuard.java
new file mode 100644
index 00000000..79396251
--- /dev/null
+++ b/examples/crossconnectsv2/src/main/java/com/equinix/sdk/examples/crossconnectsv2/WriteGuard.java
@@ -0,0 +1,19 @@
+package com.equinix.sdk.examples.crossconnectsv2;
+
+/**
+ * Keeps the examples that place or change orders from running by accident: they only send their
+ * request when EQUINIX_EXAMPLE_ALLOW_WRITES is {@code true}.
+ */
+final class WriteGuard {
+ private WriteGuard() {}
+
+ /** Returns true if the caller opted in; otherwise prints how to opt in and returns false. */
+ static boolean allowed() {
+ if ("true".equals(System.getenv("EQUINIX_EXAMPLE_ALLOW_WRITES"))) {
+ return true;
+ }
+ System.out.println("This example places or changes an order, so it is disabled by default.");
+ System.out.println("Review the request, then set EQUINIX_EXAMPLE_ALLOW_WRITES=true to send it.");
+ return false;
+ }
+}
diff --git a/examples/crossconnectsv2/src/main/java/com/equinix/sdk/examples/crossconnectsv2/package-info.java b/examples/crossconnectsv2/src/main/java/com/equinix/sdk/examples/crossconnectsv2/package-info.java
new file mode 100644
index 00000000..40e4ee29
--- /dev/null
+++ b/examples/crossconnectsv2/src/main/java/com/equinix/sdk/examples/crossconnectsv2/package-info.java
@@ -0,0 +1,10 @@
+/**
+ * Examples for the Equinix Cross Connects v2 service (crossconnectsv2).
+ *
+ *
+ *
+ * @param code HTTP status code
+ * @param message the error message
+ * @param responseHeaders a {@link java.util.Map} of HTTP response headers
+ * @param responseBody the response body
+ */
+ public ApiException(int code, String message, Map> responseHeaders, String responseBody) {
+ this(code, message);
+ this.responseHeaders = responseHeaders;
+ this.responseBody = responseBody;
+ }
+
+ /**
+ * Get the HTTP status code.
+ *
+ * @return HTTP status code
+ */
+ public int getCode() {
+ return code;
+ }
+
+ /**
+ * Get the HTTP response headers.
+ *
+ * @return A map of list of string
+ */
+ public Map> getResponseHeaders() {
+ return responseHeaders;
+ }
+
+ /**
+ * Get the HTTP response body.
+ *
+ * @return Response body in the form of string
+ */
+ public String getResponseBody() {
+ return responseBody;
+ }
+
+ /**
+ * Get the exception message including HTTP response data.
+ *
+ * @return The exception message
+ */
+ public String getMessage() {
+ return String.format(Locale.ROOT, "Message: %s%nHTTP response code: %s%nHTTP response body: %s%nHTTP response headers: %s",
+ super.getMessage(), this.getCode(), this.getResponseBody(), this.getResponseHeaders());
+ }
+}
diff --git a/services/crossconnectsv2/src/main/java/com/equinix/sdk/crossconnectsv2/ApiResponse.java b/services/crossconnectsv2/src/main/java/com/equinix/sdk/crossconnectsv2/ApiResponse.java
new file mode 100644
index 00000000..760dc1f5
--- /dev/null
+++ b/services/crossconnectsv2/src/main/java/com/equinix/sdk/crossconnectsv2/ApiResponse.java
@@ -0,0 +1,76 @@
+/*
+ * Cross Connect
+ * A Cross Connect is a physical cable connection that uses a coaxial, fiber or sometimes copper cable to connect customers equipment directly to other customers equipment inside Equinix data centers. Since cross connects transmit data point-to-point between computing systems inside our facility, they are not susceptible to the latency or congestion problems of the public Internet and can be relied upon to operate at consistently high speeds.
+ *
+ * The version of the OpenAPI document: 2.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package com.equinix.sdk.crossconnectsv2;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * API response returned by API call.
+ */
+public class ApiResponse {
+ final private int statusCode;
+ final private Map> headers;
+ final private 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/crossconnectsv2/src/main/java/com/equinix/sdk/crossconnectsv2/Configuration.java b/services/crossconnectsv2/src/main/java/com/equinix/sdk/crossconnectsv2/Configuration.java
new file mode 100644
index 00000000..ba11f3fe
--- /dev/null
+++ b/services/crossconnectsv2/src/main/java/com/equinix/sdk/crossconnectsv2/Configuration.java
@@ -0,0 +1,63 @@
+/*
+ * Cross Connect
+ * A Cross Connect is a physical cable connection that uses a coaxial, fiber or sometimes copper cable to connect customers equipment directly to other customers equipment inside Equinix data centers. Since cross connects transmit data point-to-point between computing systems inside our facility, they are not susceptible to the latency or congestion problems of the public Internet and can be relied upon to operate at consistently high speeds.
+ *
+ * The version of the OpenAPI document: 2.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package com.equinix.sdk.crossconnectsv2;
+
+import java.util.Objects;
+import java.util.concurrent.atomic.AtomicReference;
+import java.util.function.Supplier;
+
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.16.0")
+public class Configuration {
+ public static final String VERSION = "0.11.0";
+
+ private static final AtomicReference defaultApiClient = new AtomicReference<>();
+ private static volatile Supplier apiClientFactory = ApiClient::new;
+
+ /**
+ * Get the default API client, which would be used when creating API instances without providing an API client.
+ *
+ * @return Default API client
+ */
+ public static ApiClient getDefaultApiClient() {
+ ApiClient client = defaultApiClient.get();
+ if (client == null) {
+ client = defaultApiClient.updateAndGet(val -> {
+ if (val != null) { // changed by another thread
+ return val;
+ }
+ return apiClientFactory.get();
+ });
+ }
+ return client;
+ }
+
+ /**
+ * Set the default API client, which would be used when creating API instances without providing an API client.
+ *
+ * @param apiClient API client
+ */
+ public static void setDefaultApiClient(ApiClient apiClient) {
+ defaultApiClient.set(apiClient);
+ }
+
+ /**
+ * set the callback used to create new ApiClient objects
+ */
+ public static void setApiClientFactory(Supplier factory) {
+ apiClientFactory = Objects.requireNonNull(factory);
+ }
+
+ private Configuration() {
+ }
+}
\ No newline at end of file
diff --git a/services/crossconnectsv2/src/main/java/com/equinix/sdk/crossconnectsv2/GzipRequestInterceptor.java b/services/crossconnectsv2/src/main/java/com/equinix/sdk/crossconnectsv2/GzipRequestInterceptor.java
new file mode 100644
index 00000000..13a0db1e
--- /dev/null
+++ b/services/crossconnectsv2/src/main/java/com/equinix/sdk/crossconnectsv2/GzipRequestInterceptor.java
@@ -0,0 +1,85 @@
+/*
+ * Cross Connect
+ * A Cross Connect is a physical cable connection that uses a coaxial, fiber or sometimes copper cable to connect customers equipment directly to other customers equipment inside Equinix data centers. Since cross connects transmit data point-to-point between computing systems inside our facility, they are not susceptible to the latency or congestion problems of the public Internet and can be relied upon to operate at consistently high speeds.
+ *
+ * The version of the OpenAPI document: 2.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package com.equinix.sdk.crossconnectsv2;
+
+import okhttp3.*;
+import okio.Buffer;
+import okio.BufferedSink;
+import okio.GzipSink;
+import okio.Okio;
+
+import java.io.IOException;
+
+/**
+ * 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/crossconnectsv2/src/main/java/com/equinix/sdk/crossconnectsv2/JSON.java b/services/crossconnectsv2/src/main/java/com/equinix/sdk/crossconnectsv2/JSON.java
new file mode 100644
index 00000000..4e0638ca
--- /dev/null
+++ b/services/crossconnectsv2/src/main/java/com/equinix/sdk/crossconnectsv2/JSON.java
@@ -0,0 +1,448 @@
+/*
+ * Cross Connect
+ * A Cross Connect is a physical cable connection that uses a coaxial, fiber or sometimes copper cable to connect customers equipment directly to other customers equipment inside Equinix data centers. Since cross connects transmit data point-to-point between computing systems inside our facility, they are not susceptible to the latency or congestion problems of the public Internet and can be relied upon to operate at consistently high speeds.
+ *
+ * The version of the OpenAPI document: 2.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package com.equinix.sdk.crossconnectsv2;
+
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+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 com.google.gson.JsonElement;
+import io.gsonfire.GsonFireBuilder;
+import io.gsonfire.TypeSelector;
+
+import okio.ByteString;
+
+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.Locale;
+import java.util.Map;
+import java.util.HashMap;
+
+/*
+ * 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()
+ ;
+ 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 com.equinix.sdk.crossconnectsv2.model.ASide.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.equinix.sdk.crossconnectsv2.model.AttachmentRequest.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.equinix.sdk.crossconnectsv2.model.ContactRequestNonRegisteredUser.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.equinix.sdk.crossconnectsv2.model.ContactRequestRegisteredUser.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.equinix.sdk.crossconnectsv2.model.ContactRequestRegisteredUserUpdate.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.equinix.sdk.crossconnectsv2.model.ContactsRequestDetails.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.equinix.sdk.crossconnectsv2.model.DiverseConnections.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.equinix.sdk.crossconnectsv2.model.DiverseConnectionsASide.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.equinix.sdk.crossconnectsv2.model.DiverseConnectionsZSide.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.equinix.sdk.crossconnectsv2.model.ErrorDetails.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.equinix.sdk.crossconnectsv2.model.Layer1Create.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.equinix.sdk.crossconnectsv2.model.Layer1CreateContactsInner.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.equinix.sdk.crossconnectsv2.model.Layer1DeinstallDetails.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.equinix.sdk.crossconnectsv2.model.Layer1DeinstallDetailsPatchEquipment.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.equinix.sdk.crossconnectsv2.model.Layer1DeinstallRequest.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.equinix.sdk.crossconnectsv2.model.Layer1Details.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.equinix.sdk.crossconnectsv2.model.ModifyRequest.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.equinix.sdk.crossconnectsv2.model.PatchEquipment.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.equinix.sdk.crossconnectsv2.model.PatchPanel.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.equinix.sdk.crossconnectsv2.model.PurchaseOrder.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.equinix.sdk.crossconnectsv2.model.ZSide.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.equinix.sdk.crossconnectsv2.model.ZSideWithLOA.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.equinix.sdk.crossconnectsv2.model.ZSideWithPatchPanel.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/crossconnectsv2/src/main/java/com/equinix/sdk/crossconnectsv2/Pair.java b/services/crossconnectsv2/src/main/java/com/equinix/sdk/crossconnectsv2/Pair.java
new file mode 100644
index 00000000..c2709d16
--- /dev/null
+++ b/services/crossconnectsv2/src/main/java/com/equinix/sdk/crossconnectsv2/Pair.java
@@ -0,0 +1,37 @@
+/*
+ * Cross Connect
+ * A Cross Connect is a physical cable connection that uses a coaxial, fiber or sometimes copper cable to connect customers equipment directly to other customers equipment inside Equinix data centers. Since cross connects transmit data point-to-point between computing systems inside our facility, they are not susceptible to the latency or congestion problems of the public Internet and can be relied upon to operate at consistently high speeds.
+ *
+ * The version of the OpenAPI document: 2.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package com.equinix.sdk.crossconnectsv2;
+
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.16.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/crossconnectsv2/src/main/java/com/equinix/sdk/crossconnectsv2/ProgressRequestBody.java b/services/crossconnectsv2/src/main/java/com/equinix/sdk/crossconnectsv2/ProgressRequestBody.java
new file mode 100644
index 00000000..922a7bea
--- /dev/null
+++ b/services/crossconnectsv2/src/main/java/com/equinix/sdk/crossconnectsv2/ProgressRequestBody.java
@@ -0,0 +1,73 @@
+/*
+ * Cross Connect
+ * A Cross Connect is a physical cable connection that uses a coaxial, fiber or sometimes copper cable to connect customers equipment directly to other customers equipment inside Equinix data centers. Since cross connects transmit data point-to-point between computing systems inside our facility, they are not susceptible to the latency or congestion problems of the public Internet and can be relied upon to operate at consistently high speeds.
+ *
+ * The version of the OpenAPI document: 2.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package com.equinix.sdk.crossconnectsv2;
+
+import okhttp3.MediaType;
+import okhttp3.RequestBody;
+
+import java.io.IOException;
+
+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/crossconnectsv2/src/main/java/com/equinix/sdk/crossconnectsv2/ProgressResponseBody.java b/services/crossconnectsv2/src/main/java/com/equinix/sdk/crossconnectsv2/ProgressResponseBody.java
new file mode 100644
index 00000000..cdcf6382
--- /dev/null
+++ b/services/crossconnectsv2/src/main/java/com/equinix/sdk/crossconnectsv2/ProgressResponseBody.java
@@ -0,0 +1,70 @@
+/*
+ * Cross Connect
+ * A Cross Connect is a physical cable connection that uses a coaxial, fiber or sometimes copper cable to connect customers equipment directly to other customers equipment inside Equinix data centers. Since cross connects transmit data point-to-point between computing systems inside our facility, they are not susceptible to the latency or congestion problems of the public Internet and can be relied upon to operate at consistently high speeds.
+ *
+ * The version of the OpenAPI document: 2.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package com.equinix.sdk.crossconnectsv2;
+
+import okhttp3.MediaType;
+import okhttp3.ResponseBody;
+
+import java.io.IOException;
+
+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/crossconnectsv2/src/main/java/com/equinix/sdk/crossconnectsv2/ServerConfiguration.java b/services/crossconnectsv2/src/main/java/com/equinix/sdk/crossconnectsv2/ServerConfiguration.java
new file mode 100644
index 00000000..02f86ded
--- /dev/null
+++ b/services/crossconnectsv2/src/main/java/com/equinix/sdk/crossconnectsv2/ServerConfiguration.java
@@ -0,0 +1,72 @@
+/*
+ * Cross Connect
+ * A Cross Connect is a physical cable connection that uses a coaxial, fiber or sometimes copper cable to connect customers equipment directly to other customers equipment inside Equinix data centers. Since cross connects transmit data point-to-point between computing systems inside our facility, they are not susceptible to the latency or congestion problems of the public Internet and can be relied upon to operate at consistently high speeds.
+ *
+ * The version of the OpenAPI document: 2.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package com.equinix.sdk.crossconnectsv2;
+
+import java.util.Map;
+
+/**
+ * Representing a Server configuration.
+ */
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.16.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/crossconnectsv2/src/main/java/com/equinix/sdk/crossconnectsv2/ServerVariable.java b/services/crossconnectsv2/src/main/java/com/equinix/sdk/crossconnectsv2/ServerVariable.java
new file mode 100644
index 00000000..f65fa130
--- /dev/null
+++ b/services/crossconnectsv2/src/main/java/com/equinix/sdk/crossconnectsv2/ServerVariable.java
@@ -0,0 +1,37 @@
+/*
+ * Cross Connect
+ * A Cross Connect is a physical cable connection that uses a coaxial, fiber or sometimes copper cable to connect customers equipment directly to other customers equipment inside Equinix data centers. Since cross connects transmit data point-to-point between computing systems inside our facility, they are not susceptible to the latency or congestion problems of the public Internet and can be relied upon to operate at consistently high speeds.
+ *
+ * The version of the OpenAPI document: 2.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package com.equinix.sdk.crossconnectsv2;
+
+import java.util.HashSet;
+
+/**
+ * Representing a Server Variable for server URL template substitution.
+ */
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.16.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/crossconnectsv2/src/main/java/com/equinix/sdk/crossconnectsv2/StringUtil.java b/services/crossconnectsv2/src/main/java/com/equinix/sdk/crossconnectsv2/StringUtil.java
new file mode 100644
index 00000000..30eadd8f
--- /dev/null
+++ b/services/crossconnectsv2/src/main/java/com/equinix/sdk/crossconnectsv2/StringUtil.java
@@ -0,0 +1,83 @@
+/*
+ * Cross Connect
+ * A Cross Connect is a physical cable connection that uses a coaxial, fiber or sometimes copper cable to connect customers equipment directly to other customers equipment inside Equinix data centers. Since cross connects transmit data point-to-point between computing systems inside our facility, they are not susceptible to the latency or congestion problems of the public Internet and can be relied upon to operate at consistently high speeds.
+ *
+ * The version of the OpenAPI document: 2.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package com.equinix.sdk.crossconnectsv2;
+
+import java.util.Collection;
+import java.util.Iterator;
+
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.16.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/crossconnectsv2/src/main/java/com/equinix/sdk/crossconnectsv2/api/CrossConnectsApi.java b/services/crossconnectsv2/src/main/java/com/equinix/sdk/crossconnectsv2/api/CrossConnectsApi.java
new file mode 100644
index 00000000..1938aa5c
--- /dev/null
+++ b/services/crossconnectsv2/src/main/java/com/equinix/sdk/crossconnectsv2/api/CrossConnectsApi.java
@@ -0,0 +1,487 @@
+/*
+ * Cross Connect
+ * A Cross Connect is a physical cable connection that uses a coaxial, fiber or sometimes copper cable to connect customers equipment directly to other customers equipment inside Equinix data centers. Since cross connects transmit data point-to-point between computing systems inside our facility, they are not susceptible to the latency or congestion problems of the public Internet and can be relied upon to operate at consistently high speeds.
+ *
+ * The version of the OpenAPI document: 2.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package com.equinix.sdk.crossconnectsv2.api;
+
+import com.equinix.sdk.crossconnectsv2.ApiCallback;
+import com.equinix.sdk.crossconnectsv2.ApiClient;
+import com.equinix.sdk.crossconnectsv2.ApiException;
+import com.equinix.sdk.crossconnectsv2.ApiResponse;
+import com.equinix.sdk.crossconnectsv2.Configuration;
+import com.equinix.sdk.crossconnectsv2.Pair;
+import com.equinix.sdk.crossconnectsv2.ProgressRequestBody;
+import com.equinix.sdk.crossconnectsv2.ProgressResponseBody;
+
+import com.google.gson.reflect.TypeToken;
+
+import java.io.IOException;
+
+
+import com.equinix.sdk.crossconnectsv2.model.ErrorDetails;
+import com.equinix.sdk.crossconnectsv2.model.Layer1Create;
+import com.equinix.sdk.crossconnectsv2.model.Layer1DeinstallRequest;
+import com.equinix.sdk.crossconnectsv2.model.ModifyRequest;
+
+import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class CrossConnectsApi {
+ private ApiClient localVarApiClient;
+ private int localHostIndex;
+ private String localCustomBaseUrl;
+
+ public CrossConnectsApi() {
+ this(Configuration.getDefaultApiClient());
+ }
+
+ public CrossConnectsApi(ApiClient apiClient) {
+ this.localVarApiClient = apiClient;
+ }
+
+ 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 orderCrossConnects
+ * @param layer1Create (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
+
201
Layer 1 Created
* Location - Location on newly created deinstall request
+
400
Bad Request
-
+
403
Forbidden
-
+
500
Internal Server Error
-
+
+ */
+ public okhttp3.Call orderCrossConnectsCall(@javax.annotation.Nullable Layer1Create layer1Create, 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 = layer1Create;
+
+ // create path and map variables
+ String localVarPath = "/colocations/v2/orders/crossConnects";
+
+ 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[] { "BearerAuth" };
+ return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private okhttp3.Call orderCrossConnectsValidateBeforeCall(@javax.annotation.Nullable Layer1Create layer1Create, final ApiCallback _callback) throws ApiException {
+ return orderCrossConnectsCall(layer1Create, _callback);
+
+ }
+
+ /**
+ * Order cross connects
+ * This method creates an order for single or multiple standard cross connects at locations where a user has cross connects ordering permission.
+ * @param layer1Create (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
+
201
Layer 1 Created
* Location - Location on newly created deinstall request
+
400
Bad Request
-
+
403
Forbidden
-
+
500
Internal Server Error
-
+
+ */
+ public void orderCrossConnects(@javax.annotation.Nullable Layer1Create layer1Create) throws ApiException {
+ orderCrossConnectsWithHttpInfo(layer1Create);
+ }
+
+ /**
+ * Order cross connects
+ * This method creates an order for single or multiple standard cross connects at locations where a user has cross connects ordering permission.
+ * @param layer1Create (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
+
201
Layer 1 Created
* Location - Location on newly created deinstall request
+
400
Bad Request
-
+
403
Forbidden
-
+
500
Internal Server Error
-
+
+ */
+ public ApiResponse orderCrossConnectsWithHttpInfo(@javax.annotation.Nullable Layer1Create layer1Create) throws ApiException {
+ okhttp3.Call localVarCall = orderCrossConnectsValidateBeforeCall(layer1Create, null);
+ return localVarApiClient.execute(localVarCall);
+ }
+
+ /**
+ * Order cross connects (asynchronously)
+ * This method creates an order for single or multiple standard cross connects at locations where a user has cross connects ordering permission.
+ * @param layer1Create (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
+
201
Layer 1 Created
* Location - Location on newly created deinstall request
+
400
Bad Request
-
+
403
Forbidden
-
+
500
Internal Server Error
-
+
+ */
+ public okhttp3.Call orderCrossConnectsAsync(@javax.annotation.Nullable Layer1Create layer1Create, final ApiCallback _callback) throws ApiException {
+
+ okhttp3.Call localVarCall = orderCrossConnectsValidateBeforeCall(layer1Create, _callback);
+ localVarApiClient.executeAsync(localVarCall, _callback);
+ return localVarCall;
+ }
+ /**
+ * Build call for placeCrossConnectDeinstallationOrder
+ * @param layer1DeinstallRequest (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
+
201
Layer 1 deinstall requested
* Location - Location on newly created deinstall request
+
400
Bad Request
-
+
403
Forbidden
-
+
500
Internal Server Error
-
+
+ */
+ public okhttp3.Call placeCrossConnectDeinstallationOrderCall(@javax.annotation.Nullable Layer1DeinstallRequest layer1DeinstallRequest, 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 = layer1DeinstallRequest;
+
+ // create path and map variables
+ String localVarPath = "/colocations/v2/orders/crossConnects/deinstall";
+
+ 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[] { "BearerAuth" };
+ return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private okhttp3.Call placeCrossConnectDeinstallationOrderValidateBeforeCall(@javax.annotation.Nullable Layer1DeinstallRequest layer1DeinstallRequest, final ApiCallback _callback) throws ApiException {
+ return placeCrossConnectDeinstallationOrderCall(layer1DeinstallRequest, _callback);
+
+ }
+
+ /**
+ * Place cross connect deinstallation order
+ * This API allows user to initiate a cross connect deinstallation request. Cross connect asset will be removed according to order placed.
+ * @param layer1DeinstallRequest (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
+
201
Layer 1 deinstall requested
* Location - Location on newly created deinstall request
+
400
Bad Request
-
+
403
Forbidden
-
+
500
Internal Server Error
-
+
+ */
+ public void placeCrossConnectDeinstallationOrder(@javax.annotation.Nullable Layer1DeinstallRequest layer1DeinstallRequest) throws ApiException {
+ placeCrossConnectDeinstallationOrderWithHttpInfo(layer1DeinstallRequest);
+ }
+
+ /**
+ * Place cross connect deinstallation order
+ * This API allows user to initiate a cross connect deinstallation request. Cross connect asset will be removed according to order placed.
+ * @param layer1DeinstallRequest (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
+
201
Layer 1 deinstall requested
* Location - Location on newly created deinstall request
+
400
Bad Request
-
+
403
Forbidden
-
+
500
Internal Server Error
-
+
+ */
+ public ApiResponse placeCrossConnectDeinstallationOrderWithHttpInfo(@javax.annotation.Nullable Layer1DeinstallRequest layer1DeinstallRequest) throws ApiException {
+ okhttp3.Call localVarCall = placeCrossConnectDeinstallationOrderValidateBeforeCall(layer1DeinstallRequest, null);
+ return localVarApiClient.execute(localVarCall);
+ }
+
+ /**
+ * Place cross connect deinstallation order (asynchronously)
+ * This API allows user to initiate a cross connect deinstallation request. Cross connect asset will be removed according to order placed.
+ * @param layer1DeinstallRequest (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
+
201
Layer 1 deinstall requested
* Location - Location on newly created deinstall request
+
400
Bad Request
-
+
403
Forbidden
-
+
500
Internal Server Error
-
+
+ */
+ public okhttp3.Call placeCrossConnectDeinstallationOrderAsync(@javax.annotation.Nullable Layer1DeinstallRequest layer1DeinstallRequest, final ApiCallback _callback) throws ApiException {
+
+ okhttp3.Call localVarCall = placeCrossConnectDeinstallationOrderValidateBeforeCall(layer1DeinstallRequest, _callback);
+ localVarApiClient.executeAsync(localVarCall, _callback);
+ return localVarCall;
+ }
+ /**
+ * Build call for updateACrossConnectOrder
+ * @param orderId Identifier of the cross connect order (required)
+ * @param modifyRequest The cross connect to be updated (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
Accepted
* Location - Location on newly created deinstall request
+
204
No content
* Location - Location on newly created deinstall request
+
400
Bad Request
-
+
403
Forbidden
-
+
500
Internal Server Error
-
+
+ */
+ public okhttp3.Call updateACrossConnectOrderCall(@javax.annotation.Nonnull String orderId, @javax.annotation.Nonnull ModifyRequest modifyRequest, 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 = modifyRequest;
+
+ // create path and map variables
+ String localVarPath = "/colocations/v2/orders/crossConnects/{orderId}"
+ .replace("{" + "orderId" + "}", localVarApiClient.escapeString(orderId.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[] { "BearerAuth" };
+ return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private okhttp3.Call updateACrossConnectOrderValidateBeforeCall(@javax.annotation.Nonnull String orderId, @javax.annotation.Nonnull ModifyRequest modifyRequest, final ApiCallback _callback) throws ApiException {
+ // verify the required parameter 'orderId' is set
+ if (orderId == null) {
+ throw new ApiException("Missing the required parameter 'orderId' when calling updateACrossConnectOrder(Async)");
+ }
+
+ // verify the required parameter 'modifyRequest' is set
+ if (modifyRequest == null) {
+ throw new ApiException("Missing the required parameter 'modifyRequest' when calling updateACrossConnectOrder(Async)");
+ }
+
+ return updateACrossConnectOrderCall(orderId, modifyRequest, _callback);
+
+ }
+
+ /**
+ * Update a cross connects order
+ * This method updates a cross connects order by its ID for a user with permission to view this request.
+ * @param orderId Identifier of the cross connect order (required)
+ * @param modifyRequest The cross connect to be updated (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
Accepted
* Location - Location on newly created deinstall request
+
204
No content
* Location - Location on newly created deinstall request
+
400
Bad Request
-
+
403
Forbidden
-
+
500
Internal Server Error
-
+
+ */
+ public void updateACrossConnectOrder(@javax.annotation.Nonnull String orderId, @javax.annotation.Nonnull ModifyRequest modifyRequest) throws ApiException {
+ updateACrossConnectOrderWithHttpInfo(orderId, modifyRequest);
+ }
+
+ /**
+ * Update a cross connects order
+ * This method updates a cross connects order by its ID for a user with permission to view this request.
+ * @param orderId Identifier of the cross connect order (required)
+ * @param modifyRequest The cross connect to be updated (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
Accepted
* Location - Location on newly created deinstall request
+
204
No content
* Location - Location on newly created deinstall request
+
400
Bad Request
-
+
403
Forbidden
-
+
500
Internal Server Error
-
+
+ */
+ public ApiResponse updateACrossConnectOrderWithHttpInfo(@javax.annotation.Nonnull String orderId, @javax.annotation.Nonnull ModifyRequest modifyRequest) throws ApiException {
+ okhttp3.Call localVarCall = updateACrossConnectOrderValidateBeforeCall(orderId, modifyRequest, null);
+ return localVarApiClient.execute(localVarCall);
+ }
+
+ /**
+ * Update a cross connects order (asynchronously)
+ * This method updates a cross connects order by its ID for a user with permission to view this request.
+ * @param orderId Identifier of the cross connect order (required)
+ * @param modifyRequest The cross connect to be updated (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
Accepted
* Location - Location on newly created deinstall request
+
204
No content
* Location - Location on newly created deinstall request
+
400
Bad Request
-
+
403
Forbidden
-
+
500
Internal Server Error
-
+
+ */
+ public okhttp3.Call updateACrossConnectOrderAsync(@javax.annotation.Nonnull String orderId, @javax.annotation.Nonnull ModifyRequest modifyRequest, final ApiCallback _callback) throws ApiException {
+
+ okhttp3.Call localVarCall = updateACrossConnectOrderValidateBeforeCall(orderId, modifyRequest, _callback);
+ localVarApiClient.executeAsync(localVarCall, _callback);
+ return localVarCall;
+ }
+}
diff --git a/services/crossconnectsv2/src/main/java/com/equinix/sdk/crossconnectsv2/auth/ApiKeyAuth.java b/services/crossconnectsv2/src/main/java/com/equinix/sdk/crossconnectsv2/auth/ApiKeyAuth.java
new file mode 100644
index 00000000..f292f4d1
--- /dev/null
+++ b/services/crossconnectsv2/src/main/java/com/equinix/sdk/crossconnectsv2/auth/ApiKeyAuth.java
@@ -0,0 +1,80 @@
+/*
+ * Cross Connect
+ * A Cross Connect is a physical cable connection that uses a coaxial, fiber or sometimes copper cable to connect customers equipment directly to other customers equipment inside Equinix data centers. Since cross connects transmit data point-to-point between computing systems inside our facility, they are not susceptible to the latency or congestion problems of the public Internet and can be relied upon to operate at consistently high speeds.
+ *
+ * The version of the OpenAPI document: 2.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package com.equinix.sdk.crossconnectsv2.auth;
+
+import com.equinix.sdk.crossconnectsv2.ApiException;
+import com.equinix.sdk.crossconnectsv2.Pair;
+
+import java.net.URI;
+import java.util.Map;
+import java.util.List;
+
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.16.0")
+public class ApiKeyAuth implements Authentication {
+ private final String location;
+ private final String paramName;
+
+ private String apiKey;
+ private String apiKeyPrefix;
+
+ public ApiKeyAuth(String location, String paramName) {
+ this.location = location;
+ this.paramName = paramName;
+ }
+
+ public String getLocation() {
+ return location;
+ }
+
+ public String getParamName() {
+ return paramName;
+ }
+
+ public String getApiKey() {
+ return apiKey;
+ }
+
+ public void setApiKey(String apiKey) {
+ this.apiKey = apiKey;
+ }
+
+ public String getApiKeyPrefix() {
+ return apiKeyPrefix;
+ }
+
+ public void setApiKeyPrefix(String apiKeyPrefix) {
+ this.apiKeyPrefix = apiKeyPrefix;
+ }
+
+ @Override
+ public void applyToParams(List queryParams, Map headerParams, Map cookieParams,
+ String payload, String method, URI uri) throws ApiException {
+ if (apiKey == null) {
+ return;
+ }
+ String value;
+ if (apiKeyPrefix != null) {
+ value = apiKeyPrefix + " " + apiKey;
+ } else {
+ value = apiKey;
+ }
+ if ("query".equals(location)) {
+ queryParams.add(new Pair(paramName, value));
+ } else if ("header".equals(location)) {
+ headerParams.put(paramName, value);
+ } else if ("cookie".equals(location)) {
+ cookieParams.put(paramName, value);
+ }
+ }
+}
diff --git a/services/crossconnectsv2/src/main/java/com/equinix/sdk/crossconnectsv2/auth/Authentication.java b/services/crossconnectsv2/src/main/java/com/equinix/sdk/crossconnectsv2/auth/Authentication.java
new file mode 100644
index 00000000..e809464a
--- /dev/null
+++ b/services/crossconnectsv2/src/main/java/com/equinix/sdk/crossconnectsv2/auth/Authentication.java
@@ -0,0 +1,37 @@
+/*
+ * Cross Connect
+ * A Cross Connect is a physical cable connection that uses a coaxial, fiber or sometimes copper cable to connect customers equipment directly to other customers equipment inside Equinix data centers. Since cross connects transmit data point-to-point between computing systems inside our facility, they are not susceptible to the latency or congestion problems of the public Internet and can be relied upon to operate at consistently high speeds.
+ *
+ * The version of the OpenAPI document: 2.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package com.equinix.sdk.crossconnectsv2.auth;
+
+import com.equinix.sdk.crossconnectsv2.Pair;
+import com.equinix.sdk.crossconnectsv2.ApiException;
+
+import java.net.URI;
+import java.util.Map;
+import java.util.List;
+
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.16.0")
+public interface Authentication {
+ /**
+ * Apply authentication settings to header and query params.
+ *
+ * @param queryParams List of query parameters
+ * @param headerParams Map of header parameters
+ * @param cookieParams Map of cookie parameters
+ * @param payload HTTP request body
+ * @param method HTTP method
+ * @param uri URI
+ * @throws ApiException if failed to update the parameters
+ */
+ void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException;
+}
diff --git a/services/crossconnectsv2/src/main/java/com/equinix/sdk/crossconnectsv2/auth/HttpBasicAuth.java b/services/crossconnectsv2/src/main/java/com/equinix/sdk/crossconnectsv2/auth/HttpBasicAuth.java
new file mode 100644
index 00000000..2957a2c2
--- /dev/null
+++ b/services/crossconnectsv2/src/main/java/com/equinix/sdk/crossconnectsv2/auth/HttpBasicAuth.java
@@ -0,0 +1,55 @@
+/*
+ * Cross Connect
+ * A Cross Connect is a physical cable connection that uses a coaxial, fiber or sometimes copper cable to connect customers equipment directly to other customers equipment inside Equinix data centers. Since cross connects transmit data point-to-point between computing systems inside our facility, they are not susceptible to the latency or congestion problems of the public Internet and can be relied upon to operate at consistently high speeds.
+ *
+ * The version of the OpenAPI document: 2.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package com.equinix.sdk.crossconnectsv2.auth;
+
+import com.equinix.sdk.crossconnectsv2.Pair;
+import com.equinix.sdk.crossconnectsv2.ApiException;
+
+import okhttp3.Credentials;
+
+import java.net.URI;
+import java.util.Map;
+import java.util.List;
+
+public class HttpBasicAuth implements Authentication {
+ private String username;
+ private String password;
+
+ public String getUsername() {
+ return username;
+ }
+
+ public void setUsername(String username) {
+ this.username = username;
+ }
+
+ public String getPassword() {
+ return password;
+ }
+
+ public void setPassword(String password) {
+ this.password = password;
+ }
+
+ @Override
+ public void applyToParams(List queryParams, Map headerParams, Map cookieParams,
+ String payload, String method, URI uri) throws ApiException {
+ if (username == null && password == null) {
+ return;
+ }
+ headerParams.put("Authorization", Credentials.basic(
+ username == null ? "" : username,
+ password == null ? "" : password));
+ }
+}
diff --git a/services/crossconnectsv2/src/main/java/com/equinix/sdk/crossconnectsv2/auth/HttpBearerAuth.java b/services/crossconnectsv2/src/main/java/com/equinix/sdk/crossconnectsv2/auth/HttpBearerAuth.java
new file mode 100644
index 00000000..0913a3a9
--- /dev/null
+++ b/services/crossconnectsv2/src/main/java/com/equinix/sdk/crossconnectsv2/auth/HttpBearerAuth.java
@@ -0,0 +1,75 @@
+/*
+ * Cross Connect
+ * A Cross Connect is a physical cable connection that uses a coaxial, fiber or sometimes copper cable to connect customers equipment directly to other customers equipment inside Equinix data centers. Since cross connects transmit data point-to-point between computing systems inside our facility, they are not susceptible to the latency or congestion problems of the public Internet and can be relied upon to operate at consistently high speeds.
+ *
+ * The version of the OpenAPI document: 2.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package com.equinix.sdk.crossconnectsv2.auth;
+
+import com.equinix.sdk.crossconnectsv2.ApiException;
+import com.equinix.sdk.crossconnectsv2.Pair;
+
+import java.net.URI;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.function.Supplier;
+
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.16.0")
+public class HttpBearerAuth implements Authentication {
+ private final String scheme;
+ private Supplier tokenSupplier;
+
+ public HttpBearerAuth(String scheme) {
+ this.scheme = scheme;
+ }
+
+ /**
+ * Gets the token, which together with the scheme, will be sent as the value of the Authorization header.
+ *
+ * @return The bearer token
+ */
+ public String getBearerToken() {
+ return tokenSupplier.get();
+ }
+
+ /**
+ * Sets the token, which together with the scheme, will be sent as the value of the Authorization header.
+ *
+ * @param bearerToken The bearer token to send in the Authorization header
+ */
+ public void setBearerToken(String bearerToken) {
+ this.tokenSupplier = () -> bearerToken;
+ }
+
+ /**
+ * Sets the supplier of tokens, which together with the scheme, will be sent as the value of the Authorization header.
+ *
+ * @param tokenSupplier The supplier of bearer tokens to send in the Authorization header
+ */
+ public void setBearerToken(Supplier tokenSupplier) {
+ this.tokenSupplier = tokenSupplier;
+ }
+
+ @Override
+ public void applyToParams(List queryParams, Map headerParams, Map cookieParams,
+ String payload, String method, URI uri) throws ApiException {
+ String bearerToken = Optional.ofNullable(tokenSupplier).map(Supplier::get).orElse(null);
+ if (bearerToken == null) {
+ return;
+ }
+
+ headerParams.put("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken);
+ }
+
+ private static String upperCaseBearer(String scheme) {
+ return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme;
+ }
+}
diff --git a/services/crossconnectsv2/src/main/java/com/equinix/sdk/crossconnectsv2/model/ASide.java b/services/crossconnectsv2/src/main/java/com/equinix/sdk/crossconnectsv2/model/ASide.java
new file mode 100644
index 00000000..19aabf94
--- /dev/null
+++ b/services/crossconnectsv2/src/main/java/com/equinix/sdk/crossconnectsv2/model/ASide.java
@@ -0,0 +1,496 @@
+/*
+ * Cross Connect
+ * A Cross Connect is a physical cable connection that uses a coaxial, fiber or sometimes copper cable to connect customers equipment directly to other customers equipment inside Equinix data centers. Since cross connects transmit data point-to-point between computing systems inside our facility, they are not susceptible to the latency or congestion problems of the public Internet and can be relied upon to operate at consistently high speeds.
+ *
+ * The version of the OpenAPI document: 2.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package com.equinix.sdk.crossconnectsv2.model;
+
+import java.util.Objects;
+import java.util.Locale;
+import com.equinix.sdk.crossconnectsv2.model.ConnectionServices;
+import com.equinix.sdk.crossconnectsv2.model.ConnectorTypes;
+import com.equinix.sdk.crossconnectsv2.model.MediaTypes;
+import com.equinix.sdk.crossconnectsv2.model.PatchEquipment;
+import com.equinix.sdk.crossconnectsv2.model.PatchPanel;
+import com.equinix.sdk.crossconnectsv2.model.ProtocolTypes;
+import com.google.gson.TypeAdapter;
+import com.google.gson.annotations.JsonAdapter;
+import com.google.gson.annotations.SerializedName;
+import com.google.gson.stream.JsonReader;
+import com.google.gson.stream.JsonWriter;
+import java.io.IOException;
+import java.util.Arrays;
+
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+import com.google.gson.JsonArray;
+import com.google.gson.JsonDeserializationContext;
+import com.google.gson.JsonDeserializer;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonObject;
+import com.google.gson.JsonParseException;
+import com.google.gson.TypeAdapterFactory;
+import com.google.gson.reflect.TypeToken;
+import com.google.gson.TypeAdapter;
+import com.google.gson.stream.JsonReader;
+import com.google.gson.stream.JsonWriter;
+import java.io.IOException;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.Locale;
+
+import com.equinix.sdk.crossconnectsv2.JSON;
+
+/**
+ * A-Side source patch panel to establish connection to another customer. Connections Service , Media Type and Protocol Type is mandatory to establish new connection.
+ */
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.16.0")
+public class ASide {
+ public static final String SERIALIZED_NAME_PATCH_PANEL = "patchPanel";
+ @SerializedName(SERIALIZED_NAME_PATCH_PANEL)
+ @javax.annotation.Nonnull
+ private PatchPanel patchPanel;
+
+ public static final String SERIALIZED_NAME_CONNECTION_SERVICE = "connectionService";
+ @SerializedName(SERIALIZED_NAME_CONNECTION_SERVICE)
+ @javax.annotation.Nonnull
+ private ConnectionServices connectionService;
+
+ public static final String SERIALIZED_NAME_MEDIA_TYPE = "mediaType";
+ @SerializedName(SERIALIZED_NAME_MEDIA_TYPE)
+ @javax.annotation.Nonnull
+ private MediaTypes mediaType;
+
+ public static final String SERIALIZED_NAME_PROTOCOL_TYPE = "protocolType";
+ @SerializedName(SERIALIZED_NAME_PROTOCOL_TYPE)
+ @javax.annotation.Nonnull
+ private ProtocolTypes protocolType;
+
+ public static final String SERIALIZED_NAME_CONNECTOR_TYPE = "connectorType";
+ @SerializedName(SERIALIZED_NAME_CONNECTOR_TYPE)
+ @javax.annotation.Nonnull
+ private ConnectorTypes connectorType;
+
+ public static final String SERIALIZED_NAME_MEDIA_CONVERTER_REQUIRED = "mediaConverterRequired";
+ @SerializedName(SERIALIZED_NAME_MEDIA_CONVERTER_REQUIRED)
+ @javax.annotation.Nullable
+ private Boolean mediaConverterRequired;
+
+ public static final String SERIALIZED_NAME_IFC_CIRCUIT_COUNT = "ifcCircuitCount";
+ @SerializedName(SERIALIZED_NAME_IFC_CIRCUIT_COUNT)
+ @javax.annotation.Nullable
+ private Integer ifcCircuitCount;
+
+ public static final String SERIALIZED_NAME_PATCH_EQUIPMENT = "patchEquipment";
+ @SerializedName(SERIALIZED_NAME_PATCH_EQUIPMENT)
+ @javax.annotation.Nullable
+ private PatchEquipment patchEquipment;
+
+ public ASide() {
+ }
+
+ public ASide patchPanel(@javax.annotation.Nonnull PatchPanel patchPanel) {
+ this.patchPanel = patchPanel;
+ return this;
+ }
+
+ /**
+ * Get patchPanel
+ * @return patchPanel
+ */
+ @javax.annotation.Nonnull
+ public PatchPanel getPatchPanel() {
+ return patchPanel;
+ }
+
+ public void setPatchPanel(@javax.annotation.Nonnull PatchPanel patchPanel) {
+ this.patchPanel = patchPanel;
+ }
+
+
+ public ASide connectionService(@javax.annotation.Nonnull ConnectionServices connectionService) {
+ this.connectionService = connectionService;
+ return this;
+ }
+
+ /**
+ * Get connectionService
+ * @return connectionService
+ */
+ @javax.annotation.Nonnull
+ public ConnectionServices getConnectionService() {
+ return connectionService;
+ }
+
+ public void setConnectionService(@javax.annotation.Nonnull ConnectionServices connectionService) {
+ this.connectionService = connectionService;
+ }
+
+
+ public ASide mediaType(@javax.annotation.Nonnull MediaTypes mediaType) {
+ this.mediaType = mediaType;
+ return this;
+ }
+
+ /**
+ * Get mediaType
+ * @return mediaType
+ */
+ @javax.annotation.Nonnull
+ public MediaTypes getMediaType() {
+ return mediaType;
+ }
+
+ public void setMediaType(@javax.annotation.Nonnull MediaTypes mediaType) {
+ this.mediaType = mediaType;
+ }
+
+
+ public ASide protocolType(@javax.annotation.Nonnull ProtocolTypes protocolType) {
+ this.protocolType = protocolType;
+ return this;
+ }
+
+ /**
+ * Get protocolType
+ * @return protocolType
+ */
+ @javax.annotation.Nonnull
+ public ProtocolTypes getProtocolType() {
+ return protocolType;
+ }
+
+ public void setProtocolType(@javax.annotation.Nonnull ProtocolTypes protocolType) {
+ this.protocolType = protocolType;
+ }
+
+
+ public ASide connectorType(@javax.annotation.Nonnull ConnectorTypes connectorType) {
+ this.connectorType = connectorType;
+ return this;
+ }
+
+ /**
+ * Get connectorType
+ * @return connectorType
+ */
+ @javax.annotation.Nonnull
+ public ConnectorTypes getConnectorType() {
+ return connectorType;
+ }
+
+ public void setConnectorType(@javax.annotation.Nonnull ConnectorTypes connectorType) {
+ this.connectorType = connectorType;
+ }
+
+
+ public ASide mediaConverterRequired(@javax.annotation.Nullable Boolean mediaConverterRequired) {
+ this.mediaConverterRequired = mediaConverterRequired;
+ return this;
+ }
+
+ /**
+ * When `false`, Equinix will not proceed with cross connect installation that requires media conversion
+ * @return mediaConverterRequired
+ */
+ @javax.annotation.Nullable
+ public Boolean getMediaConverterRequired() {
+ return mediaConverterRequired;
+ }
+
+ public void setMediaConverterRequired(@javax.annotation.Nullable Boolean mediaConverterRequired) {
+ this.mediaConverterRequired = mediaConverterRequired;
+ }
+
+
+ public ASide ifcCircuitCount(@javax.annotation.Nullable Integer ifcCircuitCount) {
+ this.ifcCircuitCount = ifcCircuitCount;
+ return this;
+ }
+
+ /**
+ * Use this field to request an intra-facility cable IFC with this order. Note that there might be a delay in fulfilment of Cross Connect as it is pending intra facility cabling
+ * minimum: 1
+ * maximum: 48
+ * @return ifcCircuitCount
+ */
+ @javax.annotation.Nullable
+ public Integer getIfcCircuitCount() {
+ return ifcCircuitCount;
+ }
+
+ public void setIfcCircuitCount(@javax.annotation.Nullable Integer ifcCircuitCount) {
+ this.ifcCircuitCount = ifcCircuitCount;
+ }
+
+
+ public ASide patchEquipment(@javax.annotation.Nullable PatchEquipment patchEquipment) {
+ this.patchEquipment = patchEquipment;
+ return this;
+ }
+
+ /**
+ * Get patchEquipment
+ * @return patchEquipment
+ */
+ @javax.annotation.Nullable
+ public PatchEquipment getPatchEquipment() {
+ return patchEquipment;
+ }
+
+ public void setPatchEquipment(@javax.annotation.Nullable PatchEquipment patchEquipment) {
+ this.patchEquipment = patchEquipment;
+ }
+
+ /**
+ * 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 ASide instance itself
+ */
+ public ASide 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;
+ }
+ ASide aSide = (ASide) o;
+ return Objects.equals(this.patchPanel, aSide.patchPanel) &&
+ Objects.equals(this.connectionService, aSide.connectionService) &&
+ Objects.equals(this.mediaType, aSide.mediaType) &&
+ Objects.equals(this.protocolType, aSide.protocolType) &&
+ Objects.equals(this.connectorType, aSide.connectorType) &&
+ Objects.equals(this.mediaConverterRequired, aSide.mediaConverterRequired) &&
+ Objects.equals(this.ifcCircuitCount, aSide.ifcCircuitCount) &&
+ Objects.equals(this.patchEquipment, aSide.patchEquipment)&&
+ Objects.equals(this.additionalProperties, aSide.additionalProperties);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(patchPanel, connectionService, mediaType, protocolType, connectorType, mediaConverterRequired, ifcCircuitCount, patchEquipment, additionalProperties);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class ASide {\n");
+ sb.append(" patchPanel: ").append(toIndentedString(patchPanel)).append("\n");
+ sb.append(" connectionService: ").append(toIndentedString(connectionService)).append("\n");
+ sb.append(" mediaType: ").append(toIndentedString(mediaType)).append("\n");
+ sb.append(" protocolType: ").append(toIndentedString(protocolType)).append("\n");
+ sb.append(" connectorType: ").append(toIndentedString(connectorType)).append("\n");
+ sb.append(" mediaConverterRequired: ").append(toIndentedString(mediaConverterRequired)).append("\n");
+ sb.append(" ifcCircuitCount: ").append(toIndentedString(ifcCircuitCount)).append("\n");
+ sb.append(" patchEquipment: ").append(toIndentedString(patchEquipment)).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("patchPanel", "connectionService", "mediaType", "protocolType", "connectorType", "mediaConverterRequired", "ifcCircuitCount", "patchEquipment"));
+
+ // a set of required properties/fields (JSON key names)
+ openapiRequiredFields = new HashSet(Arrays.asList("patchPanel", "connectionService", "mediaType", "protocolType", "connectorType"));
+ }
+
+ /**
+ * 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 ASide
+ */
+ public static void validateJsonElement(JsonElement jsonElement) throws IOException {
+ if (jsonElement == null) {
+ if (!ASide.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
+ throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in ASide is not found in the empty JSON string", ASide.openapiRequiredFields.toString()));
+ }
+ }
+
+ // check to make sure all required properties/fields are present in the JSON string
+ for (String requiredField : ASide.openapiRequiredFields) {
+ if (jsonElement.getAsJsonObject().get(requiredField) == null) {
+ throw new IllegalArgumentException(String.format(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 `patchPanel`
+ PatchPanel.validateJsonElement(jsonObj.get("patchPanel"));
+ // validate the required field `connectionService`
+ ConnectionServices.validateJsonElement(jsonObj.get("connectionService"));
+ // validate the required field `mediaType`
+ MediaTypes.validateJsonElement(jsonObj.get("mediaType"));
+ // validate the required field `protocolType`
+ ProtocolTypes.validateJsonElement(jsonObj.get("protocolType"));
+ // validate the required field `connectorType`
+ ConnectorTypes.validateJsonElement(jsonObj.get("connectorType"));
+ // validate the optional field `patchEquipment`
+ if (jsonObj.get("patchEquipment") != null && !jsonObj.get("patchEquipment").isJsonNull()) {
+ PatchEquipment.validateJsonElement(jsonObj.get("patchEquipment"));
+ }
+ }
+
+ public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
+ @SuppressWarnings("unchecked")
+ @Override
+ public TypeAdapter create(Gson gson, TypeToken type) {
+ if (!ASide.class.isAssignableFrom(type.getRawType())) {
+ return null; // this class only serializes 'ASide' and its subtypes
+ }
+ final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class);
+ final TypeAdapter